Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Expected identifer or ')' Objective C

(IBAction)textFieldDoneEditing:(id)sender{//Expected identifer or ')'
    [sender resignFirstResponder];
}

What's wrong? It's an example from "Beginning iOS 6 Development"

like image 960
Frank Avatar asked Nov 24 '25 02:11

Frank


1 Answers

You are missing a minus in front of your declaration:

-(IBAction)textFieldDoneEditing:(id)sender {
    [sender resignFirstResponder];
}

It is not optional - a minus (for the instance methods) or a plus (for the class methods) is required by Objective C syntax.

like image 155
Sergey Kalinichenko Avatar answered Nov 26 '25 16:11

Sergey Kalinichenko



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!