Whenever I try to add something to my array in the method nothing gets added to the array. I'm wanting it to when you press the button it will add a new object to the array.
// JBNumberGeneration.h
#import <Cocoa/Cocoa.h>
@interface JBNumberGeneration : NSObject {
IBOutlet NSTextField *displayLabel;
int randNum;
int level;
int i;
NSMutableArray* userNumSequence;
}
-(IBAction)logSequenceNumber:(id)sender;
@end
// JBNumberGeneration.m
#import "JBNumberGeneration.h"
@implementation JBNumberGeneration
-(IBAction)logSequenceNumber:(id)sender{
NSString *titleOfButton = [sender title];
int sequenceNumber = [titleOfButton integerValue];
int count = [userNumSequence count];
i++;
[userNumSequence addObject:[NSNumber numberWithInteger:sequenceNumber]];
NSLog(@"Array size: %i", count);
}
@end