Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am getting the warning in the subject line above when running my app under xCode 4.3.

Here is the offending 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 ?

Thank you !

like image 785
GuybrushThreepwood Avatar asked Oct 27 '11 17:10

GuybrushThreepwood


1 Answers

UIBarButtonSystemItemDone should be UIBarButtonItemStyleDone. System item is used in a different init method - initWithBarButtonSystemItem: - which may actually be better for you as it will return a localised done button rather than the fixed text you have now.

like image 200
jrturton Avatar answered Nov 07 '22 07:11

jrturton