Xcode 5.1 breakpoints not working - ios

Since today my breakpoints stopped working in Xcode 5.1. I have an unrecognized selector sent to an NSArray, but the debugger does not show the line where the error occurs. It always points to main.m
2014-07-10 20:12:33.827 App[2936:60b] -[__NSArrayI length]: unrecognized selector sent to instance 0xb766da0
2014-07-10 20:12:35.489 App[2936:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI length]: unrecognized selector sent to instance 0xb766da0'
*** First throw call stack:
(
0 CoreFoundation 0x035b61e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x018a28e5 objc_exception_throw + 44
2 CoreFoundation 0x03653243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x035a650b ___forwarding___ + 1019
4 CoreFoundation 0x035a60ee _CF_forwarding_prep_0 + 14
5 UIKit 0x00512463 -[UILabel _shadow] + 45
6 UIKit 0x005138c2 -[UILabel drawTextInRect:] + 70
7 UIKit 0x00515dfc -[UILabel drawRect:] + 98
8 UIKit 0x003c4453 -[UIView(CALayerDelegate) drawLayer:inContext:] + 504
9 QuartzCore 0x02a8af39 -[CALayer drawInContext:] + 123
10 QuartzCore 0x02a8ae6a _ZL16backing_callbackP9CGContextPv + 96
11 QuartzCore 0x029794fc CABackingStoreUpdate_ + 2656
12 QuartzCore 0x02a8ae02 ___ZN2CA5Layer8display_Ev_block_invoke + 93
13 QuartzCore 0x02abf2d7 x_blame_allocations + 15
14 QuartzCore 0x02a8ac6d _ZN2CA5Layer8display_Ev + 1519
15 QuartzCore 0x02a8aeb9 -[CALayer _display] + 33
16 QuartzCore 0x02a8a676 _ZN2CA5Layer7displayEv + 144
17 QuartzCore 0x02a8ae93 -[CALayer display] + 33
18 QuartzCore 0x02a7f043 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 323
19 QuartzCore 0x02a7f0bc _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 38
20 QuartzCore 0x029e57fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
21 QuartzCore 0x029e6b85 _ZN2CA11Transaction6commitEv + 393
22 QuartzCore 0x029e7258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
23 CoreFoundation 0x0357e36e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x0357e2bf __CFRunLoopDoObservers + 399
25 CoreFoundation 0x0355c254 __CFRunLoopRun + 1076
26 CoreFoundation 0x0355b9d3 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x0355b7eb CFRunLoopRunInMode + 123
28 GraphicsServices 0x038135ee GSEventRunModal + 192
29 GraphicsServices 0x0381342b GSEventRun + 104
30 UIKit 0x00355f9b UIApplicationMain + 1225
31 App 0x00002548 main + 94
32 libdyld.dylib 0x01fe8701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I have tried recreating the breakpoint leaving all options on default. The blue arrow is activated.
'Show disassembly when debugging' is unchecked.
What could be wrong here ?

Check your build setting mode if it is in release mode then change it to debug mode.

If callstack does not tell you anything, try to turn on zombie objects for more detailed memory debug info. Yout can turn it on in menu 'Product -> Scheme -> Edit Scheme ...' than in left panel switch to 'Run $YourProjectName' and at the top panel switch to Diagnostics tab. There is an option under 'Menory Management' section 'Enable Zombie Objects' just turn it on. But be careful and when you find your bug turn it off again becouse these option cause diferent behaviour of memory alocations and releasing objects in memory and may cause an unexpected behaviour of your app.

Related

NSLayoutConstraint constant is not finite! That's illegal. constant:inf

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.

Change the text of UINavigationController not working in Swift

I have an app which has 5 UIViewControllers and the rootViewController is attached to a UINavigationController and the others are connected by segues. Now, I want to add a title to the UINavigationController. I have tried different things in viewDidLoad and viewDidAppear:
self.text = "Hello" // Runtime Error
self.navigationController?.navigationBar.topItem?.title = "Hello" // Runtime Error
self.navigationController?.visibleViewController.title = "Hello" // Runtime Error
The UIViewController that I am calling this is like this:
class LoginTypeActivityViewController: PPViewController{
}
Where, PPViewController is declared like this:
class PPViewController: UIViewController{
}
The runtime error is:
2014-10-13 17:21:27.878 mobilepay[29387:1382271] -[Swift._NSContiguousString set]: unrecognized selector sent to instance 0x7b6b33d0
2014-10-13 17:21:27.881 mobilepay[29387:1382271] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[Swift._NSContiguousString set]: unrecognized selector sent to instance 0x7b6b33d0'
*** First throw call stack:
(
0 CoreFoundation 0x00bb5df6 __exceptionPreprocess + 182
1 libobjc.A.dylib 0x0083fa97 objc_exception_throw + 44
2 CoreFoundation 0x00bbda75 -[NSObject(NSObject) doesNotRecognizeSelector:] + 277
3 CoreFoundation 0x00b069c7 ___forwarding___ + 1047
4 CoreFoundation 0x00b0658e _CF_forwarding_prep_0 + 14
5 UIFoundation 0x067eeb91 __NSStringDrawingEngine + 29221
6 UIFoundation 0x067e784d -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:] + 171
7 UIKit 0x013be151 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 6626
8 UIKit 0x013bbe30 -[UILabel drawTextInRect:] + 581
9 UIKit 0x013be256 -[UILabel drawRect:] + 98
10 UIKit 0x0123354b -[UIView(CALayerDelegate) drawLayer:inContext:] + 519
11 QuartzCore 0x01077d51 -[CALayer drawInContext:] + 118
12 QuartzCore 0x01077c87 _ZL16backing_callbackP9CGContextPv + 96
13 QuartzCore 0x00f5c7ae CABackingStoreUpdate_ + 2788
14 QuartzCore 0x01077c1f ___ZN2CA5Layer8display_Ev_block_invoke + 93
15 QuartzCore 0x010ad406 x_blame_allocations + 15
16 QuartzCore 0x01077a85 _ZN2CA5Layer8display_Ev + 1591
17 QuartzCore 0x01077cd6 -[CALayer _display] + 33
18 QuartzCore 0x01077446 _ZN2CA5Layer7displayEv + 142
19 QuartzCore 0x01077cb0 -[CALayer display] + 33
20 QuartzCore 0x0106bee6 _ZN2CA5Layer17display_if_neededEPNS_11TransactionE + 322
21 QuartzCore 0x0106bf6c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 38
22 QuartzCore 0x00fca676 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 284
23 QuartzCore 0x00fcba3c _ZN2CA11Transaction6commitEv + 392
24 QuartzCore 0x00fcc108 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
25 CoreFoundation 0x00ad8fbe __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
26 CoreFoundation 0x00ad8f00 __CFRunLoopDoObservers + 400
27 CoreFoundation 0x00ace93a __CFRunLoopRun + 1226
28 CoreFoundation 0x00ace1ab CFRunLoopRunSpecific + 443
29 CoreFoundation 0x00acdfdb CFRunLoopRunInMode + 123
30 GraphicsServices 0x0317124f GSEventRunModal + 192
31 GraphicsServices 0x0317108c GSEventRun + 104
32 UIKit 0x011a8e16 UIApplicationMain + 1526
33 mobilepay 0x001410de top_level_code + 78
34 mobilepay 0x0014111b main + 43
35 libdyld.dylib 0x03ad7ac9 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What can be the error? I am stuck since the last 5 hours here.
I am trying to set the title different in different UIViewControllers.
In your viewDidLoad(), type:
title = "Hello World"

Zombie Detected - But function never called

What i have Done?
In one of my UIViewController child i have implemented UITableView and have implemented the necessary UITableViewDelegate functions.
What i am Facing?
The issue i am facing is that i get EXC_BAD_ACCESS in Application whenever i relaunch the Controller and tap on Any cell.
What i have Tried?
I have tried to place breakpoints in the function didDeselectRowAtIndexPath: but it never reaches the Breakpoint. I tried Global Exception Breakpoint but it also didn't worked. I checked using the Instruments and found that a zombie is detechted when didDeselectRowAtIndexPath is called but control doesn't reaches the Function.
Instruments Zombie Details Image - Photo Bucket Link
After Implementing the Given Suggestions in the Comments this is the log that i have received
*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(
0 CoreFoundation 0x023e11e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01fc98e5 objc_exception_throw + 44
2 CoreFoundation 0x02393abc -[__NSArrayM insertObject:atIndex:] + 844
3 CoreFoundation 0x02393760 -[__NSArrayM addObject:] + 64
4 UIKit 0x00bf5782 -[UITableViewIndex _displayTitles] + 1071
5 UIKit 0x00bf58a8 -[UITableViewIndex _cacheAndMeasureTitles] + 171
6 UIKit 0x00bf6213 -[UITableViewIndex sizeThatFits:] + 131
7 UIKit 0x00a18bbc -[UITableView _updateIndexFrameSuppressingChangeNotification:] + 513
8 UIKit 0x00a189b6 -[UITableView _updateIndexFrame] + 41
9 UIKit 0x00a19a5f -[UITableView _updateIndex] + 649
10 UIKit 0x00a336f7 -[UITableView layoutSubviews] + 295
11 UIKit 0x009b3964 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
12 libobjc.A.dylib 0x01fdb82b -[NSObject performSelector:withObject:] + 70
13 QuartzCore 0x002ba45a -[CALayer layoutSublayers] + 148
14 QuartzCore 0x002ae244 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
15 QuartzCore 0x002ae0b0 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
16 QuartzCore 0x002147fa _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
17 QuartzCore 0x00215b85 _ZN2CA11Transaction6commitEv + 393
18 QuartzCore 0x00216258 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
19 CoreFoundation 0x023a936e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
20 CoreFoundation 0x023a92bf __CFRunLoopDoObservers + 399
21 CoreFoundation 0x02387254 __CFRunLoopRun + 1076
22 CoreFoundation 0x023869d3 CFRunLoopRunSpecific + 467
23 CoreFoundation 0x023867eb CFRunLoopRunInMode + 123
24 GraphicsServices 0x0381a5ee GSEventRunModal + 192
25 GraphicsServices 0x0381a42b GSEventRun + 104
26 UIKit 0x00944f9b UIApplicationMain + 1225
27 MyApplication 0x00001f9c main + 76
28 libdyld.dylib 0x034b3701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
It is pretty clear from all the logs and Zombie images that you are accessing the deallocated CountryListViewController. Keep track on the CountryListViewController and check it is available while you processing your table-view operations.
The better option is, Go to Xcode Menu Product->Scheme->Mange Schemes->Edit (left bottom)-> Debug-> Diagnostics -> Check all the options -> then Run the project.
This will be the Lighthouse to discover your crash.

SDWebImage in iOS 7.1 crashes

So, i've just updated my xcode and started building my app for iOS 7.1. But now i find out that my SDWebImage is broken. Whenever i try to set an ImageWithUrl for a UIImageView my app crashes with the following exception and stacktrace:
2014-03-11 12:55:36.647 Wiggle[1983:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIImageView setImageWithURL:placeholderImage:options:]: unrecognized selector sent to instance 0x10fa12890'
*** First throw call stack:
(
0 CoreFoundation 0x0000000103188795 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000102eeb991 objc_exception_throw + 43
2 CoreFoundation 0x0000000103219bad -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010317a09d ___forwarding___ + 973
4 CoreFoundation 0x0000000103179c48 _CF_forwarding_prep_0 + 120
5 Wiggle 0x000000010001fe94 -[MenuTableViewController tableView:viewForHeaderInSection:] + 1316
6 UIKit 0x000000010182cdb3 __84-[UITableView _sectionHeaderView:withFrame:forSection:floating:reuseViewIfPossible:]_block_invoke + 112
7 UIKit 0x00000001017b60ac +[UIView(Animation) performWithoutAnimation:] + 70
8 UIKit 0x000000010182ccc5 -[UITableView _sectionHeaderView:withFrame:forSection:floating:reuseViewIfPossible:] + 223
9 UIKit 0x00000001018149cf -[UITableView _updateVisibleHeadersAndFootersNow:] + 2596
10 UIKit 0x0000000101815b6f -[UITableView _updateVisibleCellsNow:] + 3122
11 UIKit 0x0000000101826381 -[UITableView layoutSubviews] + 207
12 UIKit 0x00000001017bdb27 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 354
13 QuartzCore 0x0000000100bb7a22 -[CALayer layoutSublayers] + 151
14 QuartzCore 0x0000000100bac589 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 363
15 QuartzCore 0x0000000100bac40a _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
16 QuartzCore 0x0000000100b21694 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 252
17 QuartzCore 0x0000000100b2270c _ZN2CA11Transaction6commitEv + 394
18 UIKit 0x0000000101779444 _afterCACommitHandler + 128
19 CoreFoundation 0x0000000103153ff7 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
20 CoreFoundation 0x0000000103153f67 __CFRunLoopDoObservers + 391
21 CoreFoundation 0x00000001031336d2 __CFRunLoopRun + 946
22 CoreFoundation 0x0000000103132f33 CFRunLoopRunSpecific + 467
23 GraphicsServices 0x00000001036a53a0 GSEventRunModal + 161
24 UIKit 0x0000000101762043 UIApplicationMain + 1010
I'm not sure what to do, can anybody help?
Thanks to Amar I found the answer.
SDWebImage with Base SDK iOS 7.1 requires you to exclude arm64 in
Project > BuildSettings > Architectures> Valid Architectures.
You might also need to set Build Active Architectures Only to NO for it to work.
Obviously now that there are lots of 64 bit devices out there you don't want to do this anymore, you instead want to download the latests SDWeb library that is compatible with the new architecture.

'NSInternalInconsistencyException', reason: 'custom navigation transition - no popping between different orientations!'

I'm facing a problem with UIViewController containment via MFSideMenu.
Problem is, on ViewControllers that support orientation, opening the side menu and selecting a different menu option (when the device is in landscape mode) causes the app to crash. This behavior worked perfectly in iOS 6, but is now failing in iOS 7.
Here's the stack trace:
2014-03-05 14:40:00.335 MyApp[21890:70b]
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: 'custom navigation transition - no popping between different orientations!'
*** First throw call stack:
(
0 CoreFoundation 0x024515e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x021098b6 objc_exception_throw + 44
2 CoreFoundation 0x024513bb +[NSException raise:format:] + 139
3 UIKit 0x009434b4 -[UINavigationController _startCustomTransition:] + 988
4 UIKit 0x009500c7 -[UINavigationController _startDeferredTransitionIfNeeded:] + 688
5 UIKit 0x00950cb9 -[UINavigationController __viewWillLayoutSubviews] + 57
6 UIKit 0x00a8a181 -[UILayoutContainerView layoutSubviews] + 213
7 UIKit 0x00880267 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 355
8 libobjc.A.dylib 0x0211b81f -[NSObject performSelector:withObject:] + 70
9 QuartzCore 0x01ecd2ea -[CALayer layoutSublayers] + 148
10 QuartzCore 0x01ec10d4 _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 380
11 QuartzCore 0x01ec0f40 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 26
12 QuartzCore 0x01e28ae6 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 294
13 QuartzCore 0x01e29e71 _ZN2CA11Transaction6commitEv + 393
14 QuartzCore 0x01e2a544 _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 92
15 CoreFoundation 0x024194ce __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
16 CoreFoundation 0x0241941f __CFRunLoopDoObservers + 399
17 CoreFoundation 0x023f7344 __CFRunLoopRun + 1076
18 CoreFoundation 0x023f6ac3 CFRunLoopRunSpecific + 467
19 CoreFoundation 0x023f68db CFRunLoopRunInMode + 123
20 GraphicsServices 0x036979e2 GSEventRunModal + 192
21 GraphicsServices 0x03697809 GSEventRun + 104
22 UIKit 0x00815d3b UIApplicationMain + 1225
23 MyApp 0x000022aa main + 138
24 libdyld.dylib 0x02e9f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any help in debugging this is appreciate.
P/S: Note the spelling mistake for "orientation" in the console log. I'm leaving it misspelt in case others stumble upon this problem as well.
Please check whether you are having the below functions.If then, please disable those and try,
(BOOL) shouldAutoRotate;
(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation;
remove all orientation related methods.
Thanks,
ithay.

Resources