efpies
efpies

Reputation: 3725

-[UITableView setStyle:] in iOS 6 crashing the app (but not in iOS 5.1)

For some reasons we have situations when we have to set properties from a NSDictionary to an UIView.
Everything was OK 'till the iOS 6 was released. Now -[UITableView setValue:value forKey:@"style"] is crashing the app. In iOS 6 it calls setValue:forUndefinedKey: but in iOS 5.1 it doesn't (and everything is OK then). I know that style UITableView's property is read-only but... why? I have my own implementation of setValue:forUndefinedKey: but I don't want to filter somehow such properties (it'll be difficult to).

Upvotes: 1

Views: 462

Answers (1)

user529758
user529758

Reputation:

I know that style UITableView's property is read-only but... why?

Because Apple decided to be so, and they probably have a pretty good reason for it. Don't try setting readonly properties, they will crash your app.

Upvotes: 4

Related Questions