• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ARC Help
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ARC Help


  • Subject: Re: ARC Help
  • From: Matt Neuburg <email@hidden>
  • Date: Sat, 23 Mar 2013 09:24:25 -0700

On Fri, 22 Mar 2013 15:27:08 -0700, Quincey Morris <email@hidden> said:
>If you want to declare a private ivar yourself, you should do it in the implementation and not in the interface:
>
>	@implementation MyClass
>	{
>		NSNumber* _someProperty;
>	}
>	@end

And if you want to declare a private *property* yourself, or redeclare a property so as to make it, say, readonly to the public but readwrite for yourself, you do it in the implementation file, in the interface to an anonymous category ("class extension"):

// in the implementation file
@interface MyClass ()
@property ...
@end

The OP might like to read my book on this topic; it's the same for iOS and for Mac OS X, as I fancy I've put together a decent reasoned discussion, separating the pieces, as they are in fact separate matters (accessors, memory management, ARC, properties) and putting them together at the end:

http://www.apeth.com/iOSBook/ch12.html

m.

--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 6! http://shop.oreilly.com/product/0636920029717.do
_______________________________________________

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

  • Prev by Date: Re: UIViewController question
  • Next by Date: Re: unwind custom segue and uinavigationcontroller
  • Previous by thread: Re: ARC Help
  • Next by thread: UIViewController question
  • Index(es):
    • Date
    • Thread