kas-kad / AKTagsInputView

convenient input view for tags strings
Apache License 2.0
85 stars 20 forks source link

iOS 8 Crash - exception 'NSInternalInconsistencyException' #11

Closed akhatmullin closed 9 years ago

akhatmullin commented 9 years ago

Logs: AKTagsInputViewExample[49510:1619253] * Assertion failure in -[UICollectionView _endItemAnimations], /SourceCache/UIKit_Sim/UIKit-3318.16.14/UICollectionView.m:3917 AKTagsInputViewExample[49510:1619253] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of items in section 0. The number of items contained in an existing section after the update (0) must be equal to the number of items contained in that section before the update (7), plus or minus the number of items inserted or deleted from that section (0 inserted, 0 deleted) and plus or minus the number of items moved into or out of that section (0 moved in, 0 moved out).' *\ First throw call stack: ( 0 CoreFoundation 0x01c67946 exceptionPreprocess + 182 1 libobjc.A.dylib 0x018f0a97 objc_exception_throw + 44 2 CoreFoundation 0x01c677da +[NSException raise:format:arguments:] + 138 3 Foundation 0x01564810 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 118 4 UIKit 0x009f5638 -[UICollectionView _endItemAnimations] + 14381 5 UIKit 0x009fb5c8 -[UICollectionView _endUpdates] + 44 6 UIKit 0x009fb77a -[UICollectionView performBatchUpdates:completion:] + 429 7 AKTagsInputViewExample 0x00012a24 -[AKTagsLookup filterLookupWithPredicate:] + 276 8 AKTagsInputViewExample 0x0000d0c5 -[AKTagsInputView textField:shouldChangeCharactersInRange:replacementString:] + 1301 9 UIKit 0x00b195bf -[UITextField keyboardInput:shouldInsertText:isMarkedText:] + 273 10 UIKit 0x00504489 -[UIKeyboardImpl callShouldInsertText:] + 269 11 UIKit 0x0050f818 -[UIKeyboardImpl addInputEvent:executionContext:] + 1010 12 UIKit 0x0050f37c 60-[UIKeyboardImpl addInputString:withFlags:executionContext:]_block_invoke + 53 13 UIKit 0x00b41b08 -[UIKeyboardTaskExecutionContext returnExecutionToParentWithInfo:] + 289 14 UIKit 0x00b419e2 -[UIKeyboardTaskExecutionContext returnExecutionToParent] + 41 15 UIKit 0x0051421b -[UIKeyboardImpl acceptCurrentCandidateIfSelectedWithExecutionContext:] + 250 16 UIKit 0x0050f33f -[UIKeyboardImpl addInputString:withFlags:executionContext:] + 537 17 UIKit 0x0050e184 -[UIKeyboardImpl handleStringInput:withFlags:executionContext:] + 251 18 UIKit 0x0051f2c2 -[UIKeyboardImpl handleKeyWithString:forKeyEvent:executionContext:] + 652 19 UIKit 0x0051e7cb -[UIKeyboardImpl handleKeyEvent:executionContext:] + 181 20 UIKit 0x0051e67f 33-[UIKeyboardImpl handleKeyEvent:]_block_invoke + 51 21 UIKit 0x0051e484 -[UIKeyboardImpl _handleKeyEvent:executionContext:] + 243 22 UIKit 0x006e84f2 -[UIKeyboardLayoutStar completeRetestForTouchUp:timestamp:interval:executionContext:] + 4415 23 UIKit 0x006e689d -[UIKeyboardLayoutStar touchUp:executionContext:] + 174 24 UIKit 0x0052d4c5 __28-[UIKeyboardLayout touchUp:]_block_invoke + 283 25 UIKit 0x00b420a2 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 404 26 UIKit 0x00b4275f -[UIKeyboardTaskQueue addTask:] + 144 27 UIKit 0x0052d3a2 -[UIKeyboardLayout touchUp:] + 294 28 UIKit 0x0052e0ae -[UIKeyboardLayout touchesEnded:withEvent:] + 539 29 UIKit 0x0031960a -[UIWindow _sendTouchesForEvent:] + 874 30 UIKit 0x0031a0e5 -[UIWindow sendEvent:] + 791 31 UIKit 0x002df549 -[UIApplication sendEvent:] + 242 32 UIKit 0x002ef37e _UIApplicationHandleEventFromQueueEvent + 20690 33 UIKit 0x002c3b19 _UIApplicationHandleEventQueue + 2206 34 CoreFoundation 0x01b8b1df CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 15 35 CoreFoundation 0x01b80ced CFRunLoopDoSources0 + 253 36 CoreFoundation 0x01b80248 __CFRunLoopRun + 952 37 CoreFoundation 0x01b7fbcb CFRunLoopRunSpecific + 443 38 CoreFoundation 0x01b7f9fb CFRunLoopRunInMode + 123 39 GraphicsServices 0x040bc24f GSEventRunModal + 192 40 GraphicsServices 0x040bc08c GSEventRun + 104 41 UIKit 0x002c78b6 UIApplicationMain + 1526 42 AKTagsInputViewExample 0x00011e0d main + 141 43 libdyld.dylib 0x0223bac9 start + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException

akhatmullin commented 9 years ago

This error you may repeat and seen if you select one of lookup tags. I found this error on iPad with iOS 8.

roberthchapman commented 9 years ago

Getting the same error on iOS 8. Any progress on resolving?

kas-kad commented 9 years ago

Looks like I've missed the contributor's mistake. At this moment a stable version is here: 75d010e661dbe646e97b5c68101b35538445563b (tagged as 1.0.1) You can use it. Note the issues list though.

roberthchapman commented 9 years ago

Hi Andrey,

Thanks for that link, I downloaded it and ran the demo but the demo has the same crashing issue. It's slightly different in that the lookup tags don't appear immediately but selecting one will still crash it with the error "request for index path for global index when there are only two items in the collection view". I'm using ios8 if that makes any difference. Any ideas what to try to get this working? Happy to try to solve it but might need some guidance.

Thanks, Robert

Sent from my iPhone

On 21 Feb 2015, at 20:04, Andrey K. notifications@github.com wrote:

I've found the last working commit: abe41c2 . Use it.

— Reply to this email directly or view it on GitHub.

kas-kad commented 9 years ago

I approve the crash is still exists. I'd happy to give some advices but it is much time passed since I wrote this code. I'm gonna fix the crash today.

kas-kad commented 9 years ago

Robert, you can try v1.0.0. It is much stable. It is definitely not an iOS7 bug though.

kas-kad commented 9 years ago

I decided to roolback all changes made after 1.0.0 since there were crucial mistakes made by one of contributor. I have no time to research all the changes made especially that contributor had no respect to original code style making alot of code formatting changes.

kas-kad commented 9 years ago

So now in ver.1.0.0 there is no support of storyboards. But less bugs for sure.

roberthchapman commented 9 years ago

Thanks Andrey, have had a look and yes it's much better. And, worth saying, far better than other tag controls. Can use fine without storyboard support. Will implement now and rate too. However I did spot one bug just now which isn't major but worth pointing out - will create a new issue. Thanks

akhatmullin commented 9 years ago

Oh! Thank you! Thank you very much! I was away on business and could not participate in the discussion and this weekend.