Automatically @synthesized properties in Xcode 4.4
Asked Answered
B

1

29

From the Xcode 4.4 release notes:

The compiler automatically calls @synthesize by default for unimplemented @properties

What exactly does the new default synthesizer look like? Does it create a variable of the same name as the property (or does it prefix it with an underscore, which seems to be a good practice, but required extra typing so far)?

Byrann answered 26/7, 2012 at 9:12 Comment(0)
P
55

the default is @synthesize propertyName = _propertyName

Panel answered 26/7, 2012 at 9:16 Comment(5)
-1 for Apple. How do I override this behaviour? Why can't this horrible underscore convention go away and die?Burberry
@Burberry you can always write your own synthesize, same as you did before 4.4. Whats wrong with this convention though?Panel
Yes, but there doesn't seem to be any way to change the automatically generated @synthesize. Which is inconsistent with the behaviour of @synthesize propertyName;. Don't get me started on underscores, or this will degenerate into a religious war.Burberry
more reading on the subject: useyourloaf.com/blog/2012/08/01/…Mcatee
@PawanSharma you can still use synthesize if you like, but why would you want to disable this?Panel

© 2022 - 2024 — McMap. All rights reserved.