Reputation: 393
if I am having a function
-(void)setName:(NSString *)name setAddress:(NSString *)address
{
}
how can I call the above function in
[self performSelector:<#(SEL)#> withObject:<#(id)#> afterDelay:<#(NSTimeInterval)#>];
Upvotes: 0
Views: 145
Reputation: 3927
Use NSDictionary as the argument, and you have to define the function to accept the dictionary
[self performSelector:@selector(yourSelector:) withObject:theDictionary afterDelay:<#(NSTimeInterval)#>];
Then you can assign the value by getting the corresponding data in the dictionary
Upvotes: 4
Reputation: 29767
Try to wrap your objects into another custom object/NSArray/NSDictionary. Something like this:
NSArray *arrayObjects = [NSArray arrayWithObjects:name, address, nil];
[self performSelector:@selector(sel:) withObject:arrayObjects afterDelay:delay];
Upvotes: 2
Reputation: 22930
you should Use NSArray object. Add your parameter in NSArray object and pass that object.
Upvotes: 2