Search code examples
objective-csenderresignfirstresponder

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"


Solution

  • Just do this:

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

    You skipped the - at the beginning, that identifies that there's a method there.