The UITableView works fine when I am trying to use it through Xcode6.4, but when I'm trying it through Xcode 7.1.1 it crashes. I guess it's because of the iOS versions. I am attaching the crash log. Kindly suggest what the best way to fix it is. I am quite sure that: 1) Datasource and Delegates are working fine. 2) Numberofrows and heightOfRow methods are also getting called, but it crashes before the cellForRowAtIndexPath gets called.
Here is the log:
2016-02-05 15:34:27.400 Autograph24[3720:87023] * Assertion failure in -[UITableViewRowData _assertValidIndexPath:allowEmptySection:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3512.29.5/UITableViewRowData.m:2310 2016-02-05 15:34:27.506 Autograph24[3720:87023] * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid indexPath' *** First throw call stack: ( 0 CoreFoundation 0x00000001075c9f45 exceptionPreprocess + 165 1 libobjc.A.dylib
0x0000000107956deb objc_exception_throw + 48 2 CoreFoundation
0x00000001075c9daa +[NSException raise:format:arguments:] + 106 3
Foundation 0x0000000106e9b5ee -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198 4
UIKit 0x0000000108d11412 -[UITableViewRowData _assertValidIndexPath:allowEmptySection:] + 963 5 UIKit 0x0000000108d11465 -[UITableViewRowData ensureHeightsFaultedInForIndexPath:availHeight:edgeInset:scrollPosition:] + 55 6 UIKit 0x0000000108af50c6 -[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:] + 2510 7 UIKit 0x0000000108af59b9 -[UITableView scrollToRowAtIndexPath:atScrollPosition:animated:] + 39 8 Autograph24 0x0000000106b1b2ad -[DashboardVC scrollToToday] + 685 9 Autograph24 0x0000000106b20289 -[DashboardVC changeCalendarStyle] + 313 10 Autograph24 0x0000000106b20144 -[DashboardVC resizeScreenForPortrait] + 788 11 Autograph24
0x0000000106b1f6a0 -[DashboardVC rotateScreen] + 176 12 Autograph24 0x0000000106b15e76 -[DashboardVC viewDidLoad] + 166 13 UIKit
0x0000000108b49cc4 -[UIViewController loadViewIfRequired] + 1198 14 UIKit 0x0000000108b4fc7b -[UIViewController __viewWillAppear:] + 120 15 UIKit 0x0000000108b7fa37 -[UINavigationController _startCustomTransition:] + 1203 16 UIKit 0x0000000108b8fcdb -[UINavigationController _startDeferredTransitionIfNeeded:] + 712 17 UIKit 0x0000000108b90cea -[UINavigationController __viewWillLayoutSubviews] + 57 18 UIKit 0x0000000108d36c85 -[UILayoutContainerView layoutSubviews] + 248 19 UIKit 0x0000000108a6be40 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 710 20 QuartzCore 0x000000010736359a -[CALayer layoutSublayers] + 146 21 QuartzCore
0x0000000107357e70 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366 22 QuartzCore 0x0000000107357cee _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24 23 QuartzCore 0x000000010734c475 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277 24 QuartzCore 0x0000000107379c0a _ZN2CA11Transaction6commitEv + 486 25 QuartzCore 0x000000010737a37c _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92 26 CoreFoundation 0x00000001074f5947 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION + 23 27 CoreFoundation 0x00000001074f58b7 __CFRunLoopDoObservers + 391 28 CoreFoundation 0x00000001074eb50b __CFRunLoopRun + 1147 29 CoreFoundation
0x00000001074eae08 CFRunLoopRunSpecific + 488 30 GraphicsServices
0x000000010b1b5ad2 GSEventRunModal + 161 31 UIKit
0x00000001089b730d UIApplicationMain + 171 32 Autograph24
0x0000000106b15d9f main + 111 33 libdyld.dylib
0x000000010aac192d start + 1 34 ???
0x0000000000000001 0x0 + 1 ) libc++abi.dylib: terminating with uncaught exception of type NSException