When I try to call IBAction in root view it works, but when I call in subView app creashes.
Code:
- (IBAction)webButton:(id)sender {
NSLog(@"doesn't print log");
}
Here is ss off crash: http://dl.dropbox.com/u/77033905/urlInSafariCrashesUp.png
Thank’s for help
UPDATE:
Example code: http://dl.dropbox.com/u/77033905/IBActionSubView.zip
When you create your SubViewController, the variable
subthat points to it is local to theaddSubViewButton:method and will be released when that method ends. You need to keep a strong reference to that controller so that it’s not deallocated before you use it.