I'm using Safari to browse a webpage. After I click a button on this page, my Ipad will launch my app. So I implement the method - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
in the AppDelegate.m
.
- (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url{
if (!url) { return NO; }
NSString *URLString = [url absoluteString];
self.paramArray = [URLString componentsSeparatedByString:@"@"];
NSLog(@"%d",[self.paramArray count]);
for (int i = 1; i < [self.paramArray count]; i++) {
NSLog([self.paramArray objectAtIndex:i]);
}
return YES;
}
The url I used on the webpage was some thing like myapp://@first_part@second_part@third_part
. self.paramArray
stores the substrings of url (myapp://
first_part
second_part
third_part
).
Now I want to show these strings in the textfields in my ViewController
. How can I pass this NSArray to the ViewController
?