开发者

Compile Error Relating To ActionSheet

开发者 https://www.devze.com 2023-02-28 14:54 出处:网络
I am getting compile warning: \"Imcompatable pointer types sending UIToolbar to Parameter type UITabBar\" at line \"[actionSheet showFromTabBar:self.navigationController.toolbar];\".

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

精彩评论

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