gpt4 book ai didi

iphone - 从枚举类型 'UIBarButtonSystemItem' 到不同枚举类型 'UIBarButtonItemStyle' 的隐式转换 - iPad - iOS5

转载 作者:太空狗 更新时间:2023-10-30 03:36:02 26 4
gpt4 key购买 nike

在 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。系统项用于不同的初始化方法 - initWithBarButtonSystemItem: - 这实际上可能对你更好,因为它会返回一个本地化的完成按钮,而不是你现在拥有的固定文本。

关于iphone - 从枚举类型 'UIBarButtonSystemItem' 到不同枚举类型 'UIBarButtonItemStyle' 的隐式转换 - iPad - iOS5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7919879/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com