I have been using this function to generate a time stamp. I found it somewhere here on Stack Overflow.
#objc public class var timestamp: String {
return "\(Int(NSDate().timeIntervalSince1970 * 1000))"
}
It has been working without issue, but I just got a EXC_BAD_INSTRUCTION:
fatal error: floating point value cannot be converted to Int because it is greater than Int.max
As the development of this app is nearing completion it makes me nervous to all of the sudden see it cause a EXC_BAD_INSTRUCTION. This is running in the Simulator, but I have a valid date and time set.
Any ideas or suggestions or are greatly appreciated. Below is the backtrace.
(lldb) bt
* thread #1: tid = 0x15c4d, 0x04a30393 libswiftCore.dylib`function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 67, queue = 'com.apple.main-thread', stop reason = EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)
frame #0: 0x04a30393 libswiftCore.dylib function signature specialization <Arg[0] = Exploded, Arg[1] = Exploded, Arg[2] = Dead, Arg[3] = Dead> of Swift._fatalErrorMessage (Swift.StaticString, Swift.StaticString, Swift.StaticString, Swift.UInt) -> () + 67
* frame #1: 0x00afe0c9 TDTPhotoLib static
TDTDeviceUtilites.timestamp.getter(self=TDTPhotoLib.TDTDeviceUtilites) + 409 at TDTDeviceUtilites.swift:127
frame #2: 0x00166979 Oilist TDTPaintingViewController.finshedSession(sender=0x7aee0fb0, self=0x7e9d3800) -> () + 169 at TDTPaintingViewController.swift:1370
frame #3: 0x00102896 Oilist TDTOilistMenuPainting.goForward(sender=0x7aee0fb0, self=0x7c218770) -> () + 374 at TDTOilistMenuPainting.swift:149
frame #4: 0x0010290d Oilist #objc TDTOilistMenuPainting.goForward(UIButton!) -> () + 61 at TDTOilistMenuPainting.swift:0
frame #5: 0x018a80b5 libobjc.A.dylib -[NSObject performSelector:withObject:withObject:] + 84
frame #6: 0x0336ee38 UIKit -[UIApplication sendAction:to:from:forEvent:] + 118
frame #7: 0x0336edb7 UIKit -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 64
frame #8: 0x03512f3b UIKit -[UIControl sendAction:to:forEvent:] + 79
frame #9: 0x035132d4 UIKit -[UIControl _sendActionsForEvents:withEvent:] + 433
frame #10: 0x035122c1 UIKit -[UIControl touchesEnded:withEvent:] + 714
frame #11: 0x033ef52e UIKit -[UIWindow _sendTouchesForEvent:] + 1095
frame #12: 0x033f05cc UIKit -[UIWindow sendEvent:] + 1159
frame #13: 0x03391be8 UIKit -[UIApplication sendEvent:] + 266
frame #14: 0x03366769 UIKit _UIApplicationHandleEventQueue + 7795
frame #15: 0x02423e5f CoreFoundation __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
frame #16: 0x02419aeb CoreFoundation __CFRunLoopDoSources0 + 523
frame #17: 0x02418f08 CoreFoundation __CFRunLoopRun + 1032
frame #18: 0x02418846 CoreFoundation CFRunLoopRunSpecific + 470
frame #19: 0x0241865b CoreFoundation CFRunLoopRunInMode + 123
frame #20: 0x07031664 GraphicsServices GSEventRunModal + 192
frame #21: 0x070314a1 GraphicsServices GSEventRun + 104
frame #22: 0x0336ceb9 UIKit UIApplicationMain + 160
frame #23: 0x00131ed1 Oilist main + 145 at AppDelegate.swift:14
frame #24: 0x05631a25 libdyld.dylib start + 1
Your code will crash on all 32-bit platforms (such as iPhone 4, 5)
because the result of
NSDate().timeIntervalSince1970 * 1000
// E.g.: 1464850525047.38
does not fit into a 32-bit integer. As a solution, use 64-bit integers:
Int64(NSDate().timeIntervalSince1970 * 1000)
Alternatively, if the intention is to create a string representing
the milliseconds, use string formatting instead of an integer conversion:
String(format:"%.0f", NSDate().timeIntervalSince1970 * 1000)
Related
I am using Janus videoroom with Webrtc. Everything working fine. But when i go for ending call. And dismiss the current view controller - App Crashed.
I am unable to get the point of crashing so i can resolve.
the current view disappeared fine also. Logs shows this:
callDropButton Clicked
Videoroom viewDidDisappear
Videoroom screen dismissed completely
I am getting the crash at this 1st line of Appdelegate:
class AppDelegate: UIResponder, UIApplicationDelegate {
I am also attaching backtrace logs for more info. But this is not making any sence to me:
(lldb) bt
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0xd000000000000040)
frame #0: 0x00000001012e0024 WebRTC`___lldb_unnamed_symbol6199$$WebRTC + 120
frame #1: 0x00000001013c70f0 WebRTC`___lldb_unnamed_symbol12553$$WebRTC + 44
frame #2: 0x00000001013c7078 WebRTC`___lldb_unnamed_symbol12551$$WebRTC + 128
frame #3: 0x00000001013c6964 WebRTC`___lldb_unnamed_symbol12523$$WebRTC + 12
frame #4: 0x00000001013c6944 WebRTC`___lldb_unnamed_symbol12521$$WebRTC + 52
frame #5: 0x00000001012e16b0 WebRTC`___lldb_unnamed_symbol6278$$WebRTC + 36
frame #6: 0x00000001a37357cc libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 148
frame #7: 0x00000001a37456b8 libobjc.A.dylib`objc_destructInstance + 68
frame #8: 0x00000001a3745720 libobjc.A.dylib`object_dispose + 16
frame #9: 0x00000001012f343c WebRTC`___lldb_unnamed_symbol6908$$WebRTC + 328
frame #10: 0x000000010050c8b0 Interpret`outlined destroy of RTCVideoTrack? at <compiler-generated>:0
frame #11: 0x00000001005346ec Interpret`#objc ConnectionViewController.__ivar_destroyer(self=0x0000000154016800) at ConnectionViewController.swift:0
frame #12: 0x00000001a37357cc libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 148
frame #13: 0x00000001a37456b8 libobjc.A.dylib`objc_destructInstance + 68
frame #14: 0x00000001a3745720 libobjc.A.dylib`object_dispose + 16
frame #15: 0x00000001d04a5de8 UIKitCore`-[UIResponder dealloc] + 152
frame #16: 0x00000001cfeced0c UIKitCore`-[UIViewController dealloc] + 1748
frame #17: 0x00000001cfe07594 UIKitCore`-[UIPresentationController .cxx_destruct] + 372
frame #18: 0x00000001a37357cc libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 148
frame #19: 0x00000001a37456b8 libobjc.A.dylib`objc_destructInstance + 68
frame #20: 0x00000001a3745720 libobjc.A.dylib`object_dispose + 16
frame #21: 0x00000001cfe030fc UIKitCore`-[UIPresentationController dealloc] + 60
frame #22: 0x00000001cfe08d5c UIKitCore`-[_UIFullscreenPresentationController dealloc] + 60
frame #23: 0x00000001a3ff7a44 libsystem_blocks.dylib`_Block_release + 152
frame #24: 0x00000001cfefbaf8 UIKitCore`-[_UIViewControllerTransitionContext .cxx_destruct] + 116
frame #25: 0x00000001a37357cc libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 148
frame #26: 0x00000001a37456b8 libobjc.A.dylib`objc_destructInstance + 68
frame #27: 0x00000001a3745720 libobjc.A.dylib`object_dispose + 16
frame #28: 0x00000001cfefa3f8 UIKitCore`-[_UIViewControllerTransitionContext dealloc] + 60
frame #29: 0x00000001cfefbbb0 UIKitCore`-[_UIViewControllerOneToOneTransitionContext dealloc] + 84
frame #30: 0x00000001a37357cc libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 148
frame #31: 0x00000001a37456b8 libobjc.A.dylib`objc_destructInstance + 68
frame #32: 0x00000001a3745720 libobjc.A.dylib`object_dispose + 16
frame #33: 0x00000001a3ff7a44 libsystem_blocks.dylib`_Block_release + 152
frame #34: 0x00000001a444ca38 CoreFoundation`-[__NSSingleObjectArrayI dealloc] + 44
frame #35: 0x00000001d04870e8 UIKitCore`_runAfterCACommitDeferredBlocks + 356
frame #36: 0x00000001d0475bfc UIKitCore`_cleanUpAfterCAFlushAndRunDeferredBlocks + 352
frame #37: 0x00000001d04a2a6c UIKitCore`_afterCACommitHandler + 116
frame #38: 0x00000001a44ef4fc CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 32
frame #39: 0x00000001a44ea224 CoreFoundation`__CFRunLoopDoObservers + 412
frame #40: 0x00000001a44ea7a0 CoreFoundation`__CFRunLoopRun + 1228
frame #41: 0x00000001a44e9fb4 CoreFoundation`CFRunLoopRunSpecific + 436
frame #42: 0x00000001a66eb79c GraphicsServices`GSEventRunModal + 104
frame #43: 0x00000001d047bc38 UIKitCore`UIApplicationMain + 212
* frame #44: 0x0000000100522d7c Interpret`main at AppDelegate.swift:13:7
frame #45: 0x00000001a3fad8e0 libdyld.dylib`start + 4
Make sure you have something like this in your deinit ("screen dismissed completely"?):
rtcAudioSession.remove(self)
peerConnection.close()
[localAudioTrack,
localVideoTrack,
remoteAudioTrack,
remoteVideoTrack,
].forEach { track in
track.isEnabled = false
}
Check on every WebRTC object you've created, if the class have something like close(), isEnabled = false, etc, you should call it in deinit.
According to your crashlog, the problem is in one of RTCVideoTrack objects. Try commenting out all the code that creates any of the RTCVideoTrack and see if that helps. If it helps, uncomment them out one by one to determine which one is causing the problem.
My problem is that my app has been crashing since iOS 13. The app doesn't work on any iPhone anymore. A bit strange, however, is that the iPhone simulators on iOS 13 all work fine. Here is the output of the lldb console after I type bt:
* thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48)
frame #0: 0x00000001b952d268 AVFAudio`-[AVAudioPlayer(AVAudioPlayerPriv) privRemoveSessionListener] + 16
frame #1: 0x00000001b952b9ac AVFAudio`-[AVAudioPlayer dealloc] + 32
frame #2: 0x0000000100dae9e4 Ducko`#objc StartView.__ivar_destroyer(self=0x0000000101e2de70) at startView.swift:0
frame #3: 0x00000001ac8c01e8 libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 112
frame #4: 0x00000001ac8d2d14 libobjc.A.dylib`objc_destructInstance + 88
frame #5: 0x00000001ac8d9db8 libobjc.A.dylib`_objc_rootDealloc + 48
frame #6: 0x00000001b0bd19b8 UIKitCore`-[UIResponder dealloc] + 152
frame #7: 0x00000001e1a40900 UIKit`-[UIResponderAccessibility dealloc] + 60
frame #8: 0x00000001c528e93c SpriteKit`-[SKNode dealloc] + 100
frame #9: 0x00000001c52461dc SpriteKit`-[SKScene dealloc] + 332
frame #10: 0x00000001c526bf54 SpriteKit`-[SKView _update:] + 568
frame #11: 0x00000001c526761c SpriteKit`__51-[SKView _vsyncRenderForTime:preRender:postRender:]_block_invoke.340 + 388
frame #12: 0x00000001c5266a1c SpriteKit`-[SKView _vsyncRenderForTime:preRender:postRender:] + 520
frame #13: 0x00000001c5269bd0 SpriteKit`__29-[SKView setUpRenderCallback]_block_invoke + 200
frame #14: 0x00000001c52ac180 SpriteKit`-[SKDisplayLink _callbackForNextFrame:] + 132
frame #15: 0x0000000101c715f8 GPUToolsCore`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 168
frame #16: 0x00000001b33dd514 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 632
frame #17: 0x00000001b34a7774 QuartzCore`display_timer_callback(__CFMachPort*, void*, long, void*) + 264
frame #18: 0x00000001acaed6d4 CoreFoundation`__CFMachPortPerform + 172
frame #19: 0x00000001acb16e5c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #20: 0x00000001acb16588 CoreFoundation`__CFRunLoopDoSource1 + 444
frame #21: 0x00000001acb1145c CoreFoundation`__CFRunLoopRun + 2168
frame #22: 0x00000001acb108bc CoreFoundation`CFRunLoopRunSpecific + 464
frame #23: 0x00000001b697b328 GraphicsServices`GSEventRunModal + 104
frame #24: 0x00000001b0ba56d4 UIKitCore`UIApplicationMain + 1936
* frame #25: 0x0000000100d777c8 Ducko`main at AppDelegate.swift:14:7
frame #26: 0x00000001ac99b460 libdyld.dylib`start + 4
(lldb) * thread #1, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=1, address=0x48)
frame #0: 0x00000001b952d268 AVFAudio`-[AVAudioPlayer(AVAudioPlayerPriv) privRemoveSessionListener] + 16
frame #1: 0x00000001b952b9ac AVFAudio`-[AVAudioPlayer dealloc] + 32
frame #2: 0x0000000100dae9e4 Ducko`#objc StartView.__ivar_destroyer(self=0x0000000101e2de70) at startView.swift:0
frame #3: 0x00000001ac8c01e8 libobjc.A.dylib`object_cxxDestructFromClass(objc_object*, objc_class*) + 112
frame #4: 0x00000001ac8d2d14 libobjc.A.dylib`objc_destructInstance + 88
frame #5: 0x00000001ac8d9db8 libobjc.A.dylib`_objc_rootDealloc + 48
frame #6: 0x00000001b0bd19b8 UIKitCore`-[UIResponder dealloc] + 152
frame #7: 0x00000001e1a40900 UIKit`-[UIResponderAccessibility dealloc] + 60
frame #8: 0x00000001c528e93c SpriteKit`-[SKNode dealloc] + 100
frame #9: 0x00000001c52461dc SpriteKit`-[SKScene dealloc] + 332
frame #10: 0x00000001c526bf54 SpriteKit`-[SKView _update:] + 568
frame #11: 0x00000001c526761c SpriteKit`__51-[SKView _vsyncRenderForTime:preRender:postRender:]_block_invoke.340 + 388
frame #12: 0x00000001c5266a1c SpriteKit`-[SKView _vsyncRenderForTime:preRender:postRender:] + 520
frame #13: 0x00000001c5269bd0 SpriteKit`__29-[SKView setUpRenderCallback]_block_invoke + 200
frame #14: 0x00000001c52ac180 SpriteKit`-[SKDisplayLink _callbackForNextFrame:] + 132
frame #15: 0x0000000101c715f8 GPUToolsCore`-[DYDisplayLinkInterposer forwardDisplayLinkCallback:] + 168
frame #16: 0x00000001b33dd514 QuartzCore`CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 632
frame #17: 0x00000001b34a7774 QuartzCore`display_timer_callback(__CFMachPort*, void*, long, void*) + 264
frame #18: 0x00000001acaed6d4 CoreFoundation`__CFMachPortPerform + 172
frame #19: 0x00000001acb16e5c CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 56
frame #20: 0x00000001acb16588 CoreFoundation`__CFRunLoopDoSource1 + 444
frame #21: 0x00000001acb1145c CoreFoundation`__CFRunLoopRun + 2168
frame #22: 0x00000001acb108bc CoreFoundation`CFRunLoopRunSpecific + 464
frame #23: 0x00000001b697b328 GraphicsServices`GSEventRunModal + 104
frame #24: 0x00000001b0ba56d4 UIKitCore`UIApplicationMain + 1936 * frame #25: 0x0000000100d777c8 Ducko`main at AppDelegate.swift:14:7
frame #26: 0x00000001ac99b460 libdyld.dylib`start + 4
Does anyone have any idea how to fix the problem? I don't know where to start.
What is differance between the UIAlertView's from IOS 5 to IOS 6. In My IOS 6 all server side validation messages are not working..if We click on the Alert Button App is crash. I need Help On this.
(lldb) bt:(after bt got this log)
* thread #1: tid = 0x1c03, 0x0294209b libobjc.A.dylib`objc_msgSend + 15, stop reason = EXC_BAD_ACCESS (code=1, address=0x80000008)
frame #0: 0x0294209b libobjc.A.dylib`objc_msgSend + 15
frame #1: 0x01fc9020 UIKit`-[UIAlertView(Private) _buttonClicked:] + 294
frame #2: 0x02944705 libobjc.A.dylib`-[NSObject performSelector:withObject:withObject:] + 77
frame #3: 0x01bd9920 UIKit`-[UIApplication sendAction:to:from:forEvent:] + 96
frame #4: 0x01bd98b8 UIKit`-[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
frame #5: 0x01c9a671 UIKit`-[UIControl sendAction:to:forEvent:] + 66
frame #6: 0x01c9abcf UIKit`-[UIControl(Internal) _sendActionsForEvents:withEvent:] + 578
frame #7: 0x01c99d38 UIKit`-[UIControl touchesEnded:withEvent:] + 546
frame #8: 0x01c0933f UIKit`-[UIWindow _sendTouchesForEvent:] + 846
frame #9: 0x01c09552 UIKit`-[UIWindow sendEvent:] + 273
frame #10: 0x01be73aa UIKit`-[UIApplication sendEvent:] + 436
frame #11: 0x01bd8cf8 UIKit`_UIApplicationHandleEvent + 9874
frame #12: 0x035fedf9 GraphicsServices`_PurpleEventCallback + 339
frame #13: 0x035fead0 GraphicsServices`PurpleEventCallback + 46
frame #14: 0x02e89bf5 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
frame #15: 0x02e89962 CoreFoundation`__CFRunLoopDoSource1 + 146
frame #16: 0x02ebabb6 CoreFoundation`__CFRunLoopRun + 2118
frame #17: 0x02eb9f44 CoreFoundation`CFRunLoopRunSpecific + 276
frame #18: 0x02eb9e1b CoreFoundation`CFRunLoopRunInMode + 123
frame #19: 0x035fd7e3 GraphicsServices`GSEventRunModal + 88
frame #20: 0x035fd668 GraphicsServices`GSEventRun + 104
frame #21: 0x01bd665c UIKit`UIApplicationMain + 1211
frame #22: 0x0000255d mobiletummy`main + 125 at main.m:14
frame #23: 0x00002495 mobiletummy`start + 53
Have got the same problem. Throwing UIAlert on main thread resolved the thing for me. But on ur log stack it seems that you are already one the main thread.
I get the below error when I test my application on my iPhone, yet the error doesnt occur in the Simulator. Its when I load up my rootViewController which is a UITableView. I am relatively new to iOS programming, and I was just wondering if anybody could shed any light on it!
Regards,
Michael.
Use this code to go to my RootView.
- (IBAction)goToRootView {
RootViewController *rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStyleGrouped];
[self.navigationController pushViewController:rootViewController animated:YES];
[rootViewController release];
}
2011-09-12 14:39:55.951 LeagueProject[773:707] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 0 beyond bounds for empty array'
*** Call stack at first throw:
(
0 CoreFoundation 0x3684b64f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x33aa4c5d objc_exception_throw + 24
2 CoreFoundation 0x367b6069 -[__NSArrayM objectAtIndex:] + 184
3 LeagueProject 0x0000302f -[RootViewController tableView:numberOfRowsInSection:] + 58
4 UIKit 0x356827c7 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1338
5 UIKit 0x356836bb -[UITableViewRowData rectForFooterInSection:] + 66
6 UIKit 0x356835f5 -[UITableViewRowData heightForTable] + 40
7 UIKit 0x35683453 -[UITableView(_UITableViewPrivate) _updateContentSize] + 206
8 UIKit 0x3567ebc9 -[UITableView _rectChangedWithNewSize:oldSize:] + 384
9 UIKit 0x3567d833 -[UITableView setFrame:] + 158
10 UIKit 0x35684e0f -[UIView(Geometry) resizeWithOldSuperviewSize:] + 274
11 UIKit 0x356510bd -[UIView(Geometry) resizeSubviewsWithOldSize:] + 120
12 UIKit 0x356364e9 -[UIView(Geometry) setFrame:] + 336
13 UIKit 0x35688193 -[UIViewControllerWrapperView setFrame:] + 62
14 UIKit 0x35676079 -[UINavigationController _startTransition:fromViewController:toViewController:] + 960
15 UIKit 0x35675c43 -[UINavigationController _startDeferredTransitionIfNeeded] + 182
16 UIKit 0x35667d5d -[UINavigationController pushViewController:transition:forceImmediate:] + 640
17 UIKit 0x35667ad3 -[UINavigationController pushViewController:animated:] + 34
18 LeagueProject 0x0000917d -[splashView goToRootView] + 116
19 CoreFoundation 0x367bb571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
20 UIKit 0x3564dec9 -[UIApplication sendAction:to:from:forEvent:] + 84
21 UIKit 0x3564de69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
22 UIKit 0x3564de3b -[UIControl sendAction:to:forEvent:] + 38
23 UIKit 0x3564db8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
24 UIKit 0x3564e423 -[UIControl touchesEnded:withEvent:] + 342
25 UIKit 0x3564cbf5 -[UIWindow _sendTouchesForEvent:] + 368
26 UIKit 0x3564c56f -[UIWindow sendEvent:] + 262
27 UIKit 0x35635313 -[UIApplication sendEvent:] + 298
28 UIKit 0x35634c53 _UIApplicationHandleEvent + 5090
29 GraphicsServices 0x35f6fe77 PurpleEventCallback + 666
30 CoreFoundation 0x36822a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
31 CoreFoundation 0x3682483f __CFRunLoopDoSource1 + 166
32 CoreFoundation 0x3682560d __CFRunLoopRun + 520
33 CoreFoundation 0x367b5ec3 CFRunLoopRunSpecific + 230
34 CoreFoundation 0x367b5dcb CFRunLoopRunInMode + 58
35 GraphicsServices 0x35f6f41f GSEventRunModal + 114
36 GraphicsServices 0x35f6f4cb GSEventRun + 62
37 UIKit 0x3565fd69 -[UIApplication _run] + 404
38 UIKit 0x3565d807 UIApplicationMain + 670
39 LeagueProject 0x000025a7 main + 82
40 LeagueProject 0x00002550 start + 40
)
terminate called after throwing an instance of 'NSException'
Your error is an index 0 beyond bounds for empty array error. Put breakpoints on the lines where you access arrays. When you find out which array is causing the problem, either the solution will be trivial, or you can add a bit more to your question and ask for further help.
It looks like the problem is in your implementation of [RootViewController tableView:numberOfRowsInSection:]. You are trying to access a member of a NSMutableArray that is empty - hence the error 'index 0 beyond bounds for empty array'.
Can anyone tell me how to analyse the iPhone's device log?
In addition, can anyone explain what the following means?
0 libobjc.A.dylib 0x00007dd2 prepareForMethodLookup + 10",
Thread 0 Crashed:
0 libobjc.A.dylib 0x00007dd2 prepareForMethodLookup + 10
1 libobjc.A.dylib 0x00005162 lookUpMethod + 34
2 libobjc.A.dylib 0x0000290e _class_lookupMethodAndLoadCache + 6
3 libobjc.A.dylib 0x00002644 objc_msgSend_uncached + 20
4 iPad4HB 0x0002f112 0x1000 + 188690
5 iPad4HB 0x00010c86 0x1000 + 64646
6 CoreFoundation 0x00025166 -[NSObject performSelector:withObject:withObject:] + 18
7 UIKit 0x00055166 -[UIApplication sendAction:to:from:forEvent:] + 78
8 UIKit 0x00055106 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 26
9 UIKit 0x000550d8 -[UIControl sendAction:to:forEvent:] + 32
10 UIKit 0x00054e2a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 350
11 UIKit 0x0019a4f2 -[UISlider endTrackingWithTouch:withEvent:] + 166
12 UIKit 0x00055444 -[UIControl touchesEnded:withEvent:] + 284
13 UIKit 0x00053e4e -[UIWindow _sendTouchesForEvent:] + 322
14 UIKit 0x00053796 -[UIWindow sendEvent:] + 74
15 UIKit 0x0004f3b8 -[UIApplication sendEvent:] + 260
16 UIKit 0x0004ed24 _UIApplicationHandleEvent + 4772
17 GraphicsServices 0x00003b2c PurpleEventCallback + 660
18 CoreFoundation 0x00022d96 CFRunLoopRunSpecific + 2214
19 CoreFoundation 0x000224da CFRunLoopRunInMode + 42
20 GraphicsServices 0x000030d4 GSEventRunModal + 108
21 GraphicsServices 0x00003180 GSEventRun + 56
22 UIKit 0x000034c2 -[UIApplication _run] + 374
23 UIKit 0x000019ec UIApplicationMain + 636
24 iPad4HB 0x00002d68 0x1000 + 7528
25 iPad4HB 0x00002d1c 0x1000 + 7452
What you are looking at is a stack trace. It shows all function and method calls that your application made in a specific thread. Up to the point where it crashed.
The first line ('distance' 0) is the most recent location. So this is the place where the application most likely crashed.
The last line ('distance' 25) is the start of the application.
The libobjc.A.dylib is the place where the application crashed. This can show libraries (libobjc.A.dylib) , frameworks (UIKit) and your application (iPad4HB).
The hexadecimal number (0x00007dd2) is the memory location of that specific function or method.
The next column shows the actual function or method name. Where prepareForMethodLookup is a plain C function while -[NSObject performSelector:withObject:] is a method.
The '+ 10' is an indication of where in the function or method the call to the next method or function was made. It is an offset into the compiled code of the function, so this number is mostly meaningless.
However, if you kept your .dSYM file, then you can convert the number to a real line number in a specific file.
See for example http://www.anoshkin.net/blog/2008/09/09/iphone-crash-logs/