> On 03 Jun 2015, at 19:54, Alex Zavatone <z...@mac.com> 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 (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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to