加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

iphone – 从枚举类型’UIBarButtonSystemItem’到不同枚举类型

发布时间:2020-12-14 19:54:58 所属栏目:百科 来源:网络整理
导读:在xCode 4.3下运行我的应用程序时,我在上面的主题行中收到警告. 这是违规代码: UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:map]; UIBarButtonItem *rightButton = [[UIBarButtonItem all
在xCode 4.3下运行我的应用程序时,我在上面的主题行中收到警告.

这是违规代码:

UINavigationController *navigationController = [[UINavigationController alloc]   initWithRootViewController:map];

    UIBarButtonItem *rightButton = [[UIBarButtonItem alloc] initWithTitle:@"Done"
                                                                    style:UIBarButtonSystemItemDone target:self action:@selector(removeCurrent)];
    map.navigationItem.rightBarButtonItem = rightButton;

    [self presentModalViewController:navigationController animated:YES];

有人可以帮忙吗?

谢谢 !

解决方法

UIBarButtonSystemItemDone应该是UIBarButtonItemStyleDone.系统项用于不同的init方法 – initWithBarButtonSystemItem: – 这实际上可能对你更好,因为它将返回一个本地化的完成按钮而不是你现在拥有的固定文本.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读