> // 1)
> self.serialIDs = [[IRMSerialDetailsDO alloc] init];

The alloc method allocates an instance with a retain count of 1, and
assigning it to the serialIDs property bumps it up to 2. In your
dealloc method, you will [hopefully] send it a release message which
puts it back at 1, but this means the object still survives (i.e. it
is not deallocated).

> // 2)
> IRMSerialDetailsDO *mySerialIDDO = [[IRMSerialDetailsDO alloc] init];
> self.serialIDDO = mySerialIDDO;
> [mySerialIDDO release];

Here, the alloc creates the instance with a retain count 1, assigning
it to the property bumps it up to 2, and the release right afterwards
puts it back down to 1. In your dealloc method, you will sent it
another release message which puts it at 0, and therefore the instance
is deallocated.
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to