简体   繁体   中英

iOS App crash at method call

I have an app in iOS that crashes as soon as I call a particular method (anywhere in the program) but before that method starts to execute. I put an NSLog at the very top of the method and it outputs a message that doesn't get sent before the app crashes.

The app crashes as soon as this method is referenced anywhere in the program. The method name is -(void) LaunchReel; and I have included it (obviously) in my header file as well. The program crashes with a EXC_BAD_ACCESS error and references an integer data type.

It crashes in the 0 objc_msgSend thread , and this error also occurs in the 2 __CFStringAppendFormatCore thread. I have no idea why this is occurring. Could it be a possible hung debugger process?

When this has happened to me, it's because my code expects one type of object and is getting another. For example, you are passing a parameter into a function that is of type NSNumber, but the function expects NSString, so when it tries to format a string with CFStringAppendFormatCore, the app crashes.

Make sure the object is the type you expect when running into an error like this.

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