Note that there are some explanatory texts on larger screens.

plurals
  1. POIndex beyond bounds
    primarykey
    data
    text
    <p>I know that there are a lot of similar questions, but none of the answers helped me with my issue. </p> <p>I have function when I move one window around:</p> <pre><code>-(void)flowLayout:(SEssentialsFlowLayout *)flow didDragView:(UIView *)view{ NSLog(@"drag"); BOOL needDeleteFavourites = NO; CGPoint dragScrollPosition = [flow convertPoint:view.center toView:self]; CGPoint dragPosition = [flow convertPoint:view.center toView:self.scroll]; // original grupe view UIGroupView * orgGrView = (UIGroupView *)flow.superview.superview; UIScrollView * orgScroll = (UIScrollView *)flow.superview; for (SEssentialsFlowLayout * destinationFlow in self.flows) { // destination grupe view UIGroupView * grView = (UIGroupView *)destinationFlow.superview.superview; UIScrollView * scroll = (UIScrollView *)destinationFlow.superview; if (flow != destinationFlow &amp;&amp; grView.grupes.type == GrupeTypeEditable) { if (CGRectContainsPoint(destinationFlow.superview.superview.frame, dragPosition)) { view.center = [scroll convertPoint:dragPosition toView:scroll]; // calculate cube space int numberOfCubeOnScreen = grView.frame.size.width / (grView.frame.size.height * grView.cubeWidth) ; int delta = grView.frame.size.width - (grView.frame.size.height * grView.cubeWidth * numberOfCubeOnScreen); float oneDelta = (float) delta/(numberOfCubeOnScreen ); // destination grupe view int numberOfpage = ceil((grView.frame.size.height * grView.cubeWidth + oneDelta)* (destinationFlow.managedViews.count + 2) / grView.frame.size.width); destinationFlow.frame = CGRectMake(0, 0, grView.frame.size.width * numberOfpage, grView.frame.size.height * 0.68); scroll.contentSize = CGSizeMake(destinationFlow.frame.size.width, destinationFlow.frame.size.height); [grView.pageControll setNumberOfPages:numberOfpage]; if (orgGrView.grupes.type == GrupeTypeNotEditable) { // grabcube view UICubeVeiw * oldCubeView = (UICubeVeiw *)view; // create new cube and new cube view Cube * newCube = [oldCubeView.cube copyCube]; UICubeVeiw * newCubeVew = [oldCubeView copyCubeView:oldCubeView.cube]; // copy new cube into old cube view oldCubeView.cube = newCube; // add new cube view on old flow int newIndex = [flow.managedViews indexOfObject:view]; if (newIndex &gt; 0 &amp;&amp; newIndex&lt; flow.managedViews.count) { [flow unmanageSubview:view]; [flow addManagedSubview:newCubeVew atIndex:newIndex]; // move old cube view on new flow [destinationFlow addManagedSubview:view]; } } else{ // original grupe view int orgNumberOfpage = ceil((orgGrView.frame.size.height * grView.cubeWidth +oneDelta ) * (flow.managedViews.count ) / orgGrView.frame.size.width); flow.frame = CGRectMake(0, 0, orgGrView.frame.size.width * orgNumberOfpage, orgGrView.frame.size.height * 0.68); orgScroll.contentSize = CGSizeMake(flow.frame.size.width, flow.frame.size.height); [orgGrView.pageControll setNumberOfPages:orgNumberOfpage]; [flow unmanageSubview:view]; [destinationFlow addManagedSubview:view]; [orgGrView.grupes removeCube:((UICubeVeiw *)view).cube]; } needDeleteFavourites = YES; } } } NSLog(@"pozicija originala : %f ", orgGrView.grupes.positionIndex); if (orgGrView.grupes.positionIndex == 1 &amp;&amp; needDeleteFavourites &amp;&amp; orgGrView.grupes.cubes.count&lt;1) { NSLog(@"remove"); [self removeFavouritesFromView]; } // move scroll view up and down if (dragScrollPosition.y &lt; self.frame.size.height * 0.16) { NSLog(@"move down"); if (!self.timerIsSet) { NSLog(@"move down 1"); self.timerIsSet = YES; NSLog(@"move down 2"); self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(moveScrollVeiwUp) userInfo:nil repeats:NO ]; } } else if (dragScrollPosition.y &gt; self.frame.size.height * 0.88) { if (!self.timerIsSet) { NSLog(@"move up"); self.timerIsSet = YES; self.timer = [NSTimer scheduledTimerWithTimeInterval:0.5f target:self selector:@selector(moveScrollVeiwDown) userInfo:nil repeats:NO ]; } } else{ NSLog(@"move none"); self.timerIsSet = NO; [self.timer invalidate]; self.timer = nil; self.isFavouriteCurrentlyVisible = NO; } } </code></pre> <p>I know it is a lot of code, but when I move this window around I get strange error:</p> <pre><code>pozicija originala : 1.000000 2013-09-23 20:20:31.772 BIView Mobile[659:60b] move down 2013-09-23 20:20:31.774 BIView Mobile[659:60b] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2147483646 beyond bounds [0 .. 5]' *** First throw call stack: (0x2db25f53 0x382996af 0x2da5c5f3 0x94667 0x942a1 0x93f1f 0x92171 0x918bf 0x91759 0x3041d98d 0x302c83e3 0x30652eed 0x3028f28b 0x3028d9d3 0x302c6c41 0x302c65e7 0x3029ba25 0x3029a221 0x2daf118b 0x2daf065b 0x2daeee4f 0x2da59ce7 0x2da59acb 0x32734283 0x302fba41 0x71655 0x387a1ab7) libc++abi.dylib: terminating with uncaught exception of type NSException </code></pre> <p>This mean, if I understand correctly, that I should get some invalid index somewhere and look into array with it.</p> <p>But I always check if index is in the bounds of acceptable values. </p> <p>EDIT : </p> <p>As I was advised I put exception breakpoint, but unfortunately breakpoint stops on :</p> <pre><code>int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); } } </code></pre> <p>I printed out stack trace if helps :</p> <pre><code>2013-09-24 11:48:10.683 BIView Mobile[890:60b] Uncaught exception: *** -[__NSArrayM objectAtIndex:]: index 2147483646 beyond bounds [0 .. 2] 2013-09-24 11:48:10.755 BIView Mobile[890:60b] Stack trace: ( 0 CoreFoundation 0x2db25f6b &lt;redacted&gt; + 154 1 libobjc.A.dylib 0x382996af objc_exception_throw + 38 2 CoreFoundation 0x2da5c5f3 &lt;redacted&gt; + 230 3 BIView Mobile 0x000e34ef -[FlowPicker isLeftMost:inOrdering:] + 58 4 BIView Mobile 0x000e3129 -[FlowPicker widenedSubviewExcludingView:inOrdering:] + 640 5 BIView Mobile 0x000e2da7 -[FlowPicker indexOfPoint:currentBounds:currentIndex:inOrdering:excludingView:] + 118 6 BIView Mobile 0x000e0ff9 -[FlowEdit changeEdit:] + 524 7 BIView Mobile 0x000e0747 -[FlowEdit fireChangeEdit:afterTimeout:] + 342 8 BIView Mobile 0x000e05e1 -[FlowEdit handleLongPress:] + 360 9 UIKit 0x3041d98d &lt;redacted&gt; + 196 10 UIKit 0x302c83e3 &lt;redacted&gt; + 1138 11 UIKit 0x30652eed &lt;redacted&gt; + 48 12 UIKit 0x3028f28b &lt;redacted&gt; + 218 13 UIKit 0x3028d9d3 &lt;redacted&gt; + 282 14 UIKit 0x302c6c41 &lt;redacted&gt; + 772 15 UIKit 0x302c65e7 &lt;redacted&gt; + 666 16 UIKit 0x3029ba25 &lt;redacted&gt; + 196 17 UIKit 0x3029a221 &lt;redacted&gt; + 7096 18 CoreFoundation 0x2daf118b &lt;redacted&gt; + 14 19 CoreFoundation 0x2daf065b &lt;redacted&gt; + 206 20 CoreFoundation 0x2daeee4f &lt;redacted&gt; + 622 21 CoreFoundation 0x2da59ce7 CFRunLoopRunSpecific + 522 22 CoreFoundation 0x2da59acb CFRunLoopRunInMode + 106 23 GraphicsServices 0x32734283 GSEventRunModal + 138 24 UIKit 0x302fba41 UIApplicationMain + 1136 25 BIView Mobile 0x000bf55b main + 226 26 libdyld.dylib 0x387a1ab7 &lt;redacted&gt; + 2 ) </code></pre>
    singulars
    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.
    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