• 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: Understanding the "declaration of instance variables in the interface is deprecated" warning.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.


  • Subject: Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.
  • From: Mark Wright <email@hidden>
  • Date: Wed, 03 Jun 2015 20:45:13 +0100

> On 03 Jun 2015, at 19:54, Alex Zavatone <email@hidden> wrote:
>
>
> On Jun 3, 2015, at 2:30 PM, Mark Wright wrote:
>
>> The only potential problem is ivars that don’t have the leading underscore.
>
> My project has 377 of them.  All named the same as the property, if there is a property to begin with.   That's why I'm walking down this fun little road.


Yeah, tis dog work and there’s nothing much to be done but get stuck in.  I don’t know if it’ll help but this is how I’d initially tackle a wholesale ivar-to-property refactor manually:

Step 1  -  Cut and paste all ivars out of header and into @implementation block - should be no change from compiler’s point of view.  This takes the header file out of the equation.

Step 2  -  Comment out or remove any explicit @synthesize statements.

Step 3  -  Now select each ivar in turn in the newly pasted block and ‘Edit All in Scope’ (ctrl + command + E).  This will select them throughout the entire file.  Add the leading underscore so that they conform to the expected pattern.

Step 4  -  Now that they will mirror their property if it exists, one-by-one comment them out and see if any compiler errors show up.  If not then the property is intact and the ivar is likely not needed.  If there are errors then maybe a property needs creating for that one or the ivar can stay depending on its role in the class.




_______________________________________________

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


References: 
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Mark Wright <email@hidden>)
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Uli Kusterer <email@hidden>)
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Alex Zavatone <email@hidden>)
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Uli Kusterer <email@hidden>)
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Mark Wright <email@hidden>)
 >Re: Understanding the "declaration of instance variables in the interface is deprecated" warning. (From: Alex Zavatone <email@hidden>)

  • Prev by Date: Re: Looking at self = [super init].
  • Next by Date: Questions about NSPopupButtonCell and NSBrowser
  • Previous by thread: Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.
  • Next by thread: Re: Understanding the "declaration of instance variables in the interface is deprecated" warning.
  • Index(es):
    • Date
    • Thread