In my AppController I have a method called 'awakeFromNib' which loads everything as the program launches. Last night I added to the awakeFromNib a NSMutableArray using this code bellow, it's a list for my RolePlaying to store kills.
In the header I placed NSMutableArray *deathList;
I have an NSButton that will take everything in the NSTextFields, put them in to NSStrings and box it in an object and store it in my deathList mutable array. It only works when I add and instantiate the deathList from within this code in the NSButton which I am hiding with the // right now.
If I put that line of code in my awakeFromNib Method I get this error when it returns the object from the NSButton method I set up
Code:
'deathList = [[NSMutableArray alloc] init];'
I have an NSButton that will take everything in the NSTextFields, put them in to NSStrings and box it in an object and store it in my deathList mutable array. It only works when I add and instantiate the deathList from within this code in the NSButton which I am hiding with the // right now.
Code:
- (IBAction)DeathCertCloseAndSaveButton:(id)sender {
MakeDeathCertificate *newEntry = [[MakeDeathCertificate alloc]init]; //I instantiate a the class
//deathList = [[NSMutableArray alloc] init];
theNameField = [nameOfTheDead stringValue]; // Get the value that in in my NSTextField
[deathList addObject:[newEntry returnTheDeathCertificate: theNameField]]; //Send the NSString to process and return an object to MutableArray
DeathCertItem *testPrint = [deathList objectAtIndex:0];
NSLog(@"Test output %@", [testPrint name]);
}
I have not released deathList. Since deathList is in the main header file it should not be a local problem and should see it? But I am guessing it is acting as it's been released and it can't find it, I am guessing?unrecognized selector sent to instance 0x456c80