Hello,

Under non-ARC, an init method may be implemented like this:

- (id)init
{
    self = [super init];
    
    if (self) {
        if (<somecondition != good>) {
            [self release];
            return nil;
        }

        // Initialize ivars here as usual...
    }
    
    return self;
}

However, if something critical happens within the init method when ARC is 
activated, what would be the proper way to exit? Would it look like this?:

- (id)init
{
    self = [super init];
    
    if (self) {
        if (<somecondition != good>) {
            // Cleanup here if needed...
            return nil;
        }
    }
    
    return self;
}

Thanks,

-- Tito


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to