this class is not key value coding-compliant for the key XXXXXX

前端 未结 4 1183
不知归路
不知归路 2020-12-02 02:07

when i try to build and run my app, it crashes and i got this in the log :

reason: \'[ setValue:forUndefinedKey:]: thi         


        
相关标签:
4条回答
  • 2020-12-02 02:12

    I have found the same error in my Application and I found solution for this after some time.

    Actually I Have given 2 action events for one button. I have removed extra connection which is assigned to button after that the problem is over.

    This is worked in my scenario. I hope it will be helpful to someone else..

    0 讨论(0)
  • 2020-12-02 02:15

    Can't be sure if this is what's happening in your case, but you'll commonly see this message if you have a connection set up in your nibs to assign an object to a property of another object, but the property is missing on the target object.

    So you might have had an IBOutlet named aproposViewController on LoadingViewController at one point, connected another view controller to it in the nib, and then removed the IBOutlet but neglected to remove the connection in the nib.

    So when the nib is loaded, it tries to set the property, only to find it doesn't exist, hence:

    reason: '[<LoadingViewController 0x6b2c5a0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key aproposViewController.'
    
    0 讨论(0)
  • 2020-12-02 02:31

    I had this problem and it was because I had an:

    vc = [[someVC alloc] initWithNibName:@"oldNibFileNameButCachedSomewhereWithOldRefToPropertyIn" bundle:nil];
    
    0 讨论(0)
  • 2020-12-02 02:36

    If you removed the connection to IBOutlet from XIB and still it happens

    Then delete the app from simulator and run again.

    0 讨论(0)
提交回复
热议问题