I integrated 'XBChatModule' Library from Cocoapods into my project.
When I run the code for the first time, It crashed the app by throwing following error -[XBMessage messageHash]: unrecognized selector sent to instance and it got resolved by changing XBMessage.m file as below
XBMessage.m
- (NSUInteger)messageHash
{
return self.hash;
}
But this produces new issue saying
Assertion failure in -[ChatMessagesController collectionView:cellForItemAtIndexPath:], /Users/Neelacharya/Harshit/LIve Projects/Project/V1/Source/Project/Pods/JSQMessagesViewController/JSQMessagesViewController/Controllers/JSQMessagesViewController.m:452
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: messageSenderId != nil'
*** First throw call stack:
(
0 CoreFoundation 0x000000011161ca75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x00000001112b1bb7 objc_exception_throw + 45
2 CoreFoundation 0x000000011161c8da +[NSException raise:format:arguments:] + 106
3 Foundation 0x000000010edcfb6f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 CinchGaming 0x000000010d7be3c5 -[JSQMessagesViewController collectionView:cellForItemAtIndexPath:] + 693
5 CinchGaming 0x000000010d7f5f6d -[XBMessageViewController collectionView:cellForItemAtIndexPath:] + 141
6 UIKit 0x00000001102b9fab -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 244
7 UIKit 0x00000001102bb6e4 -[UICollectionView _updateVisibleCellsNow:] + 3445
8 UIKit 0x00000001102bf391 -[UICollectionView layoutSubviews] + 243
9 UIKit 0x000000010fd041c3 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 521
10 QuartzCore 0x000000010f9d2c58 -[CALayer layoutSublayers] + 150
11 QuartzCore 0x000000010f9c787e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
12 QuartzCore 0x000000010f9c76ee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
13 QuartzCore 0x000000010f93536e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
14 QuartzCore 0x000000010f936482 _ZN2CA11Transaction6commitEv + 390
15 QuartzCore 0x000000010f936aed _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
16 CoreFoundation 0x0000000111551507 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
17 CoreFoundation 0x0000000111551460 __CFRunLoopDoObservers + 368
18 CoreFoundation 0x0000000111547293 __CFRunLoopRun + 1123
19 CoreFoundation 0x0000000111546bc6 CFRunLoopRunSpecific + 470
20 GraphicsServices 0x0000000112796a58 GSEventRunModal + 161
21 UIKit 0x000000010fc8a580 UIApplicationMain + 1282
22 CinchGaming 0x000000010d67e463 main + 115
23 libdyld.dylib 0x0000000111b4e145 start + 1
24 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I understand the reason of crash is the member messageSenderId is nil at 452'th line of JSQMessagesViewController.m file. But I don't know why does it occur and how to get it resolved.
I also reported as issue to the authors at Github, but couldn't get response.
I would appreciate if you can help me to solve the problem.
It think the application is crashing on this line:
NSString *messageSenderId = [messageItem senderId];
NSParameterAssert(messageSenderId != nil);
When I dig into that I found that the senderIdis being set from XBMessageViewController's loadDataToTable method. The only reason I can find the value for senderId is nil is you aren't setting the values for jidStr and senderId.
You will require to set jidStr and senderId and XBMessageViewController, where jidStr is receiver and senderId is self user.
Hope this helps.
You need to register your class like [self.collectionView registerClass:[UICollectionViewCell class] forCellWithReuseIdentifier:#"Cell"];
Related
After iOS update version 10.3.3, a bug appeared in some devices, not all. that is..
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSLayoutConstraint constant is not finite! That's illegal. constant:inf firstAnchor:<NSLayoutXAxisAnchor:0x608000679c80 "_UINavigationBarContentView:0x7fce8d57aee0.right"> secondAnchor:<NSLayoutXAxisAnchor:0x608000679d00 "UILayoutGuide:0x6080001be680'UIViewLayoutMarginsGuide'.right">'
*** First throw call stack:
(
0 CoreFoundation 0x0000000110e3126b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x0000000114a67f41 objc_exception_throw + 48
2 CoreFoundation 0x0000000110e36402 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000111a5b749 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 Foundation 0x00000001119df92c -[NSLayoutConstraint _setSymbolicConstant:constant:] + 629
5 Foundation 0x00000001119df689 -[NSLayoutConstraint setConstant:] + 68
6 UIKit 0x0000000112a6dc52 -[UIView _updateLayoutMarginsGuideConstraintsIfNecessary] + 358
7 UIKit 0x0000000112a6de5e -[UIView _layoutMarginsDidChangeFromOldMargins:] + 194
8 UIKit 0x0000000112a6e849 -[UIView _updateInferredLayoutMarginsFromSuperview:] + 850
9 UIKit 0x0000000112a6fc03 -[UIView setSafeAreaInsets:] + 446
10 UIKit 0x0000000112a6f2a5 -[UIView _updateSafeAreaInsets] + 125
11 UIKit 0x0000000112a9c30e -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 1571
12 UIKit 0x0000000112adc343 -[UINavigationBar layoutSublayersOfLayer:] + 178
13 QuartzCore 0x000000011264cc92 -[CALayer layoutSublayers] + 153
14 QuartzCore 0x0000000112650d79 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 401
15 QuartzCore 0x00000001125d9851 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 385
16 QuartzCore 0x00000001126051c2 _ZN2CA11Transaction6commitEv + 500
17 QuartzCore 0x0000000112605f14 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 76
18 CoreFoundation 0x0000000110dd3e57 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
19 CoreFoundation 0x0000000110dd3dae __CFRunLoopDoObservers + 430
20 CoreFoundation 0x0000000110db83c4 __CFRunLoopRun + 1572
21 CoreFoundation 0x0000000110db7b29 CFRunLoopRunSpecific + 409
22 GraphicsServices 0x000000011a8dd9c6 GSEventRunModal + 62
23 UIKit 0x00000001129ce9a4 UIApplicationMain + 159
24 APP NAME 0x000000010f8c1847 main + 55
25 libdyld.dylib 0x0000000117f8d621 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Funny thing is that this error doesn't make any sense to all the equipment. There was no error in my device (iOS 10.3.3)
so I tried running this app in Xcode 9 beta 5, iOS 11 beta 5 to get some error and appeared this assertion failure. I think There is a doubt about navigationBarItem.
Please help.
In my case I was getting an "infinite" origin for a valid UITextRange when trying to get UITextField.firstRect(). That was causing the constraint update to fail.
I would recommend to get Xcode 9 and debug your code there.
I have a Swift project and am trying to use JSQMessagesViewController within it. I have used cocoapods to install the framework and am importing it using a swift import statement.
import JSQMessagesViewController
Up to this point there are no errors and everything compiles without warning. However when I try to push a new instance onto a navigation controller the app crashes.
func openConversation(userId: Int) {
let messageViewController = JSQMessagesViewController();
self.navigationController?.pushViewController(messageViewController, animated: true)
}
The second line of the method causes the crash and the error message is.
2015-08-03 21:44:17.229 [4856:64097] *** Assertion failure in -[JSQMessagesViewController viewWillAppear:], /[my file path]/Pods/JSQMessagesViewController/JSQMessagesViewController/Controllers/JSQMessagesViewController.m:223
2015-08-03 21:44:17.232 [4856:64097] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid parameter not satisfying: self.senderId != nil'
*** First throw call stack:
(
0 CoreFoundation 0x00000001067e3c65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108590bb7 objc_exception_throw + 45
2 CoreFoundation 0x00000001067e3aca +[NSException raise:format:arguments:] + 106
3 Foundation 0x0000000106ec298f -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 JSQMessagesViewController 0x00000001060e9055 -[JSQMessagesViewController viewWillAppear:] + 277
5 UIKit 0x00000001073f8f61 -[UIViewController _setViewAppearState:isAnimating:] + 487
6 UIKit 0x000000010741a355 -[UINavigationController _startCustomTransition:] + 887
7 UIKit 0x000000010742637f -[UINavigationController _startDeferredTransitionIfNeeded:] + 386
8 UIKit 0x0000000107426ece -[UINavigationController __viewWillLayoutSubviews] + 43
9 UIKit 0x00000001075716d5 -[UILayoutContainerView layoutSubviews] + 202
10 UIKit 0x00000001073449eb -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 536
11 QuartzCore 0x0000000108f5ded2 -[CALayer layoutSublayers] + 146
12 QuartzCore 0x0000000108f526e6 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
13 QuartzCore 0x0000000108f52556 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
14 QuartzCore 0x0000000108ebe86e _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 242
15 QuartzCore 0x0000000108ebfa22 _ZN2CA11Transaction6commitEv + 462
16 QuartzCore 0x0000000108ec00d3 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 89
17 CoreFoundation 0x0000000106716ca7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
18 CoreFoundation 0x0000000106716c00 __CFRunLoopDoObservers + 368
19 CoreFoundation 0x000000010670ca33 __CFRunLoopRun + 1123
20 CoreFoundation 0x000000010670c366 CFRunLoopRunSpecific + 470
21 GraphicsServices 0x000000010b148a3e GSEventRunModal + 161
22 UIKit 0x00000001072c48c0 UIApplicationMain + 1282
23 Startana 0x0000000105fa2807 main + 135
24 libdyld.dylib 0x0000000109306145 start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
After searching online I cant seem to find any information about what causes this issue.
I’m glad to hear it solved your issue!
The JSQMessagesViewController have two asset parameters, the senderId and the senderDisplayName.
So you must set your senderId and display name.
In your current controller which is inherited by JSQMessagesViewController
you will need to do couple of things first add setup function
func setup() {
self.senderId = "1234"
self.senderDisplayName = "TEST"
}
and latter invoke that function from
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
self.setup()
}
My app is crashing when it come to following code that is present below:
[cell.imgViewItem setImageWithURL:imageURL placeholderImage:nil completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, NSURL *imageURL) {
NSLog(#"Finished");
} usingActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
Below is the log trace:
2014-09-23 14:11:05.353 SmartSwipe[2834:60b] -[UIImageView sd_cancelImageLoadOperationWithKey:]: unrecognized selector sent to instance 0x79c56ce0
2014-09-23 14:11:05.502 SmartSwipe[2834:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView sd_cancelImageLoadOperationWithKey:]: unrecognized selector sent to instance 0x79c56ce0'
*** First throw call stack:
(
0 CoreFoundation 0x034031e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x031808e5 objc_exception_throw + 44
2 CoreFoundation 0x034a0243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x033f350b ___forwarding___ + 1019
4 CoreFoundation 0x033f30ee _CF_forwarding_prep_0 + 14
5 SmartSwipe 0x0011c1a8 -[UIImageView(WebCache) sd_cancelCurrentImageLoad] + 56
6 SmartSwipe 0x00119744 -[UIImageView(WebCache) sd_setImageWithURL:placeholderImage:options:progress:completed:] + 276
7 SmartSwipe 0x0009cc18 -[UIImageView(UIActivityIndicatorForSDWebImage) setImageWithURL:placeholderImage:options:progress:completed:usingActivityIndicatorStyle:] + 504
8 SmartSwipe 0x0009c875 -[UIImageView(UIActivityIndicatorForSDWebImage) setImageWithURL:placeholderImage:completed:usingActivityIndicatorStyle:] + 229
9 SmartSwipe 0x0003f994 -[QuickScanViewController collectionView:cellForItemAtIndexPath:] + 948
10 UIKit 0x02395b30 -[UICollectionView _createPreparedCellForItemAtIndexPath:withLayoutAttributes:applyAttributes:] + 257
11 UIKit 0x02397775 -[UICollectionView _updateVisibleCellsNow:] + 4730
12 UIKit 0x0239b65f -[UICollectionView layoutSubviews] + 265
13 UIKit 0x01dbe964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
14 libobjc.A.dylib 0x0319282b -[NSObject performSelector:withObject:] + 70
15 QuartzCore 0x007a745a -[CALayer layoutSublayers] + 148
16 QuartzCore 0x0079b244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
17 QuartzCore 0x0079b0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
18 QuartzCore 0x007017fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
19 QuartzCore 0x00702b85 _ZN2CA11Transaction6commitEv + 393
20 QuartzCore 0x00703258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
21 CoreFoundation 0x033cb36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
22 CoreFoundation 0x033cb2bf __CFRunLoopDoObservers + 399
23 CoreFoundation 0x033a9254 __CFRunLoopRun + 1076
24 CoreFoundation 0x033a89d3 CFRunLoopRunSpecific + 467
25 CoreFoundation 0x033a87eb CFRunLoopRunInMode + 123
26 GraphicsServices 0x03f345ee GSEventRunModal + 192
27 GraphicsServices 0x03f3442b GSEventRun + 104
28 UIKit 0x01d4ff9b UIApplicationMain + 1225
29 SmartSwipe 0x001105bd main + 141
30 libdyld.dylib 0x04ec5701 start + 1
31 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Please help me, I am struggling with it. Thanks in advance.
You have written a method sd_setImageWithURL which gets called, and that method calls sd_cancelCurrentImageLoad for an UIImageView* that doesn't support the call. Check you source code where you implement sd_cancelCurrentImageLoad and what it does.
Please add SDWebImage framework in you project.
You can do so by using cocoapods, use 'pod "SDWebImage"' in the pod file.
The application I work on is displaying a CollectionView in form of a calendar.
To simplify that we used the MSCollectionViewCalendarLayout from github.
Now it comes with multiple additional decoration views like a red line, which represents the current time in the calendar.
In our implementation there is also the possibility of filtering for different types, so the calendar not always displays the same kind/amount of cells. Unfortunately sometimes the application crashes just out of nowhere, when it should display the red timeline:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'request for layout attributes for decoration view of kind MSCollectionElementKindCurrentTimeHorizontalGridline in section 0 when there are only 0 sections in the collection view'
*** First throw call stack:
(
0 CoreFoundation 0x034761e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02fcb8e5 objc_exception_throw + 44
2 CoreFoundation 0x03476048 +[NSException raise:format:arguments:] + 136
3 Foundation 0x00e2f4de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 116
4 UIKit 0x018eb290 -[UICollectionViewData layoutAttributesForDecorationViewOfKind:atIndexPath:] + 228
5 UIKit 0x018b5764 -[UICollectionView _dequeueReusableViewOfKind:withIdentifier:forIndexPath:viewCategory:] + 242
6 UIKit 0x018a8036 -[UICollectionView _createPreparedSupplementaryViewForElementOfKind:atIndexPath:withLayoutAttributes:applyAttributes:] + 381
7 UIKit 0x018a9775 -[UICollectionView _updateVisibleCellsNow:] + 4730
8 UIKit 0x018ad65f -[UICollectionView layoutSubviews] + 265
9 UIKit 0x012d0964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
10 libobjc.A.dylib 0x02fdd82b -[NSObject performSelector:withObject:] + 70
11 QuartzCore 0x026a445a -[CALayer layoutSublayers] + 148
12 QuartzCore 0x02698244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
13 QuartzCore 0x026980b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
14 QuartzCore 0x025fe7fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
15 QuartzCore 0x025ffb85 _ZN2CA11Transaction6commitEv + 393
16 QuartzCore 0x02600258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
17 CoreFoundation 0x0343e36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
18 CoreFoundation 0x0343e2bf __CFRunLoopDoObservers + 399
19 CoreFoundation 0x0341c254 __CFRunLoopRun + 1076
20 CoreFoundation 0x0341b9d3 CFRunLoopRunSpecific + 467
21 CoreFoundation 0x0341b7eb CFRunLoopRunInMode + 123
22 GraphicsServices 0x049615ee GSEventRunModal + 192
23 GraphicsServices 0x0496142b GSEventRun + 104
24 UIKit 0x01261f9b UIApplicationMain + 1225
25 CariAudit 0x001036ad main + 141
26 libdyld.dylib 0x039d9701 start + 1
27 ??? 0x00000003 0x0 + 3
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Now I know that with this custom layout, many people get this error message when they change the underlying data of the collectionView and the solution to this is to call "invalidateLayoutCache" on the layout. The only problem is that I already have that in my code and it gets called before calling reloadData on the collectionView.
Does anyone maybe have an idea/approach for solving this kind of problem?
Thanks
After hours of searching I finally managed to find the error.
The problem was that the MSCollectionViewCalendarLayout missed to empty the Attributes-Dictionaries
currentTimeIndicatorAttributes and currentTimeHorizontalGridlineAttributes.
To fix the error all I had to do was to expand the invalidateLayoutCache method with the following:
[self.currentTimeIndicatorAttributes removeAllObjects];
[self.currentTimeHorizontalGridlineAttributes removeAllObjects];
Hey can anyone help me out that what type of exception is this i had earlier a code and link is as: Application run on simulator but not on device in iphone
can anybody here who can tell that what type of exception is in it? is there any memory leak?
here is the log below:
2013-12-27 17:53:26.814 Skirr[1346:a0b] Application windows are expected to have a root view controller at the end of application launch
2013-12-27 17:53:27.995 Skirr[1346:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x032745e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x021b88b6 objc_exception_throw + 44
2 CoreFoundation 0x03228316 -[__NSPlaceholderArray initWithObjects:count:] + 390
3 CoreFoundation 0x0324bce9 +[NSArray arrayWithObject:] + 73
4 Skirr 0x000093bd -[SlideViewController viewDidLoad] + 1597
5 UIKit 0x00e2d318 -[UIViewController loadViewIfRequired] + 696
6 UIKit 0x00e2d5b4 -[UIViewController view] + 35
7 UIKit 0x00e473e2 -[UINavigationController _startCustomTransition:] + 778
8 UIKit 0x00e540c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
9 UIKit 0x00e54cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
10 UIKit 0x00f8e181 -[UILayoutContainerView layoutSubviews] + 213
11 UIKit 0x00d84267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
12 libobjc.A.dylib 0x021ca81f -[NSObject performSelector:withObject:] + 70
13 QuartzCore 0x005622ea -[CALayer layoutSublayers] + 148
14 QuartzCore 0x005560d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
15 QuartzCore 0x00555f40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
16 QuartzCore 0x004bdae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
17 QuartzCore 0x004bee71 _ZN2CA11Transaction6commitEv + 393
18 QuartzCore 0x004bf544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
19 CoreFoundation 0x0323c4ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
20 CoreFoundation 0x0323c41f __CFRunLoopDoObservers + 399
21 CoreFoundation 0x0321a344 __CFRunLoopRun + 1076
22 CoreFoundation 0x03219ac3 CFRunLoopRunSpecific + 467
23 CoreFoundation 0x032198db CFRunLoopRunInMode + 123
24 GraphicsServices 0x034ce9e2 GSEventRunModal + 192
25 GraphicsServices 0x034ce809 GSEventRun + 104
26 UIKit 0x00d19d3b UIApplicationMain + 1225
27 Skirr 0x000055a2 main + 130
28 libdyld.dylib 0x06896725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
have look at this link from
attempt to insert nil object from objects[0]
you are inserting or handling nil object you can get that line refer given above link
The error
* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[0]'
is occurring because you are trying to add nil value to an NSArray. After looking through your code on the other question the specific line of code that it is crashing on is
[_slideNavigationController setViewControllers:[NSArray arrayWithObject:initalViewController] animated:NO];
It is crashing here because of one of two things
1) initalViewController is nil so when you add it using arrayWithObject it crashes.
or
2) setViewControllers:[NSArray arrayWithObject:initalViewController] is causing the error because [NSArray arrayWithObject:initalViewController] is setting nil to the method setViewControllers: method which takes an NSArray.
I would say it is option (1) that is causing your issue though as the crash happens when arrayWithObject is called.
Check your main.m. The last argument should be set to the name of the class that implements the UIApplicationDelegate protocol OR you can try for last argument like NSStringFromClass([AppDelegate class]).
Please check this link it might help you .
click here