Tableview / ScrollView within the UIPageController cause crash while navigating to next Page - ios

I have a UIPageViewController which holds two screens.
self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
And one of the screen contains tableview on iphone /Collection view on ipad.On some user event we are setting the contentOfset to move the tableview a bit up
[table setContentOffset:cell.frame.origin animated:YES];
Then user navigates to next screen using UIPageviewcontroller
Above usecase causes crash on the app with the following logs
2014-11-14 09:04:46.783 tibbr[12329:79833] *** Assertion failure in -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/_UIQueuingScrollView.m:338
2014-11-14 09:04:46.786 tibbr[12329:79833] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected subviews'
*** First throw call stack:
(
0 CoreFoundation 0x0000000113512f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111be7bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000113512d9a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00000001115c15df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x00000001108715e0 -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:] + 215
5 UIKit 0x0000000110871b0a -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:] + 672
6 UIKit 0x0000000110873e57 -[_UIQueuingScrollView setView:direction:animated:completion:] + 524
7 UIKit 0x00000001107d5e16 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 483
8 UIKit 0x00000001107d5f78 -[UIPageViewController setViewControllers:direction:animated:completion:] + 157
12 UIKit 0x000000011024e8be -[UIApplication sendAction:to:from:forEvent:] + 75
13 UIKit 0x0000000110355410 -[UIControl _sendActionsForEvents:withEvent:] + 467
14 UIKit 0x00000001103cf9ea -[UISegmentedControl _setSelectedSegmentIndex:notify:animate:] + 570
15 UIKit 0x00000001103d1a0f -[UISegmentedControl touchesEnded:withEvent:] + 143
16 UIKit 0x00000001105fb540 _UIGestureRecognizerUpdate + 9487
17 UIKit 0x0000000110293ff6 -[UIWindow _sendGesturesForEvent:] + 1041
18 UIKit 0x0000000110294c23 -[UIWindow sendEvent:] + 667
19 UIKit 0x00000001102619b1 -[UIApplication sendEvent:] + 246
20 UIKit 0x000000011026ea7d _UIApplicationHandleEventFromQueueEvent + 17370
21 UIKit 0x000000011024a103 _UIApplicationHandleEventQueue + 1961
22 CoreFoundation 0x0000000113448551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
23 CoreFoundation 0x000000011343e41d __CFRunLoopDoSources0 + 269
24 CoreFoundation 0x000000011343da54 __CFRunLoopRun + 868
25 CoreFoundation 0x000000011343d486 CFRunLoopRunSpecific + 470
26 GraphicsServices 0x0000000113e859f0 GSEventRunModal + 161
27 UIKit 0x000000011024d420 UIApplicationMain + 1282
28 tibbr 0x000000010cb942d1 tibbr + 58065
29 libdyld.dylib 0x0000000112660145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Kindly do suggest me what could be root cause of this issue

Related

Webview.Scrollview - Unable to add more than 126 Objects

My Application is getting crashed while scrolling UIWebview - I have used ILPDFKit for implementing interactive PDF - Editable Forms.App is getting crashed only if i am adding more than 126 Objects.
Here is code I am using (from ILPDFKit)
for (PDFWidgetAnnotationView *element in widgetAnnotationViews)
{
element.alpha = 0;
element.parentView = self;
[_pdfView.scrollView addSubview:element];
[_pdfView.scrollView bringSubviewToFront:element];
if ([element isKindOfClass:[PDFFormButtonField class]])
{
[(PDFFormButtonField*)element setButtonSuperview];
}
}
I have also raise Issue here
I have added some customview's in my webview.scrollview , so while scrolling webview my App is getting crashed. i have checked for all possible solutions i found on google/stackoverflow.
none of the delegate method of scrollview / webview called before this crash , as soon as i tried to scroll and app is getting crashed.
below is crash report.
*** Terminating app due to uncaught exception 'NSGenericException', reason: '*** Collection <__NSArrayM: 0x6000024535f0> was mutated while being enumerated.'
*** First throw call stack:
(
0 CoreFoundation 0x00000001045dd34b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000103f5f21e objc_exception_throw + 48
2 CoreFoundation 0x0000000104645f1c __NSFastEnumerationMutationHandler + 124
3 CoreFoundation 0x0000000104582638 -[NSArray makeObjectsPerformSelector:] + 424
4 UIKit 0x00000001020d8f4f -[UIScrollView(UIScrollViewInternal) _notifyDidScroll] + 163
5 UIKit 0x00000001020c3919 -[UIScrollView setContentOffset:] + 478
6 UIKit 0x00000001020c8351 -[UIScrollView _updatePanGesture] + 2346
7 UIKit 0x0000000102531289 -[UIGestureRecognizerTarget _sendActionWithGestureRecognizer:] + 57
8 UIKit 0x0000000102539028 _UIGestureRecognizerSendTargetActions + 109
9 UIKit 0x0000000102536af7 _UIGestureRecognizerSendActions + 227
10 UIKit 0x0000000102535d83 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 891
11 UIKit 0x0000000102521e56 _UIGestureEnvironmentUpdate + 1395
12 UIKit 0x000000010252189b -[UIGestureEnvironment _deliverEvent:toGestureRecognizers:usingBlock:] + 521
13 UIKit 0x0000000102520a7e -[UIGestureEnvironment _updateGesturesForEvent:window:] + 286
14 UIKit 0x000000010205f7ad -[UIWindow sendEvent:] + 3989
15 UIKit 0x000000010200ca33 -[UIApplication sendEvent:] + 371
16 UIKit 0x00000001027feb6d __dispatchPreprocessedEventFromEventQueue + 3248
17 UIKit 0x00000001027f7817 __handleEventQueue + 4879
18 CoreFoundation 0x0000000104582311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
19 CoreFoundation 0x000000010456759c __CFRunLoopDoSources0 + 556
20 CoreFoundation 0x0000000104566a86 __CFRunLoopRun + 918
21 CoreFoundation 0x0000000104566494 CFRunLoopRunSpecific + 420
22 GraphicsServices 0x0000000107910a6f GSEventRunModal + 161
23 UIKit 0x0000000101feef34 UIApplicationMain + 159
24 HyundaiCapital 0x000000010132a67f main + 111
25 libdyld.dylib 0x000000010610268d start + 1
26 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Edit
1.How many subviews at most i can add into delegate of scrollview at a time?
2.I am only getting this crash if i am adding subviews more than 126?
Solution
Updating ILPDFKit worked for me.

ibc++abi.dylib: terminating with uncaught exception of type NSException (lldb)

when i run my app, i received this error :
2014-11-10 06:14:05.581 Yoga[4032:110484] user is registered
2014-11-10 06:14:30.552 Yoga[4032:110484] * Terminating app due to uncaught exception 'NSGenericException', reason: 'Push segues can only be used when the source controller is managed by an instance of UINavigationController.'
* First throw call stack:
(
0 CoreFoundation 0x000000010c999f35 exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c632bb7 objc_exception_throw + 45
2 UIKit 0x000000010b43e16a -[UIStoryboardPushSegue destinationContainmentContext] + 0
3 UIKit 0x000000010aedc8be -[UIApplication sendAction:to:from:forEvent:] + 75
4 UIKit 0x000000010afe3410 -[UIControl _sendActionsForEvents:withEvent:] + 467
5 UIKit 0x000000010afe27df -[UIControl touchesEnded:withEvent:] + 522
6 UIKit 0x000000010af22308 -[UIWindow _sendTouchesForEvent:] + 735
7 UIKit 0x000000010af22c33 -[UIWindow sendEvent:] + 683
8 UIKit 0x000000010aeef9b1 -[UIApplication sendEvent:] + 246
9 UIKit 0x000000010aefca7d _UIApplicationHandleEventFromQueueEvent + 17370
10 UIKit 0x000000010aed8103 _UIApplicationHandleEventQueue + 1961
11 CoreFoundation 0x000000010c8cf551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
12 CoreFoundation 0x000000010c8c541d __CFRunLoopDoSources0 + 269
13 CoreFoundation 0x000000010c8c4a54 __CFRunLoopRun + 868
14 CoreFoundation 0x000000010c8c4486 CFRunLoopRunSpecific + 470
15 GraphicsServices 0x000000010d3329f0 GSEventRunModal + 161
16 UIKit 0x000000010aedb420 UIApplicationMain + 1282
17 Yoga 0x000000010a840b53 main + 115
18 libdyld.dylib 0x000000010f69b145 start + 1
19 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
somebody can help me pls
add Navigation Controller to your initial view
Select the initial view
Go To Editor--> Embed In --> Navigation Controller.

Present UIViewController from subclass of UIView

I have created a subclass of UIView, Now in my app i need to present a UIViewController from it,
I have tried following :
poiInfoController = [[poiInfoController alloc]initWithNibName:#"poiInfoController" bundle:nil];
[poiInfoController setModalPresentationStyle:UIModalPresentationFormSheet];
[[[[UIApplication sharedApplication] keyWindow] rootViewController] presentModalViewController:poiInfoController animated:YES];
but it will crash with Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller .'
Please Help,
**EDIT CRASH LOG:**
2014-04-23 17:04:26.433 NavigationLibSprintMoM[4610:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Application tried to present modally an active controller <ViewController: 0x9d52140>.'
*** First throw call stack:
(
0 CoreFoundation 0x017c15e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014d08b6 objc_exception_throw + 44
2 UIKit 0x0036217a -[UIViewController presentViewController:withTransition:completion:] + 4879
3 UIKit 0x00362caf -[UIViewController presentViewController:animated:completion:] + 130
4 NavigationLibSprintMoM 0x00005f7b -[NavigationView handleGesture:] + 964
5 UIKit 0x005baf8c _UIGestureRecognizerSendActions + 230
6 UIKit 0x005b9c00 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
7 UIKit 0x005bb66d -[UIGestureRecognizer _delayedUpdateGesture] + 60
8 UIKit 0x005bebcd ___UIGestureRecognizerUpdate_block_invoke + 57
9 UIKit 0x005beb4e _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
10 UIKit 0x005b5248 _UIGestureRecognizerUpdate + 199
11 UIKit 0x00281d4a -[UIWindow _sendGesturesForEvent:] + 1291
12 UIKit 0x00282c6a -[UIWindow sendEvent:] + 1030
13 UIKit 0x00256a36 -[UIApplication sendEvent:] + 242
14 UIKit 0x00240d9f _UIApplicationHandleEventQueue + 11421
15 CoreFoundation 0x0174a8af __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
16 CoreFoundation 0x0174a23b __CFRunLoopDoSources0 + 235
17 CoreFoundation 0x0176730e __CFRunLoopRun + 910
18 CoreFoundation 0x01766b33 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x0176694b CFRunLoopRunInMode + 123
20 GraphicsServices 0x038699d7 GSEventRunModal + 192
21 GraphicsServices 0x038697fe GSEventRun + 104
22 UIKit 0x0024394b UIApplicationMain + 1225
23 NavigationLibSprintMoM 0x0000374d main + 141
24 libdyld.dylib 0x01f54725 start + 0
25 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

App crashing on load terminating with uncaught exception of type NSException

I have been playing around with a project of mine tonight and now I can't get it to load up. Strange thing is I have got an older version of this and have even tried to copy all data across and still not loading.
Error I am getting in NSLog is as follows:
2014-04-01 01:24:53.513 Adult Game[47180:a0b] CUICatalog: Invalid asset name supplied: , or invalid scale factor: 2.000000
2014-04-01 01:24:53.515 Adult Game[47180:a0b] Could not load the "" image referenced from a nib in the bundle with identifier "DannyLinton.Adult-Game"
2014-04-01 01:24:53.519 Adult Game[47180:a0b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8e35860> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key animate.'
*** First throw call stack:
(
0 CoreFoundation 0x0196f5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x016f28b6 objc_exception_throw + 44
2 CoreFoundation 0x019ff6a1 -[NSException raise] + 17
3 Foundation 0x013b39ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x0131fcfb _NSSetUsingKeyValueSetter + 88
5 Foundation 0x0131f253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x0138170a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x00702a15 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x017047d2 -[NSObject performSelector:] + 62
9 CoreFoundation 0x0196ab6a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x0070156e -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x00573605 -[UIViewController _loadViewFromNibNamed:bundle:] + 280
12 UIKit 0x00573dad -[UIViewController loadView] + 302
13 UIKit 0x005740ae -[UIViewController loadViewIfRequired] + 78
14 UIKit 0x005745b4 -[UIViewController view] + 35
15 UIKit 0x0049c9fd -[UIWindow addRootViewControllerViewIfPossible] + 66
16 UIKit 0x0049cd97 -[UIWindow _setHidden:forced:] + 312
17 UIKit 0x0049d02d -[UIWindow _orderFrontWithoutMakingKey] + 49
18 UIKit 0x004a789a -[UIWindow makeKeyAndVisible] + 65
19 UIKit 0x0045acd0 -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1851
20 UIKit 0x0045f3a8 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 824
21 UIKit 0x0047387c -[UIApplication handleEvent:withNewEvent:] + 3447
22 UIKit 0x00473de9 -[UIApplication sendEvent:] + 85
23 UIKit 0x00461025 _UIApplicationHandleEvent + 736
24 GraphicsServices 0x031042f6 _PurpleEventCallback + 776
25 GraphicsServices 0x03103e01 PurpleEventCallback + 46
26 CoreFoundation 0x018ead65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
27 CoreFoundation 0x018eaa9b __CFRunLoopDoSource1 + 523
28 CoreFoundation 0x0191577c __CFRunLoopRun + 2156
29 CoreFoundation 0x01914ac3 CFRunLoopRunSpecific + 467
30 CoreFoundation 0x019148db CFRunLoopRunInMode + 123
31 UIKit 0x0045eadd -[UIApplication _run] + 840
32 UIKit 0x00460d3b UIApplicationMain + 1225
33 Adult Game 0x00007dad main + 141
34 libdyld.dylib 0x02df2725 start + 0
35 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Any help would be very much appreciated.
You have a phantom connection in your StoryBoard or XIB file called "animate".
Open your StoryBoard / XIB file
If you are using a StoryBoard, select the AdultGame view controller
Click on the "File's Owner" along the left
Select "View > Utilities > Show Connections Inspector"
You will see a list of "Outlets". One of them will be called "animate" and have an exclamation point next to it. Click on the little "x" to delete it.

ContainerView of TableViewController not working?

I want to display static cells in a ContainerView but every time the app runs it crashes at start. I read somewhere your unable to use static cells in UITableView but said it should work in a Container View to UITableViewController. Thanks for any input.
2014-01-01 15:44:56.294 InterestingGame[24199:a0b] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<ViewController 0x8935970> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key second.'
*** First throw call stack:
(
0 CoreFoundation 0x0173d5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014c08b6 objc_exception_throw + 44
2 CoreFoundation 0x017cd6a1 -[NSException raise] + 17
3 Foundation 0x011819ee -[NSObject(NSKeyValueCoding) setValue:forUndefinedKey:] + 282
4 Foundation 0x010edcfb _NSSetUsingKeyValueSetter + 88
5 Foundation 0x010ed253 -[NSObject(NSKeyValueCoding) setValue:forKey:] + 267
6 Foundation 0x0114f70a -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] + 412
7 UIKit 0x004d0a15 -[UIRuntimeOutletConnection connect] + 106
8 libobjc.A.dylib 0x014d27d2 -[NSObject performSelector:] + 62
9 CoreFoundation 0x01738b6a -[NSArray makeObjectsPerformSelector:] + 314
10 UIKit 0x004cf56e -[UINib instantiateWithOwner:options:] + 1417
11 UIKit 0x00762a2f -[UIStoryboard instantiateViewControllerWithIdentifier:] + 220
12 UIKit 0x00762ba8 -[UIStoryboard instantiateInitialViewController] + 74
13 UIKit 0x0022e44c -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 79
14 UIKit 0x0022e6e9 -[UIApplication _loadMainInterfaceFile] + 245
15 UIKit 0x0022d28f -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 543
16 UIKit 0x0024187c -[UIApplication handleEvent:withNewEvent:] + 3447
17 UIKit 0x00241de9 -[UIApplication sendEvent:] + 85
18 UIKit 0x0022f025 _UIApplicationHandleEvent + 736
19 GraphicsServices 0x036942f6 _PurpleEventCallback + 776
20 GraphicsServices 0x03693e01 PurpleEventCallback + 46
21 CoreFoundation 0x016b8d65 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
22 CoreFoundation 0x016b8a9b __CFRunLoopDoSource1 + 523
23 CoreFoundation 0x016e377c __CFRunLoopRun + 2156
24 CoreFoundation 0x016e2ac3 CFRunLoopRunSpecific + 467
25 CoreFoundation 0x016e28db CFRunLoopRunInMode + 123
26 UIKit 0x0022cadd -[UIApplication _run] + 840
27 UIKit 0x0022ed3b UIApplicationMain + 1225
28 InterestingGame 0x0000473d main + 141
29 libdyld.dylib 0x01d79725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
That exception is pointing to an outlet being hooked up in interface builder that may no longer have an underlying property.
You may have previously had a second property declared in code that was then hooked up in a xib/storyboard. You will then have removed this property or renamed it and not broken the connection in the xib/storyboard. You need to go to the connections panel in interface builder and remove the broken connection

Resources