How do I add custom data while specifying a target in a UIButton?
id data = getSomeData();
[button addTarget:self
action:@selector(b
You can't really do that. What you can do is put the data in a dictionary and use the button to get it later.
E.g.
myDataDict = [NSDictionary dictionaryWithObjectsAndKeys:someData, button, nil];
Then later;
-(void) buttonPress:(id)sender
{
data = [dataDict objectForKey:sender];
}
If your buttons are specified in InterfaceBuilder you can use the 'tag' property of a button to lookup the data, although you will need to convert it to an NSNumber for use with the dictionary.