So I have an array of student names. I'm running test data so I'm going through a loop allocating and initializing each student then just throwing it in stuArr - If I NSLog my Student.h init() method it will give me the names I would expect but when I try to call them outside of my method I get null values:
- (void)viewDidLoad
{
[super viewDidLoad];
for (int i = 0; i < 5; i++) {
stuArr = [stuArr arrayByAddingObject:[[Student alloc] init]];
id test = [stuArr objectAtIndexedSubscript:i];
NSLog(@"%@", [test stuName]);
}
}
Am I missing something vital here? If need be I can throw in my Student.m File but everything seems fine there.
stuArray?stuArr = [[NSMutableArray alloc] init];otherwise it isnil.