KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a function (for example function1 )where I have a button and an object called auxiliarStruct, and I have that line: [btn addTarget:self action:@selector(userSelected:) forControlEvents:UIControlEventTouchUpInside]; But in @selector(userSelected) I need to pass as parameters an object needed in that function, but I don't know how implement it. I have declared that 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 have the called function declared like this: -(void)userSelected:(id)sender{ //CODE } I have an object of this class, called auxiliarStruct and this is that I need. I tried with [btn addTarget:self action:@selector(**userSelected:auxiliarStruct**)forControlEvents:UIControlEventTouchUpInside]; but it don't works Can anyone help me? Thanks. ps: sorry for my english, i know it's bad
Tags (comma-separated)
Save Edits
Cancel