0

Normally the crash log indicates where this might be happening, but in this case, this is all I am getting. Lets say my main view is A and I have A,B, and C views.

This only happens if I do the following:

Go from A to B to C, go out of app and load up a few other apps. Then return to my app, go back to B, then go back to A (THIS IS WHERE IT CRASHES).

EDIT - I had posted the wrong thread before...here is the correct thread

CRASH LOG:

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x4daf03bd
Crashed Thread:  7

Thread 7 name:  Dispatch queue: com.apple.root.default-priority
Thread 7 Crashed:
0   libobjc.A.dylib                 0x36f22f78 objc_msgSend + 16
1   Foundation                      0x33707d04 _NSDescriptionWithLocaleFunc + 44
2   CoreFoundation                  0x34f3a96e __CFStringAppendFormatCore + 7998
3   CoreFoundation                  0x34eb51d8 _CFStringCreateWithFormatAndArgumentsAux + 68
4   Foundation                      0x33707c2e +[NSString stringWithFormat:] + 54
5   MyGreatApp                      0x00061028 -[DataAccessor getProducts:div:productType:cat:searchsilver:completion:] (DataAccessor.m:301)
6   MyGreatApp                      0x00017196 __36-[products showNationalCategories]_block_invoke_0 (products.m:1688)
7   libdispatch.dylib               0x37886c52 _dispatch_call_block_and_release + 6
8   libdispatch.dylib               0x378927b4 _dispatch_worker_thread2 + 256
9   libsystem_c.dylib               0x35b45df4 _pthread_wqthread + 288
10  libsystem_c.dylib               0x35b45cc8 start_wqthread + 0

Here is line 301 (Note, all the objects going into the string are NSStrings):

NSString *urlStr = [NSString stringWithFormat:@"%@?api_key=%@&device[duid]=%@&division=%@",apiUrl,apiKey, duid, division];
4

2 回答 2

0

我的疯狂猜测是 viewDidUnload 中的某些东西正在被解除分配,这是依赖的,并且没有被正确地重新初始化。在大多数情况下,viewDidUnload 在测试时不会被调用;这是我认为在您离开其他应用程序时可能发生的一件事。当视图出现在屏幕上时,对 A 的所有属性进行复查,并复查它们是否为非零。

于 2012-06-20T21:49:54.880 回答
0

我认为当呈现与您期望的视图控制器不同的视图控制器时,您的回调正在运行。我认为首先最好通过 NSLogging 在单独的代码行上找出错误的字符串指针。您还为那些字符串参数使用了任何 _block 装饰(或使用它们两次:在块内部和外部) - 这会破坏它们的保留。

于 2014-04-16T16:28:41.360 回答