Class viewCtrClass = [[self appControllers] objectForKey:[item controllerStr]];
UIViewController *controller = [[viewCtrClass alloc] init];
With:
Class viewCtrClass = nil;
UIViewController *controller = nil;
if ([[[item controllerStr] substringToIndex:4] isEqualToString:@"http"]) {
viewCtrClass = [[self appControllers] objectForKey:@"webViewer"];
controller = [[viewCtrClass alloc] init];
[(WebViewController *)controller setURL:[item controllerStr]];
} else {
viewCtrClass = [[self appControllers] objectForKey:[item controllerStr]];
controller = [[viewCtrClass alloc] init];
}
This way you can use the target / controllerStr property to pull out the correct View Controller, and use it to store the URL in. The target / controllerStr is only used to pull out the correct UIViewController from the dictionary, so this should work as intended. Then when the WebViewController is presented, just get it to auto load the URL you passed through.
I might add a dictionary to MyLauncherItem to allow the passing of data to the presented launcher item.