BUTTON SHAPE on in a device app (iPhone) crashes the app if its app is running

I recently switched my app to iOS 7 compatibility and the app works fine, but if I enabled the Button Shape option (available in iOS 7.1) in the device settings (Setting -> Accessblity -> Button shape switch) then the app crashes and gives the following error: -

- [NSAttributeDictionary textContainerForAttributedString: containerSize: lineFragmentPadding:]: unrecognized selector posted on CoreFoundation instance 0x17e4e310

And the app works fine when the button form option is disabled.

crash stack trace: -

-[NSAttributeDictionary textContainerForAttributedString:containerSize:lineFragmentPadding:]: unrecognized selector sent to instance 0x17e4e310
CoreFoundation

Occurrences7
Users2
#   Binary Image Name   Address Symbol
0   CoreFoundation  0x2f057f0b  
1   libobjc.A.dylib 0x397eece7  objc_exception_throw
2   CoreFoundation  0x2f05b837  
3   CoreFoundation  0x2f05a137  
4   CoreFoundation  0x2efa9098  _CF_forwarding_prep_0
5   UIFoundation    0x36cd7915  __NSStringDrawingEngine
6   UIFoundation    0x36cd4863  -[NSString(NSExtendedStringDrawing) drawWithRect:options:attributes:context:]
7   UIKit   0x318a02c9  -[UILabel _drawTextInRect:baselineCalculationOnly:]
8   UIKit   0x31906709  -[UILabel drawTextInRect:]
9   UIKit   0x3190650b  -[UILabel drawRect:]
10  UIKit   0x319064a9  -[UIView(CALayerDelegate) drawLayer:inContext:]
11  QuartzCore  0x31532189  -[CALayer drawInContext:]
12  QuartzCore  0x3151bc5b  CABackingStoreUpdate_
13  QuartzCore  0x315f7c1d  ___ZN2CA5Layer8display_Ev_block_invoke
14  QuartzCore  0x3151b50b  x_blame_allocations
15  QuartzCore  0x3151b1bf  _ZN2CA5Layer8display_Ev
16  QuartzCore  0x314fed41  _ZN2CA5Layer17display_if_neededEPNS_11TransactionE
17  QuartzCore  0x314fe9d9  _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE
18  QuartzCore  0x314fe3e5  _ZN2CA7Context18commit_transactionEPNS_11TransactionE
19  QuartzCore  0x314fe1f7  _ZN2CA11Transaction6commitEv
20  QuartzCore  0x3152b8e3  _ZN2CA11Transaction14release_threadEPv
21  libsystem_pthread.dylib 0x39e096d1  
22  libsystem_pthread.dylib 0x39e09453  
23  libsystem_pthread.dylib 0x39e0a1b9  pthread_exit
24  Foundation  0x2f994703  +[NSThread exit]
25  Foundation  0x2fa40a2d  __NSThread__main__
26  libsystem_pthread.dylib 0x39e0a959  
27  libsystem_pthread.dylib 0x39e0a8cb  _pthread_start
28  libsystem_pthread.dylib 0x39e08ae8  thread_start

      

Any Suggestion Thanks

+2


source to share


1 answer


This usually happens due to some incompatibility of some code in iOS 7.1.

And this should happen in the device, not in the simulator. Right?

The fact that the Simulator runs on different hardware (base Mac OS) versus the hardware of the device may mean there are some random differences like these.

What you can do is put an Exceptional Breakpoint to see which method is giving the error. After you get a method, all you have to do is call that method on the main thread.



You can use:

dispatch_async(dispatch_get_main_queue(), ^{
  [self doSomething];
});

      

This should do the trick. Hope this helps. Thank you. :)

+1


source







All Articles