self.property vs. ivar of same name?
self.property vs. ivar of same name?
- Subject: self.property vs. ivar of same name?
- From: Rick Mann <email@hidden>
- Date: Sat, 8 Mar 2008 11:29:21 -0800
I was mucking about with some sample code. It had a property "window"
that was synthesized using @property, and an ivar of the same name.
The code referred to it using "self.window =". Since I generally
dislike using "self" or "this" unnecessarily, i removed the "self.",
thinking it would still work, but it didn't.
Why is that? I get that "self.window =" is calling the synthesized
setter method, but "window =" should have just assigned to the ivar
and all should've been the same, right? The property was declared with
(nonatomic, retain).
Is the difference that using the property caused the retain count to
go up by one? I'll try the experiment, but I'd sure like confirmation.
TIA,
--
Rick
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden