When i run my app using breakpoint it runs fine and gives no error,but when i remove breakpoint and rut,it crashes.And it doesn't crash on simulator and crashes on device.So in this case how to find error?
Asked
Active
Viewed 236 times
0
-
enable zombies and check once – Anbu.Karthik Feb 22 '17 at 05:49
-
How to enable zombies? – sp309 Feb 22 '17 at 05:52
-
see this http://stackoverflow.com/questions/5386160/how-to-enable-nszombie-in-xcode – Anbu.Karthik Feb 22 '17 at 05:53
-
@sp309 or you can try reset your simulator once. – Tushar Sharma Feb 22 '17 at 05:57
-
No still this problem happens@Anbu.Karthik – sp309 Feb 22 '17 at 06:23
-
Can you show related codes ? – Raptor Feb 22 '17 at 06:51
-
You can check the device logs.. Just run the app on device and then xcode-window - device..Select your device and Try to find what is going wrong.. – Nilesh Jha Feb 22 '17 at 08:40
3 Answers
0
It's a thread issue .. try to
runOnMainQueueWithoutDeadlockingUpload(^{
//Do stuff
});
void runOnMainQueueWithoutDeadlockingUpload(void (^block)(void))
{
if ([NSThread isMainThread])
{
block();
}
else
{
dispatch_sync(dispatch_get_main_queue(), block);
}
}
for heavy task you doing while starting the app.

vivek
- 459
- 3
- 14
-
i have checked multiple times.it crashes when running directly but when i use breakpoint it doesn't crash. – sp309 Feb 22 '17 at 06:26
-
@VishalSonawane because when puts breakpoint the task in the background thread finishes and hence it is not crashing on the other hand when he runs in the real time background which may be giving some data is not finished yet. hence crashes.. – vivek Feb 22 '17 at 07:02
-
@vivek unsubscribe failed with error: (Error Domain=OTSessionErrorDomain Code=1112 "(null)") – sp309 Feb 22 '17 at 07:07
-
https://tokbox.com/developer/sdks/ios/reference/Constants/OTSessionErrorCode.html check this out for error code 1112 and see what's missing in your code – vivek Feb 22 '17 at 07:14
-
0
it is very simple when u put break point it is not crash and without breakpoint it is crash so what code u are execute put some delay then it will resolve
double delayInSeconds = 1.0;
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(delayInSeconds * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
// Add Your code here
});

Ravi Panchal
- 1,285
- 10
- 22
0
Something happening wrong in async thread and in special cases other thread do work slowly! You need check these cases.

Vladimir Prigarin
- 436
- 5
- 20