How can I send parameters to my function?
- (void)alertURL {
NSLog(@"%@",url);
}
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
alertURL(url);
return YES;
}
If there is anything else wrong, please tell me 🙂
The proper way to define what you call a function, which is a method in Obj-C talk, is to add a colon and the type in parentheses and the parameter variable name.
Then to invoke the method, you use the square brackets.
Functions are still supported, they’re just regular C functions, which mean they’re not associated with any object. What you want to be doing is sending a message to the object using the square brackets. It’s an Obj-C thing, you’ll get used to it.