Search code examples
xcodeidentifierdealloc

Expected identifier or '(' for void dealloc


I am getting a "expected identifier or'(' message in Xcode. This comes after (void)dealloc; I am not sure how to fix this or why it is coming up. If someone could tell me how to fix this, I would appreciate it. I am basic at this, so I would appreciate a step by step solution. Thanks a lot! My code:

   - (void)dealloc;
{
    [testView release];
    [lblMsg release];
    [super dealloc];
    [scroll release];
    [pager release];
    [viewControllers release];
    [super dealloc];
}

Update: Thank you all for your outstanding help. I have resolved the issue by using a completely different method to reach my goal.


Solution

  • Get rid of the semicolon after

    - (void) dealloc
    

    in your .m file.

    You only need the semicolon after that dealloc method declaration in your .h file.