On 23/06/2009, at 12:31 , WT wrote:
So, after I scratched my head silly for several minutes, it suddenly came to me. If I'm going to use a property, I *must* refer to it as object.property rather than simply as property. In the specific example I had, I should not have replaced all those repeated chunks of code with

textFieldPreviousContent = textField.text;

but with

self.textFieldPreviousContent = textField.text;

This is why I never use the same property name as ivar name.

Many people use the _ prefix for ivars, but whatever prefix or suffix you choose, give the ivar a different name, and then you know when you're accessing the ivar and when you're using the setter/getter.

@synthesize textFieldPreviousContent = _textFieldPreviousContent;

Enjoy,
   Peter.
--
     Clipboard Switching and Macros with Keyboard Maestro

Keyboard Maestro <http://www.keyboardmaestro.com/> Macros for your Mac
<http://www.stairways.com/>           <http://download.stairways.com/>



_______________________________________________

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