私は開発中、このエラーのために問題に直面しているiphone developementに新しいです。私はそれが生産された場所からそれを辿ることができません。objective-c:スタックトレースから例外プロデューサの場所を理解できませんか?
app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 5 beyond bounds [0 .. 4]'
*** Call stack at first throw:
(
0 CoreFoundation 0x012dcbe9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x014315c2 objc_exception_throw + 47
2 CoreFoundation 0x012d26e5 -[__NSArrayM objectAtIndex:] + 261
3 Dispatch 0x0002feeb -[ZoneFareTaxi parseMessage:] + 754
4 Dispatch 0x0002fbf0 -[ZoneFareTaxi initWithMessageString:] + 92
5 Dispatch 0x0003b949 -[ServerConnection onUdpSocket:didReceiveData:withTag:fromHost:port:] + 8862
6 Dispatch 0x0002350e -[AsyncUdpSocket maybeCompleteCurrentReceive] + 458
7 Dispatch 0x-[AsyncUdpSocket doReceive:] + 1364
8 Dispatch 0x00022c60 -[AsyncUdpSocket doReceive4] + 80
9 Dispatch 0x00022add -[AsyncUdpSocket maybeDequeueReceive] + 561
10 Foundation 0x000da7f6 __NSFireDelayedPerform + 441
11 CoreFoundation 0x012bdfe3 __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 19
12 CoreFoundation 0x012bf594 __CFRunLoopDoTimer + 1220
13 CoreFoundation 0x0121bcc9 __CFRunLoopRun + 1817
14 CoreFoundation 0x0121b240 CFRunLoopRunSpecific + 208
15 CoreFoundation 0x0121b161 CFRunLoopRunInMode + 97
16 GraphicsServices 0x01a4d268 GSEventRunModal + 217
17 GraphicsServices 0x01a4d32d GSEventRun + 115
18 UIKit 0x0036a42e UIApplicationMain + 1160
19 Dispatch 0x000024b4 main + 102
20 Dispatch 0x00002445 start + 53
21 ??? 0x00000001 0x0 + 1
)
terminate called after throwing an instance of 'NSException'
アレイにアクセスする前に、print [yourArray count]; – Maulik
範囲外になっている配列があります。 IEでは、4つの要素を持つ配列を定義しましたが、5番目の要素(または負の数を持つインデックス)にアクセスしようとしています。私たちにコードを示すなら、私はあなたのためにそれを見つけようとすることができます。 –
エラーは、配列の無効なインデックスにアクセスしようとしています。 – Maulik