Hi all,
I need to call a method I have defined as:
-(IBAction)next:(id)sender{ 
...
}
I want to call it in -[UIViewController viewDidload]
How can I call this method programmatically?
Hi all,
I need to call a method I have defined as:
-(IBAction)next:(id)sender{ 
...
}
I want to call it in -[UIViewController viewDidload]
How can I call this method programmatically?
[self next:nil];
self is the object receiving the message, assuming -next: is defined in the same class as -viewDidLoad.next: is the name of the message (method).sender, pass the argument nil, meaning "nothing".If -next: is defined in the App delegate but -viewDidLoad in some view controller, use
[UIApplication sharedApplication].delegate
to refer to the app delegate. So the statement becomes
[[UIApplication sharedApplication].delegate next:nil];