ios - UIActionSheet - "init" changes button style -


why button style on uiactionsheet "cancel" button change when add "init" after allocating , initializing once?

if use code shows properly:

uiactionsheet *popupquery = [[uiactionsheet alloc] initwithtitle:@"photo/camera" delegate:nil cancelbuttontitle:@"cancel" destructivebuttontitle:nil otherbuttontitles:@"capture - camera", @"upload - photo library", nil]; popupquery.actionsheetstyle = uiactionsheetstyleblackopaque; [popupquery showinview:self.view]; 

enter image description here




if use code (with ...init] added) shows im-properly , "cancel" button style changed:

uiactionsheet *popupquery = [[[uiactionsheet alloc] initwithtitle:@"photo/camera" delegate:nil cancelbuttontitle:@"cancel" destructivebuttontitle:nil otherbuttontitles:@"capture - camera", @"upload - photo library", nil] init]; popupquery.actionsheetstyle = uiactionsheetstyleblackopaque; [popupquery showinview:self.view]; 

enter image description here

i'm assuming question of curiosity (there no valid reason double "init").

the second init resets many of ivars setup in first initwithtitle.... cancelbuttonindex being reset cancel button appears regular button.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -