And because they are immutable types, if they are mutable then retain is probable the appropriate behaviour. Copy will become retain for truly immutable objects and if you get a subclass that is mutable then you don't want that changing under you so copy gives you a new immutable version.

Assign really is not the right thing to do in this situation, what is to stop lessonDuration from disappearing underneath you. If you are trying to stop circular retains then assign is what you use, for example a container object retains its children, the children should not retain the parent.

On 17/10/2008, at 14:02 , Charles Steinman wrote:

@property (nonatomic, retain) NSString* lessonTitle;
@property (nonatomic, retain) NSDate *referDate;
@property (assign) NSNumber * lessonDuration;

Why is lessonDuration assign? That's begging for a crash. All three of these should be copy since the classes all conform to NSCopying.

Nathan Day
[EMAIL PROTECTED]
http://homepage.mac.com/nathan_day/

_______________________________________________

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

This email sent to [EMAIL PROTECTED]

Reply via email to