开发者

Compile Error Relating To ActionSheet

I am getting compile warning: "Imcompatable pointer types sending UIToolbar to Parameter type UITabBar" at line "[actionSheet showFromTabBar:self.navigationController.toolbar];".

I know this is wrong but it works and I don't know how to make it work without the warning.

- (void)share
{
    // Create the item to share (in this example, a url)
    NSURL *url = [NSURL URLWithString:@"http://getsharekit.com"];
    SHKItem *item = [SHKItem URL:url title:@"ShareKit is Awesome!"];

    // Get the ShareKit action sheet
    SHKActionSheet *actionSheet = [SHKActionSheet actionSheetForItem:item];

    // Display the ac开发者_StackOverflowtion sheet
    [actionSheet showFromTabBar:self.navigationController.toolbar];
}


The clue seems to be here;

 [actionSheet showFromTabBar:self.navigationController.toolbar];

Shouldn't you be saying;

 [actionSheet showFromToolBar:self.navigationController.toolbar];

ToolBars and TabBars are different types, hence your warning.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜