Strange behaviour on table view with core data

前端 未结 2 1273
时光说笑
时光说笑 2021-01-28 17:00

step by step I am advancing creating my first iOS app. Now I am experiencing a strange behaviour on a table view controller which I am not able to solve and I have been searchin

2条回答
  •  情深已故
    2021-01-28 17:17

    The first issue with code I noticed is you must add you code after

    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    

    not before it. It will guarantee that your view is, at least, loaded.

    Second, make from all your string literals const string like this and use it everywhere

    static NSString * const kUrgentState = @"Urgent";
    

    And one more common hint: add NSLog(...); or test the value of variable in debug to localise the problem, cause right now it's really to much code, but not still not enough to find a problem. Find the moment when values of variable goes wrong and then fix your question

提交回复
热议问题