iphone - How to get tag number of UIButton -
i using various button, , have set tag of xib files. , connected button single method -(void) note:(id)sender
.
now want retrive tag number.so can see button clicked
-(void) note:(id)sender { notesclass *note = [[notesclass alloc] initwithnibname:@"notesclass" bundle:nil]; note.notetag = sender; nslog(@"%@",note.notetag); [self.navigationcontroller pushviewcontroller:note animated:yes]; }
when print nslog output:
<uibutton: 0x4e70350; frame = (227 119; 20 18); opaque = no; autoresize = rm+bm; tag = 1; layer = <calayer: 0x4e70480>>
any 1 can please me.
try following code, surely out
uibutton *button = (uibutton *)sender; nsinteger btag = button.tag;
Comments
Post a Comment