2

Can I just omit the parameter completely? I cannot seem to find a use for it within my IBAction method.

Eimantas
  • 48,927
  • 17
  • 132
  • 168
Skyler
  • 2,834
  • 5
  • 22
  • 34
  • You'd use this if you had 2 objects which were calling that selector and you wanted to distinguish between them.http://stackoverflow.com/a/5578158/944634 – Parag Bafna Jul 22 '12 at 19:19

1 Answers1

1

Yes, you can omit it if you don't want it:

-(IBAction)action{
    // some stuff
}

Although it can come in handy in a lot of situations

Source : Apple Doc

Olotiar
  • 3,225
  • 1
  • 18
  • 37
  • [inputBox addTarget:self action:@selector(display:nil) forControlEvents:UIControlEventEditingDidEndOnExit]; because unfortunately this is not syntactically correct somehow – Skyler Jul 22 '12 at 18:34
  • [inputBox addTarget:self action:@selector(display) forControlEvents:UIControlEventEditingDidEndOnExit]; is, if the method is defined like -(void)display{ // stuff } – Olotiar Jul 22 '12 at 18:35
  • Oh wow, I see, I sort of had that earlier before adding nil, had a leftover colon. Thank you Olotiar. – Skyler Jul 22 '12 at 18:42