To address you point of "everything works", the interesting thing about Objective-C is that alloc sets all instance variables to nil, and sending messages to nil doesn't do anything, it just returns nil, so in most of the cases you will not see a problem until you would try to do something illegal, consider a class like this
@interface MyObject : NSObject
@property (nonatomic, strong) NSString *string;
@end
@implementation MyObject
@end
Now if we'd just alloc it as:
MyObject *m = [MyObject alloc];
the instance variable _string
, or property string
would be nil, we could send different messages to it, like [string length]
without any harm, since message to nil equals nil.
But say we then want to add this string to array, like
@[m.string]
Now you would get a exception, because NSArray cannot contain nil
, only full blown objects. You can easily fix this by initializing your value inside MyObject.init.
Pretty contrived example, but hopefully shows the point of why everything doesn't break when you don't init :)