I have a simple method in my code that looks like this:
- (BOOL)isFirstTimeLogin
{
NSString *t_gName =
[NSString stringWithFormat:@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:kGroupIdentifierKey]];
if ([t_gName isEqualToString:@""] || t_gName == nil) {
DLog(@"LoginViewController, m:::isFirstTimeLogin, First time login happening.");
return YES;
}
DLog(@"LoginViewController, m:::isFirstTimeLogin, Not a first time login.");
return NO;
}
Just what it is, go to the settings package and extract the value from the PSTextFieldSpecifier. If I log in manually and add some arbitrary text, the code will work as expected. However, when I first install the application on a new device, the first condition is false, which should be true. After going through the code, gdb proves that the object is really zero:
(gdb) po t_gName
(Zero)
, , ? , t_gName - / PSTextFieldSpecifier. DefaultValue .
anon