0

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.

4

2 回答 2

1

去掉分号后

- (void) dealloc

在您的 .m 文件中。

您只需要 .h 文件中该 dealloc 方法声明之后的分号。

于 2013-04-28T13:03:55.933 回答
0

注意到你有 [super ...] 两次。我见过的大多数有效的示例代码都首先放置(离开)这个,而且只有一次。您可以在一行或多行之前使用 // 来查看错误是否消失以及它是否会在没有该(可能不必要的)代码的情况下运行。我发现 [... release] 行有时是允许的,但通常是不允许的,如前所述。同样, // 用于注释掉一行代码,但也可以通过简单地删除 // 来“恢复”。

于 2013-04-28T21:10:09.593 回答