I have a function (e.g. function1 ) where I have a button and an object called auxiliarStruct, and I have this line:
[btn addTarget:self action:@selector(userSelected:) forControlEvents:UIControlEventTouchUpInside];
But in @selector (userSelected) I need to pass as parameters the object needed in this function, but I donβt know how to implement it. I declared this object here:
//UsersController.h #import <UIKit/UIKit.h> @interface UsersController : NSObject{ NSInteger *prof_id; NSString *createTime; NSString *fullName; NSString *thumb; } @property (nonatomic) NSInteger *prof_id; @property (nonatomic, retain) IBOutlet NSString *createTime; @property (nonatomic, retain) IBOutlet NSString *fullName; @property (nonatomic, retain) IBOutlet NSString *thumb; @end
I call a function declared as follows:
-(void)userSelected:(id)sender{
I have an object of this class called auxiliarStruct, and this is what I need. I tried using
[btn addTarget:self action:@selector(**userSelected:auxiliarStruct**)forControlEvents:UIControlEventTouchUpInside];
but it doesnβt work. Can someone help me? Thanks.
ps: sorry for my english i know it bad
antonio__
source share