【问题标题】:Implicit conversion from enumeration type 'UIBarButtonSystemItem' to different enumeration type 'UIBarButtonItemStyle' - iPad - iOS5从枚举类型“UIBarButtonSystemItem”到不同枚举类型“UIBarButtonItemStyle”的隐式转换 - iPad - iOS5
【发布时间】:2011-10-27 17:25:54
【问题描述】:

在 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];

谁能帮忙?

谢谢!

【问题讨论】:

    标签: iphone objective-c xcode ipad sdk


    【解决方案1】:

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

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多