Model 1
NSString *name = (NSString *)[response valueForKey:@\"name\"];
[someObject doSomethingWith:name];
Model 2
The code generated by the compiler will be the same, however, there's no variable in the second case. A variable is a high-level programming concept, the resulting assembly code knows about registers and memory only. And in both cases, the return value of the innermost method call needs to be stored somewhere, so either a register or place on the stack will be used for that.
Also, id
(what - [NSDictionary valueForKey:]
returns) is generic and implicitly compatible with any object pointer type - please, don't cast its return value to NSString *
.