How do you make sure that the UIButton tag is not overwritten by the previous tag?
for example:
(IBAction)addButton:(id)sender {
if (buttoncount == 2) return
buttoncount++
UIButton *newButton
...
// Should I change this to setTag?
newButton.tag = buttoncount;
// This line doesn't seem to work
newbutton.tag = newButtonCount NSInteger(buttoncount);
...
[self.view addSubview:newButton];
}
Thanks in advance