Code:
-(IBAction)itemPhotoSwapBut:(id)sender{
NSInteger tag = [sender tag];
NSArray *photoNumArray = @[photo1selected,photo2selected,photo3selected,photo4selected]; // array of global NSNumbers instantiated to 0
butImageCounter = 0;
[[photoNumArray objectAtIndex:tag]setIntValue:butImageCounter];
}
Error
[__NSCFNumber setIntValue:]: unrecognized selector sent to instance 0x27
I seem to be struggling with this. I have 4 NSNumber objects in the header. in my awakeFromNib I assign them all to an int value of 0. I have 4 NSButtons assigned to this one method and use the [sender tag] to identify which button is pushed. In the example above I am trying to store the int value of 0 but I am getting this crash error. The error seems to indicate it is no longer in memory?