简体   繁体   中英

app crashes when changing viewcontroller

I have two view controllers that both return to the home VC using

[self dismissModalViewControllerAnimated:NO];

One of them works and triggers it using a storyboard created button, whilst the one that doesn't work triggers it using a programmatically created button.

When the button on the second one is pressed it does move to the home VC, but instantly crashes

Update:

New Output

** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '_questioner_session=BAh7BkkiD3Nlc3Npb25faWQGOgZFRkkiJTYxYWQ0YjBlMTY1MGIwZjZlMDA5NDkxNmI2MzQxZmFhBjsAVA%3D%3D--15054ec7f94935cfc07bad559f1d52cd65ea5e4b: An -observeValueForKeyPath:ofObject:change:context: message was received but not handled. Key path: scoringData Observed object:

It seems to crash when it gets to this point

+(void)processScoringData:(NSMutableData*)response { [DataStore dataStore].scoringData = [[NSMutableDictionary alloc]init];

After adding an exception break point I get this beside the output. Not sure if it helps?

ServerInterface
(Class) [0] = <error: unknown Class>

response = (NS MutableData*)
NSData  NSData  
NSObject    NSObject    
isa Class   0x3c35b9ac
[0] Class   <error: unknown Class>

[self dismissViewControllerAnimated:NO completion:nil]; use instead of your dismiss controller method because your method is deprecated.

Definitely work for You.

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