Are the two methods
- (id) myFirstMethod
{
NSObject* anObject = [[NSObject alloc] init];
[anObject autorelease];
return anObject;
}
- (id) mySecondMethod
{
NSObject* anObject = [[NSObject alloc] init];
return [anObject autorelease];
}
identical?
Yes the both methods are identical. Whenever you write a nested function or same code in multiple lines, it is all the same after compilation.