veryDisco
veryDisco

Reputation: 660

iOS 8.3 SDK changes in enforcing property declaration and case sensitivity

Prior to 8.3, this snipped of code was living (unbeknownst to me of course) in the code base I'm working on

NSNumberFormatter *nf = [[NSNumberFormatter alloc] init];
nf.NumberStyle = NSNumberFormatterDecimalStyle;

Now, checking the class reference shows that the property's name is actually

nf.numberStyle

But for some reason this was compiling in 8.2, and not in 8.3. I'm also seeing the 8.3 is forcing me to use @dynamic to override a superclass's property setter. I know that I SHOULD do this, and I will make the change, but it worked in 8.2.

There are a lot of these errors in my code base. I've looked over the release notes and haven't seen Apple document either of these changes to the SDK anywhere. Am I missing some documentation? Is there a more exhaustive list of everything Apple has changed?

Upvotes: 1

Views: 160

Answers (1)

Johannes Fahrenkrug
Johannes Fahrenkrug

Reputation: 44740

That's a great question. Maybe the way the compiler handles @properties has changed in 8.3. This post has a good explanation for why the first letter of the setter of a property was not case sensitive before: https://stackoverflow.com/a/15411523/171933

Basically it seems as if foo.bar = 1 and foo.Bar = 1 where both turned into [foo setBar:1]. So it worked for setters, but not for getters.

Seemingly this behavior changed in 8.3.

Upvotes: 1

Related Questions