主应用程序委托顶视图的UITabBarController正确方法具有的UITabBarController称为tabBarController(NewsUKDelegate.m)以解决showFromTabBar
第一个标签加载一个UIViewController果然增加了一个UITableView(FirstViewController.m)
的UITableView的加载当选择一个单元一个子类的UIViewController(StoryController.m)
我再从Sharekit
NSURL *url = [NSURL URLWithString:link];
SHKItem *item = [SHKItem URL:url title:storyTitle];
SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];
[actionSheet showFromTabBar:rootView];
[actionSheet showFromTabBar:[self view]];
加载份额actionsheet
它的工作原理(ISH),但是从它似乎是错误的顶部actionsheet加载,但重要的是它抱怨的
incompatible Objective-C types 'struct UIView *', expected 'struct UITabBar *'
when passing argument 1 of 'showFromTabBar:' from distinct Objective-C type
我试着
UIWindow *topWindow = [[UIApplication sharedApplication] keyWindow];
if (topWindow.windowLevel != UIWindowLevelNormal)
{
NSArray *windows = [[UIApplication sharedApplication] windows];
for(topWindow in windows)
{
if (topWindow.windowLevel == UIWindowLevelNormal)
break;
}
}
UIView *rootView = [[topWindow subviews] objectAtIndex:0];
NSLog(@"Root view is: %@",rootView);
[actionSheet showFromTabBar:rootView];
[actionSheet showFromTabBar:NewsUKDelegate.tabBarController];
[actionSheet showFromTabBar:NewsUKDelegate.view];
鬼混,但我只是得到崩溃,有什么解决的主要应用程序的委托工具栏
一个神奇的组合;)作品一个款待谢谢你! – JulianB 2011-05-20 15:30:08
我在这行上遇到崩溃! :( – 2014-08-31 14:19:49