I am trying to save NSData
in NSUserDefaults
in a loop, but I'm constantly getting an error.
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *index = [NSString stringWithFormat:@"alltweetsoftrend%d", i];
[defaults setObject:tweetData forKey:index];
[defaults synchronize];
Where i
is index of the loop, it means key is not null in any case. I have also checked my NSData(tweetData)
and this also is not null. I am just getting this error in saving.