IOS crash, EXC_BREAKPOINT, no hint since Xcode 6.1

Usually I can solve the problems, but here I do not know where he came from.

I use parsing and I just make a request in the background with a completion block. The application crashes under a simple condition, and I can hardly identify anything, not print the description in any way ... Do you have any ideas? A starting point? anything? Xcode 6.1 is really strange, it seems that the debugger is faulty.

Here is the crash log:

Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 libsystem_kernel.dylib 0x000000019657a964 __kill + 8 1 MyAPP 0x00000001001f2b70 0x10009c000 + 1403760 2 libsystem_platform.dylib 0x0000000196610958 _sigtramp + 64 3 MyAPP 0x00000001001318cc 0x10009c000 + 612556 4 MyAPP 0x000000010013797c 0x10009c000 + 637308 5 MyAPP 0x0000000100135fc4 0x10009c000 + 630724 6 MyAPP 0x00000001002e408c 0x10009c000 + 2392204 7 MyAPP 0x00000001001dbf78 0x10009c000 + 1310584 8 libdispatch.dylib 0x00000001964393a8 _dispatch_call_block_and_release + 20 9 libdispatch.dylib 0x0000000196439368 _dispatch_client_callout + 12 10 libdispatch.dylib 0x000000019643d97c _dispatch_main_queue_callback_4CF + 928 11 CoreFoundation 0x000000018566d69c __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 8 12 CoreFoundation 0x000000018566b744 __CFRunLoopRun + 1488 13 CoreFoundation 0x00000001855991f0 CFRunLoopRunSpecific + 392 14 GraphicsServices 0x000000018e7275a0 GSEventRunModal + 164 15 UIKit 0x0000000189eca780 UIApplicationMain + 1484 16 Shuff 0x0000000100129474 0x10009c000 + 578676 17 libdyld.dylib 0x0000000196462a04 start + 0 

And here is an example iOS code:

 var query = PFQuery(className: "_User") query.whereKey("facebookId", containedIn: ids) query.findObjectsInBackgroundWithBlock(){ results, error in if var resultsvar = results? { self.functionToCall(resultsvar) } } 

and the failure of the ToCall function.

Perhaps this may help:

0 0x00000001001679c8 specializing in Swift._ArrayBuffer._nonNative.getter: Swift.Optional [inlined] ()

+6
source share
2 answers

Yes!!! The debugger does not work very well! I was able to find the correct lines by doing the following: put a breakpoint at the beginning of where you think the application will crash, step by step, remember the bottom line that you went through. Even if the debugger falls on another, the line you are looking for is probably the lowest.

+3
source

This is just an assumption, but I was working on something similar, and I think you need to change this code to:

 query.findObjectsInBackgroundWithBlock(){ results?, error? in if var resultsvar = results { self.functionToCall(resultsvar) } } 

Note that I made both the results and the error optional. In my case, I provided a block defined in Obj-C, and in Obj-C these objects can be legal == nil. Therefore, I think you should define them as options in Swift.

0
source

Source: https://habr.com/ru/post/977235/


All Articles