Is there a difference in declaring objects in Objective-C between (1) and (2), in addition to style and personal preference?
(1) Single line declaration, allocation, initialization.
Student *myStudent = [[Student alloc] init];
(2) Multiline declaration, allocation, initialization.
Student *myStudent;
myStudent = [Student alloc];
myStudent = [myStudent init];
source
share