1
votes

I have this code:

UIBarButtonItem *backButton = [[UIBarButtonItem alloc]initWithTitle: @"Secciones" 
                                                                  style: UIBarStyleDefault
                                                                 target:nil 
                                                                 action:nil];

and on the line that says style: UIBarStyleDefault I get the following warning:

Implicit conversion from enumeration type 'UIBarStyle' to different enumeration type 'UIBarButtonItemStyle'

1

1 Answers

6
votes

You shouldn't be a using UIBarStyle, but a UIBarButtonItemStyles instead (which is, as the name suggests, meant to be used for UIBarButtonItems):

UIBarButtonItem *backButton = [[UIBarButtonItem alloc]
    initWithTitle: @"Secciones" 
    style: UIBarButtonItemStylePlain
    target:nil 
    action:nil
];