tags:

views:

25

answers:

1

I have this:

- (void) viewDidUnload;
    [super viewDidUnload];

    self.cheatName = nil;
    self.description = nil;
}

It says that viewDidUnload is undeclared, no matter what I do with it. How do I declare it?

But If I have the brackets after the viewDidUnload function, then the problems increase from 1 to 4, with 2 having to do with @end function (WTF)

Anyone have a solution? I can upload the Xcode files and other stuff if you want.

This is in "DetailsViewController.m"

A: 

-[UIViewController viewDidUnload] was introduced in iOS 3.0. Prior to that version, it didn't exist. You're probably compiling against an SDK version prior to 3.0, say 2.2.1 or something like that. Because you call [super viewDidUnload], with the 2.x SDK the compiler doesn't know about this specific method so it is undeclared as far as the compiler knows.

So you'd have to install a newer version of the iOS SDK, current is 4.0.2.

Code needs to be like this:

- (void)viewDidUnload {
    [super viewDidUnload];

    self.cheatName = nil;
    self.description = nil;
}
JoostK
I will reply if it works (downloading now)I was compiling into iPhone Simulator 3.1.3 if that helps.
nolimitsplayer
It says that the base sdk is missing
nolimitsplayer
Then go to Project -> Get Info, then search for 'Base SDK' in your Build Settings. Change the SDK accordingly to a version you have installed.
JoostK
Now I have the same errors.
nolimitsplayer
"viewDidUnload" still undeclared"Expected ';' before '{' token"Expected declaration or statement at end of input@end missing in implementation context
nolimitsplayer
Okay I fixed most of the problem, I used the correct code, but the viewDidUnload still is undeclared and expected ';' before '{' token (1st line)
nolimitsplayer