According to the Obj-C 2.0 docs:

assign
Specifies that the setter uses simple assignment. This is the default.

If your application uses garbage collection, if you want to use assign for a property whose class adopts the NSCopying protocol you should specify the attribute explicitly rather than simply relying on the default—otherwise you will get a compiler warning. (This is to reassure the compiler that you really do want to assign the value, even though it’s copyable.)


But the warning is:

"warning: 'assign' attribute on property 'portName' which implements 'NSCopying' protocol not appropriate with -fobjc-gc-only"

So, is it really inappropriate? It seems very appropriate to assign the pointer rather than allocate a new object and copy it, especially for immutable objects.

TIA,

--
Rick

_______________________________________________

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 [EMAIL PROTECTED]

Reply via email to