Note that there are some explanatory texts on larger screens.

plurals
  1. POObjective-C NSMutableArray:removeObjectsInRange
    primarykey
    data
    text
    <p>I have a NSMutableArray called rawData of size 198792. Each index contains an NSObject called DataSet. The interface for a DataSet is as follows:</p> <pre><code>@interface DataSet : NSObject { NSNumber *rightFoot; NSNumber *leftFoot; } </code></pre> <p>I am trying to trim down the rawData using the following line of code:</p> <pre><code>[rawData removeObjectsInRange:NSMakeRange(0, StartTime*freq-1)]; </code></pre> <p>where StartTime*freq-1 = 11799.</p> <p>I am getting an error during runtime: <strong>* Terminating app due to uncaught exception 'NSRangeException', reason: '*</strong> -[NSMutableArray objectAtIndex:]: index 198791 beyond bounds [0 .. 186992]'</p> <p>Thank you for any help!</p> <p>EDIT: stack trace</p> <pre><code>2012-02-16 17:59:31.671 fwd_analysis[8154:207] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSMutableArray objectAtIndex:]: index 198791 beyond bounds [0 .. 186992]' *** Call stack at first throw: ( 0 CoreFoundation 0x00dc25a9 __exceptionPreprocess + 185 1 libobjc.A.dylib 0x00f16313 objc_exception_throw + 44 2 CoreFoundation 0x00db80a5 -[__NSArrayM objectAtIndex:] + 261 3 fwd_analysis 0x00002a99 -[fwd_analysisViewController startButtonPressed:] + 252 4 UIKit 0x002b24fd -[UIApplication sendAction:to:from:forEvent:] + 119 5 UIKit 0x00342799 -[UIControl sendAction:to:forEvent:] + 67 6 UIKit 0x00344c2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 7 UIKit 0x003437d8 -[UIControl touchesEnded:withEvent:] + 458 8 UIKit 0x002d6ded -[UIWindow _sendTouchesForEvent:] + 567 9 UIKit 0x002b7c37 -[UIApplication sendEvent:] + 447 10 UIKit 0x002bcf2e _UIApplicationHandleEvent + 7576 11 GraphicsServices 0x0171a992 PurpleEventCallback + 1550 12 CoreFoundation 0x00da3944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52 13 CoreFoundation 0x00d03cf7 __CFRunLoopDoSource1 + 215 14 CoreFoundation 0x00d00f83 __CFRunLoopRun + 979 15 CoreFoundation 0x00d00840 CFRunLoopRunSpecific + 208 16 CoreFoundation 0x00d00761 CFRunLoopRunInMode + 97 17 GraphicsServices 0x017191c4 GSEventRunModal + 217 18 GraphicsServices 0x01719289 GSEventRun + 115 19 UIKit 0x002c0c93 UIApplicationMain + 1160 20 fwd_analysis 0x00002758 main + 102 21 fwd_analysis 0x000026e9 start + 53 ) terminate called after throwing an instance of 'NSException' Current language: auto; currently objective-c Program received signal: “SIGABRT”. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload