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

Guy*_*ood 7 iphone sdk xcode objective-c ipad

在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];
Run Code Online (Sandbox Code Playgroud)

有人可以帮忙吗?

谢谢 !

jrt*_*ton 13

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