iphone - UIButtonType issue -


i have created uibutton passing integer value this.

 uibutton* custom_newbackbutton = [uibutton buttonwithtype:101];  [custom_newbackbutton addtarget:self action:@selector(backbuttonaction) forcontrolevents:uicontroleventtouchupinside];  [custom_newbackbutton settitle:@"back" forstate:uicontrolstatenormal];   uibarbuttonitem* newbackbutton = [[uibarbuttonitem alloc] initwithcustomview:custom_newbackbutton];  [[self navigationitem] setleftbarbuttonitem: newbackbutton]; 

in of classes works of classes fails "invalid conversion int uibuttontype". recommended way handle this. have use 101 button , feel.

regards,

dilshan

the following button types officially documented in apple documentation material:

 typedef enum {    uibuttontypecustom = 0,    uibuttontyperoundedrect,    uibuttontypedetaildisclosure,    uibuttontypeinfolight,    uibuttontypeinfodark,    uibuttontypecontactadd, } uibuttontype; 

enjoy! please avoid using direct values. values of constants might change , break app.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -