Alright, I have my code, and I believe I have narrowed down the crashing bug to one section. Upon the view loading, my code loads the NSUserDefaults and pulls the string out of them. It then works with teh string. The problem is, I'm not sure how to pull the string out.
Here is the relative code:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *nameOne = [prefs stringForKey:@"playerOne"];
NSString *nameTwo = [prefs stringForKey:@"playerTwo"];
//do stuff with the strings
[nameOne release];
[nameTwo release];
Here is also the code for when I put the strings into the NSUserDefaults, on another View:
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];
NSString *tempName = [[NSString alloc] initWithFormat:@"You"];
[prefs setObject:tempName forKey:@"playerOne"];
NSString *tempName2 = [[NSString alloc] initWithFormat:@"Opponent"];
[prefs setObject:tempName2 forKey:@"playerTwo"];
[prefs synchronize];
I have isolated the issue to where I take the strings out of NSUserDefaults. I feel like I am taking them out wrong, but I'm not sure how else to do it. Using StringForKey may be wrong... or not allocating space? I'm not sure what the issue is, I've tried fixing it but to no avail. Help would be appreciated!