ios - Badge doesn't display value -
ios - Badge doesn't display value -
i have barbutton badge. want display integer in it.
@property (nonatomic) int section; @synthesize section; -(void)sendbadgeintback:(int)section { self.section = section; nslog(@"the numbers of sections in tableview are: %i", self.section); } nsstring *strvalue = [@(section) stringvalue]; bbbadgebarbuttonitem *barbutton = [[bbbadgebarbuttonitem alloc] initwithcustomuibutton:custombutton]; barbutton.badgevalue = strvalue;
in nslog right value.
i've tried other ways:
nsstring *strvalue = [nsstring stringwithformat:@"%d", section]; nsstring *strvalue = [nsstring stringwithformat:@"%i", section]; barbutton.badgevalue = [nsstring stringwithformat:@"%d", section];
is there reason why doesn't work?
edit:
uibutton *custombutton = [[uibutton alloc] initwithframe:cgrectmake(0, 0, 20, 20)]; [custombutton addtarget:self action:@selector(barbuttonitempressed:) forcontrolevents:uicontroleventtouchupinside]; [custombutton setimage:[uiimage imagenamed:@"afvaldag"] forstate:uicontrolstatenormal];
ios uibutton nsstring nsinteger
Comments
Post a Comment