I try to build an rss reader. On the \"adding feed\" page, if I tap the \"add\" button, I hope to check if the feed is successfully added. If it is added, then trigger the unwin
- (UIViewController*)viewControllerForStoryboardName:(NSString*)storyboardName class:(id)class
{
UIStoryboard* storyboard = [UIStoryboard storyboardWithName:storyboardName bundle:nil];
NSString* className = nil;
if ([class isKindOfClass:[NSString class]])
className = [NSString stringWithFormat:@"%@", class];
else
className = [NSString stringWithFormat:@"%s", class_getName([class class])];
UIViewController* viewController = [storyboard instantiateViewControllerWithIdentifier:[NSString stringWithFormat:@"%@", className]];
return viewController;
}
// get the view controller
ViewController* viewController = (ViewController*)[self viewControllerForStoryboardName:@"MyStoryboard" class:[OtherViewController class]];
// Pass data here
viewController.data = myData;
// or you can push it
[self.navigationController pushViewController:viewController animated:YES];