简体   繁体   中英

-[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).

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM