Implicit conversion from enumeration type 'UIBarButtonSystemItem' to another enumeration type 'UIBarButtonItemStyle' - iPad - iOS5

I get a warning in the subject line above when starting my application in xCode 4.3.

Here is the violation code:

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

Can anyone help?

Thanks!

+7
source share
1 answer

UIBarButtonSystemItemDone must be UIBarButtonItemStyleDone . The system element is used in another init method - initWithBarButtonSystemItem: - which may be better for you, because it will return the localized "Finish" button, rather than the fixed text that you have now.

+13
source

All Articles