When I use the code -(IBAction) onClick1: (id) sender;, what will be transmitted as sender? I tried using the sender as the identifier of the object and failed (I mean, I used the code sender.tagand it didn’t return).
-(IBAction) onClick1: (id) sender;
sender
sender.tag
I am sure that when I use - (void)buttonTouched1:(UIButton *)sender;here the sender should act as an identifier for the object.
- (void)buttonTouched1:(UIButton *)sender;
Usually a variable senderis an object that sent an action message (this is not exactly guaranteed), for example, you can send an action message yourself and pass everything you want, but how it should work).
sender.tag , , , , . [sender tag], .
[sender tag]
, onClick1. , , - (IBAction) onClick1: (id) " " , , , , , to onClick1:
-(IBAction)onClick1:(id)sender { UIButton *button = (UIButton*)sender; NSLog(@"%@", button); }
Source: https://habr.com/ru/post/1774879/More articles:rails 3 link_to с ONLY_path = false - ruby-on-railsMercurial, key authentication - mercurialsectionIndexTitlesForTableView aligns correctly with sections - iphoneSelecting specific columns with active loading - ruby-on-railsplay audio and video files in GWT - gwtHow to unzip a zipped XML file on iPhone? - iosDeleting the 11th row in RadGrid makes it empty - c #Problem installing PHPUnit on Windows using PEAR and without PEAR - phpunitDoes the ASP.NET website publish any additional security benefits? - securityC # Entity Framework: how to update record and change foreign key link? - c #All Articles