Is ios7 UITableViewController's Clear on Appearance broken (from Storyboard)?

孤街浪徒 提交于 2019-12-10 18:16:22

问题


Using Storyboards in XCode5 for iOS7, I unchecked the "Clear on Appearance" checkbox for a UITableViewController. Using the version editor, I could see that the actual text in the file reacted accordingly (btw, is there a better way to see "source" of the storyboard?). But when I added

-(void) viewDidLoad {
    [super viewDidLoad];
    NSLog(@"clear on appear %d", self.clearsSelectionOnViewWillAppear);
}

It always showed as 1 (YES). Regardless of on or off in the storyboard. To get the desired affect, I had to add:

self.clearsSelectionOnViewWillAppear= NO;

to that method. Did I misunderstand the way this was supposed to work? Or is it broken?


回答1:


Yes, seems like it is broken.

This works on viewDidLoad:

self.clearsSelectionOnViewWillAppear = NO;



回答2:


Yes, looks like a bug, at least as of iOS 9.3. You can use IB's User Defined Runtime Attributes if you don't want to fix it in code:



来源:https://stackoverflow.com/questions/21296623/is-ios7-uitableviewcontrollers-clear-on-appearance-broken-from-storyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!