Flow Layout Drag view from one container to another


#1

Hi

I am looking over the FlowLayout example project. It makes sense however I need to drag a itemview from one container(uiview) to another - is there any example for this?


#2

nevermind – I found this example https://github.com/ShinobiControls/essentials-multiflow 


#3

I am trying to use the MultiFlowDemo example to add a simple drag-and-drop capability to my application.  I am getting array index out of bounds exceptions on both the MultiFlowDemo project and in my application’s use of the sample code.  I am using v2.5.1 of ShinobiEssentials.  Has anyone else seen this?

Here’s an example of the exception:

2014-03-23 13:15:07.973 DesignTech[2703:60b] ***Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2147483646 beyond bounds [0 .. 3]'
 *** First throw call stack:
 (0x2ee4bfd3 0x399eaccf 0x2ed8285b 0xee40f 0xee049 0xedcc7 0xebf61 0xeb541 0x317ee00d 0x31699503 0x31a40af5 0x31660373 0x3165eabb 0x31697d69 0x3169768f 0x3166c8ed 0x3166af97 0x2ee1725b 0x2ee1672b 0x2ee14f1f 0x2ed7ff4f 0x2ed7fd33 0x33ca5663 0x316cb16d 0xe3409 0x39ef7ab7)

libc++abi.dylib: terminating with uncaught exception of type NSException

#4

I am trying to use the MultiFlowDemo example to add a simple drag-and-drop capability to my application.  I am getting array index out of bounds exceptions on both the MultiFlowDemo project and in my application’s use of the sample code.  I am using v2.5.1 of ShinobiEssentials.  Has anyone else seen this?

Here’s an example of the exception:

2014-03-23 13:15:07.973 DesignTech[2703:60b] ***Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 2147483646 beyond bounds [0 .. 3]'
 *** First throw call stack:
 (0x2ee4bfd3 0x399eaccf 0x2ed8285b 0xee40f 0xee049 0xedcc7 0xebf61 0xeb541 0x317ee00d 0x31699503 0x31a40af5 0x31660373 0x3165eabb 0x31697d69 0x3169768f 0x3166c8ed 0x3166af97 0x2ee1725b 0x2ee1672b 0x2ee14f1f 0x2ed7ff4f 0x2ed7fd33 0x33ca5663 0x316cb16d 0xe3409 0x39ef7ab7)

libc++abi.dylib: terminating with uncaught exception of type NSException
 
 
 Oops, sorry about the duplicate post!

#5

Yeah, I see exactly the same thing. Only started happening when I upgraded from an old version of Essentials to the latest (2.7.0)


#6

Judging by the index its trying to access there is some kind of rollover occurring but without being able to see source code its hard to know why. I can recreate this consistantly (normally with < 10 moves) but I cant see a pattern to it!! Doesnt seem to matter where the item is dragged from or to…


#7

Update, I can get the app to stop crashing by delaying the unmanaging of the subview from the flow it is being removed from…

                [destinationFlow addManagedSubview:view];
                 dispatch_after(dispatch_time(DISPATCH_TIME_NOW, 0.2 * NSEC_PER_SEC), dispatch_get_main_queue(), ^{
                    [sourceFlow unmanageSubview:view];
                 });