Is there a difference in speed between the following two cases:
A:
userName=[[NSUserDefaults standardUserDefaults] objectForKey:@"userName"];
userEmail=[[NSUserDefaults standardUserDefaults] objectForKey:@"userEmail"];
userId=[[[NSUserDefaults standardUserDefaults] objectForKey:@"userId"] intValue];
B:
userDictionary=[[NSUserDefaults standardUserDefaults] objectForKey:@"userDictionary"];
userName=[userDictionary objectForKey:@"name"];
userEmail=...etc...
Even though differences in speed might be extremely small, technically, are there performance differences?
C is fastest.
C:
No sense calling the same method over and over, when you can cache the result locally and reuse it. A method invocation is always going to be slower than accessing a local variable.