Xcode "Fix-It" should prefer property over ivar as suggestion

Originator:pcgoracke
Number:rdar://11560792 Date Originated:Wed, 30 May 2012 22:30:26 GMT
Status:Open Resolved:
Product:Developer Tools Product Version:4.3.2 (4E2002)
Classification:Enhancement Reproducible:Always
 
30-May-2012 03:28 PM Paul Goracke:
Summary:

When correcting a "bare property" typo for a property with a renamed backing ivar, the "Fix-It" recommendation should prefer invoking the getter/setter of the property, instead of recommending the backing ivar (which it currently does).

Steps to Reproduce: 

1. Create a class with a property.
2. Synthesize that property with a renamed backing ivar, such as "@synthesize example = _example;"
3. Mistype the property without "self." later in the code, such "example = nil"

Expected Results:

The "Fix-It" popup from the compiler error should promote best practice of using the "self.example" property accessor.

Actual Results:

The "Fix-It" popup suggests using "_example", using direct ivar access. I have renamed the ivar explicitly to avoid directly accessing it outside of specific conditions.



30-May-2012 03:28 PM Paul Goracke:
'PropertyFix-SampleProject.zip' was successfully uploaded

30-May-2012 03:29 PM Paul Goracke:
'Screen Shot 2012-05-30 at 3.16.51 PM.png' was successfully uploaded

Comments

Screenshot: http://cl.ly/2i0f0M0D1O1i2Z07123D Project: http://cl.ly/2O2m081B2L1r1g0w0j0D


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!