Re: About iVars declaration and property
Re: About iVars declaration and property
- Subject: Re: About iVars declaration and property
- From: David Duncan <email@hidden>
- Date: Tue, 15 Nov 2011 10:37:00 -0800
On Nov 15, 2011, at 10:34 AM, Torsten Curdt wrote:
>> No it can't. @property only says "I have methods named -foo and -setFoo:". It implies absolutely nothing about storage.
>
> How does
>
> @property (nonatomic, assign) IBOutlet NSWindow *window;
>
> not have the information that there would need to be an ivar
>
> NSWindow *window;
>
> on 32-bit?
Because you could implement this property by doing something like this:
- (NSWindow *)window
{
return [_internalDictionary objectForKey:@"window"];
}
- (void)setWindow:(NSWindow *)window
{
[_internalDictionary setObject:window forKey:@"window"];
}
And thus not increase the size of the object at all (i.e. all properties could in theory be entries in a _internalDictionary if the class decided to).
Properties are only interfaces.
--
David Duncan
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden