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

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -