terminating uncaught exception of type NSException - ios

My game is constantly crashing after pressing a certain button after restarting the game.
An animation is always running during the game in the ViewController I'm running the game on.
Here is the crash log. Is there any way to detect how is this crash related to my animation?
2014-08-05 00:21:30.044 windmill[702:90b] -[CALayer doubleValue]: unrecognized selector sent to instance 0xec32a10
2014-08-05 00:21:30.053 windmill[702:90b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[CALayer doubleValue]: unrecognized selector sent to instance 0xec32a10'
*** First throw call stack:
(
0 CoreFoundation 0x01c501e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x019cf8e5 objc_exception_throw + 44
2 CoreFoundation 0x01ced243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01c4050b ___forwarding___ + 1019
4 CoreFoundation 0x01c400ee _CF_forwarding_prep_0 + 14
5 QuartzCore 0x0013b9b8 CAObject_setValueForKeyPath_ + 2435
6 QuartzCore 0x0012129b -[CALayer setValue:forKeyPath:] + 471
7 QuartzCore 0x00105d51 -[CABasicAnimation applyForTime:presentationObject:modelObject:] + 1178
8 QuartzCore 0x0012415c _ZN2CA5Layer18presentation_layerEPNS_11TransactionE + 494
9 QuartzCore 0x00127cbe -[CALayer presentationLayer] + 43
10 UIKit 0x006eb0f1 _UIViewEatsTouches + 142
11 UIKit 0x006eb250 -[UIView(Geometry) hitTest:withEvent:] + 114
12 UIKit 0x006eb4f4 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke + 132
13 CoreFoundation 0x01cccd86 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 102
14 CoreFoundation 0x01cccc5f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
15 UIKit 0x006eb35c -[UIView(Geometry) hitTest:withEvent:] + 382
16 UIKit 0x006eb4f4 __38-[UIView(Geometry) hitTest:withEvent:]_block_invoke + 132
17 CoreFoundation 0x01cccd86 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 102
18 CoreFoundation 0x01cccc5f -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 239
19 UIKit 0x006eb35c -[UIView(Geometry) hitTest:withEvent:] + 382
20 UIKit 0x006daeb1 __54+[UIWindow _hitTestToPoint:pathIndex:forEvent:screen:]_block_invoke + 175
21 UIKit 0x006dad1e +[UIWindow _topVisibleWindowPassingTest:] + 198
22 UIKit 0x006dadfa +[UIWindow _hitTestToPoint:pathIndex:forEvent:screen:] + 176
23 UIKit 0x0068c5bb _UIApplicationHandleEventQueue + 7975
24 CoreFoundation 0x01bd977f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25 CoreFoundation 0x01bd910b __CFRunLoopDoSources0 + 235
26 CoreFoundation 0x01bf61ae __CFRunLoopRun + 910
27 CoreFoundation 0x01bf59d3 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x01bf57eb CFRunLoopRunInMode + 123
29 GraphicsServices 0x0341c5ee GSEventRunModal + 192
30 GraphicsServices 0x0341c42b GSEventRun + 104
31 UIKit 0x0068ff9b UIApplicationMain + 1225
32 windmill 0x00004afd main + 141
33 libdyld.dylib 0x03103725 start + 0
34 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
When I press buttons in the view , the app crashes. Here is the animation code:
CABasicAnimation *fullRotation = [CABasicAnimation animationWithKeyPath:#"transform.rotation"];
fullRotation.fromValue = [NSNumber numberWithFloat:0];
fullRotation.toValue = [NSNumber numberWithFloat:((360*M_PI)/180)];
fullRotation.duration = 4;
fullRotation.repeatCount= 1000;
[[stick layer] addAnimation:fullRotation forKey:#"60"];}
I'm sorry if the code is messed up , I'm still learning and building small apps and games to get a better practice. Thanks.

You should remove the lines with fullRotation.fromValue, since it ought not to have a CALayer assigned to itself.
fullRotation.fromValue = self.view.layer.presentationLayer;

Related

IOS Swift, Google SignIn run time error at GIDSignIn.sharedInstance().clientID

I am trying to implement Google SignIn in my iOS project and getting runtime error at line:
GIDSignIn.sharedInstance().clientID = "mysecrectkey.apps.googleusercontent.com"
in AppDelegate. Error I am getting is something like below. I followed each step which is mentioned in following link and still no luck.
http://www.theappguruz.com/blog/integrate-google-signin-sdk-in-ios-application-using-swift
I tried adding -ObjC in Other Linker Flags section as well. Please help me to figure this out. Thanks
2016-10-09 17:16:57.754 GoogleLoginTest1[8996:611837] -[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector sent to instance 0x618000071a80
2016-10-09 17:16:57.758 GoogleLoginTest1[8996:611837] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSDictionaryI gtm_httpArgumentsString]: unrecognized selector sent to instance 0x618000071a80'
*** First throw call stack:
(
0 CoreFoundation 0x000000010ce2234b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x000000010c46621e objc_exception_throw + 48
2 CoreFoundation 0x000000010ce91f34 -[NSObject(NSObject) doesNotRecognizeSelector:] + 132
3 CoreFoundation 0x000000010cda7c15 ___forwarding___ + 1013
4 CoreFoundation 0x000000010cda7798 _CF_forwarding_prep_0 + 120
5 GoogleLoginTest1 0x000000010bb4272e -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 11318
6 GoogleLoginTest1 0x000000010bb44551 -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 19033
7 GoogleLoginTest1 0x000000010bb43fc4 -[GSDK_GTMSessionFetcherSessionDelegateDispatcher .cxx_destruct] + 17612
8 GoogleLoginTest1 0x000000010bb223ed _TFC16GoogleLoginTest111AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 685
9 GoogleLoginTest1 0x000000010bb22594 _TToFC16GoogleLoginTest111AppDelegate11applicationfTCSo13UIApplication29didFinishLaunchingWithOptionsGSqGVs10DictionaryVSC29UIApplicationLaunchOptionsKeyP____Sb + 180
10 UIKit 0x000000010da4068e -[UIApplication _handleDelegateCallbacksWithOptions:isSuspended:restoreState:] + 290
11 UIKit 0x000000010da42013 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4236
12 UIKit 0x000000010da483b9 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1731
13 UIKit 0x000000010da45539 -[UIApplication workspaceDidEndTransaction:] + 188
14 FrontBoardServices 0x00000001131ac76b __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK__ + 24
15 FrontBoardServices 0x00000001131ac5e4 -[FBSSerialQueue _performNext] + 189
16 FrontBoardServices 0x00000001131ac96d -[FBSSerialQueue _performNextFromRunLoopSource] + 45
17 CoreFoundation 0x000000010cdc7311 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x000000010cdac59c __CFRunLoopDoSources0 + 556
19 CoreFoundation 0x000000010cdaba86 __CFRunLoopRun + 918
20 CoreFoundation 0x000000010cdab494 CFRunLoopRunSpecific + 420
21 UIKit 0x000000010da43db6 -[UIApplication _run] + 434
22 UIKit 0x000000010da49f34 UIApplicationMain + 159
23 GoogleLoginTest1 0x000000010bb24cdf main + 111
24 libdyld.dylib 0x000000010fc4d68d start + 1
25 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
have you added Other linker flag : -OjcC

libc++abi.dylib: terminating with uncaught exception of type NSException (CollectionView)

When I launch my App with the CollectionView:
2016-06-20 20:37:30.640 Projekt A[19055:699202] -[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x7fd1bbfa3ac0
2016-06-20 20:37:30.748 Projekt A[19055:699202] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController collectionView:numberOfItemsInSection:]: unrecognized selector sent to instance 0x7fd1bbfa3ac0'
*** First throw call stack:
(
0 CoreFoundation 0x000000010f8d2d85 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111854deb objc_exception_throw + 48
2 CoreFoundation 0x000000010f8dbd3d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010f821cfa ___forwarding___ + 970
4 CoreFoundation 0x000000010f8218a8 _CF_forwarding_prep_0 + 120
5 UIKit 0x0000000110baa56c -[UICollectionViewData _updateItemCounts] + 492
6 UIKit 0x0000000110bad009 -[UICollectionViewData numberOfSections] + 22
7 UIKit 0x0000000110b8ef51 -[UICollectionViewFlowLayout _getSizingInfos] + 445
8 UIKit 0x0000000110b90c47 -[UICollectionViewFlowLayout _fetchItemsInfoForRect:] + 118
9 UIKit 0x0000000110b8a3fd -[UICollectionViewFlowLayout prepareLayout] + 273
10 UIKit 0x0000000110baac3d -[UICollectionViewData _prepareToLoadData] + 67
11 UIKit 0x0000000110bab411 -[UICollectionViewData validateLayoutInRect:] + 53
12 UIKit 0x0000000110b5853a -[UICollectionView layoutSubviews] + 199
13 UIKit 0x0000000110393980 -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 703
14 QuartzCore 0x0000000114a4ac00 -[CALayer layoutSublayers] + 146
15 QuartzCore 0x0000000114a3f08e _ZN2CA5Layer16layout_if_neededEPNS_11TransactionE + 366
16 QuartzCore 0x0000000114a3ef0c _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 24
17 QuartzCore 0x0000000114a333c9 _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 277
18 QuartzCore 0x0000000114a61086 _ZN2CA11Transaction6commitEv + 486
19 UIKit 0x000000011030519b _afterCACommitHandler + 174
20 CoreFoundation 0x000000010f7f7c37 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
21 CoreFoundation 0x000000010f7f7ba7 __CFRunLoopDoObservers + 391
22 CoreFoundation 0x000000010f7ed7fb __CFRunLoopRun + 1147
23 CoreFoundation 0x000000010f7ed0f8 CFRunLoopRunSpecific + 488
24 GraphicsServices 0x000000011607cad2 GSEventRunModal + 161
25 UIKit 0x00000001102d8f09 UIApplicationMain + 171
26 Projekt A 0x000000010f6e4292 main + 114
27 libdyld.dylib 0x000000011238292d start + 1
28 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
somebody can help me pls?
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
The error is saying that the collection view's data source is set to be a plain UIViewController instead of whatever class you have that implements UICollectionViewDataSource.
Check how your data source is assigned and what class of object it is.

App crashes while loading image via URL iOS

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.

iOS app crash when keyboard showing on iPad

I have an app which work perfectly on iPhone. But when i starting it on iPad and tap on UITextField it’s crash with error:
Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
*** First throw call stack:
(
0 CoreFoundation 0x032a05e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x02c1e8b6 objc_exception_throw + 44
2 CoreFoundation 0x032414e6 -[__NSArrayM objectAtIndex:] + 246
3 Parking 0x002b0ccd -[UIView(Hackery) pd_swizzled_exchangeSubviewAtIndex:withSubviewAtIndex:] + 141
4 UIKit 0x020a89ef -[_UIBackdropView ensureProperSubviewOrdering] + 666
5 UIKit 0x020a810e -[_UIBackdropView updateSubviewHierarchyIfNeededForSettings:] + 127
6 UIKit 0x020a47dc -[_UIBackdropView setComputesColorSettings:] + 235
7 UIKit 0x01b1c87a -[UIKBBackdropView triggerUpdate:] + 400
8 Foundation 0x028f1bf9 __57-[NSNotificationCenter addObserver:selector:name:object:]_block_invoke + 40
9 CoreFoundation 0x032fc524 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 20
10 CoreFoundation 0x0325400b _CFXNotificationPost + 2859
11 Foundation 0x0282b951 -[NSNotificationCenter postNotificationName:object:userInfo:] + 98
12 UIKit 0x01e1cb1b -[UIInputViewTransition postNotificationsForTransitionEnd] + 1054
13 UIKit 0x0c69c453 -[UIInputViewTransitionAccessibility(SafeCategory) postNotificationsForTransitionEnd] + 51
14 UIKit 0x01e13138 __53-[UIPeripheralHost(UIKitInternal) executeTransition:]_block_invoke1332 + 455
15 UIKit 0x019ef005 -[UIViewAnimationBlockDelegate _didEndBlockAnimation:finished:context:] + 306
16 UIKit 0x019d8c6c -[UIViewAnimationState sendDelegateAnimationDidStop:finished:] + 267
17 UIKit 0x019d8f58 -[UIViewAnimationState animationDidStop:finished:] + 80
18 UIKit 0x0c6a4b67 -[UIViewAnimationStateAccessibility(SafeCategory) animationDidStop:finished:] + 66
19 QuartzCore 0x00821a44 _ZN2CA5Layer23run_animation_callbacksEPv + 304
20 libdispatch.dylib 0x0362b4b0 _dispatch_client_callout + 14
21 libdispatch.dylib 0x0361975e _dispatch_main_queue_callback_4CF + 340
22 CoreFoundation 0x03305a5e __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 14
23 CoreFoundation 0x032466bb __CFRunLoopRun + 1963
24 CoreFoundation 0x03245ac3 CFRunLoopRunSpecific + 467
25 CoreFoundation 0x032458db CFRunLoopRunInMode + 123
26 GraphicsServices 0x03f7d9e2 GSEventRunModal + 192
27 GraphicsServices 0x03f7d809 GSEventRun + 104
28 UIKit 0x0198cd3b UIApplicationMain + 1225
29 Parking 0x00073cad main + 141
30 libdyld.dylib 0x038bd70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
I tried comment all my code to find a reason. Even created an empty view controller and add text field to it. But it’s didn't helped. Any idea?
It is an issue with PonyDebugger which has been fixed in the latest release. Use a version >= 0.3.1.
pod 'PonyDebugger', '~> 0.3.1'

Handling Compatibility issues IOS 4.0- 5.1

I have created an app that is running great on 5.0 and above but when I test on devices lower I have ran into a few issues that I am unsure of how to tackle and correct.
The first big issue is when saving to core data I use a error method that I believe is apples default error method that is created when you make a core data model. The app just crashes when below 5.0 but if I block out the error code everything works fine. Below is the code used to find and error and handle it.
NSError *error;
if (![managedObjectContext save:&error]) { // crash here
// This is a serious error saying the record could not be saved.
// Advise the user to restart the application
}
//crash log below
2012-05-13 10:17:22.062 PreviewMaker[41595:207] -[UIImage encodeWithCoder:]:
unrecognized selector sent to instance 0x5e7ce80
2012-05-13 10:17:22.064 PreviewMaker[41595:207] *** Terminating app due to uncaught
exception 'NSInvalidArgumentException', reason: '-[UIImage encodeWithCoder:]:
unrecognized selector sent to instance 0x5e7ce80'
*** Call stack at first throw:
(
0 CoreFoundation 0x013fc5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0178b313 objc_exception_throw + 44
2 CoreFoundation 0x013fe0bb -[NSObject(NSObject)
doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0136d966 ___forwarding___ + 966
4 CoreFoundation 0x0136d522 _CF_forwarding_prep_0 + 50
5 Foundation 0x00c45b3e _encodeObject + 1076
6 Foundation 0x00c50f89 +[NSKeyedArchiver
archivedDataWithRootObject:] + 206
7 CoreData 0x01122cb5 -[NSSQLiteConnection execute] +
2677
8 CoreData 0x011771d6 -[NSSQLiteConnection insertRow:]
+ 262
9 CoreData 0x01173e64 -[NSSQLConnection
performAdapterOperations:] + 180
10 CoreData 0x01173b0e -[NSSQLCore
_performChangesWithAdapterOps:] + 494
11 CoreData 0x011725ea -[NSSQLCore performChanges] + 410
12 CoreData 0x0116c038 -[NSSQLCore saveChanges:] + 216
13 CoreData 0x0112a199 -[NSSQLCore
executeRequest:withContext:error:] + 409
14 CoreData 0x011da70b -[NSPersistentStoreCoordinator
executeRequest:withContext:error:] + 3691
15 CoreData 0x01162948 -[NSManagedObjectContext save:] +
712
16 PreviewMaker 0x0000a0c0 -[MainViewController
noUploadJustSaveImage:] + 331
17 PreviewMaker 0x00009d3c -[MainViewController
UserConfirmedToSaveImage] + 756
18 UIKit 0x004774fd -[UIApplication
sendAction:to:from:forEvent:] + 119
19 UIKit 0x00507799 -[UIControl
sendAction:to:forEvent:] + 67
20 UIKit 0x00509c2b -[UIControl(Internal)
_sendActionsForEvents:withEvent:] + 527
21 UIKit 0x005087d8 -[UIControl
touchesEnded:withEvent:] + 458
22 UIKit 0x0049bded -[UIWindow _sendTouchesForEvent:]
+ 567
23 UIKit 0x0047cc37 -[UIApplication sendEvent:] + 447
24 UIKit 0x00481f2e _UIApplicationHandleEvent + 7576
25 GraphicsServices 0x01eb8992 PurpleEventCallback + 1550
26 CoreFoundation 0x013dd944
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
27 CoreFoundation 0x0133dcf7 __CFRunLoopDoSource1 + 215
28 CoreFoundation 0x0133af83 __CFRunLoopRun + 979
29 CoreFoundation 0x0133a840 CFRunLoopRunSpecific + 208
30 CoreFoundation 0x0133a761 CFRunLoopRunInMode + 97
31 GraphicsServices 0x01eb71c4 GSEventRunModal + 217
32 GraphicsServices 0x01eb7289 GSEventRun + 115
33 UIKit 0x00485c93 UIApplicationMain + 1160
34 PreviewMaker 0x00002e07 main + 121
35 PreviewMaker 0x00002d85 start + 53
)
terminate called after throwing an instance of 'NSException'
Another issue I am running into is setting tintColor on UI objects such as the UISwitch. I have a settings controller that has several UISwitches and such which just about all have a tint color set on, but once agin anything below 5.0 crashes. How can I handle the two and not have to re-write the code just to be compatible with devices below 5.0.
shineSwitch = [[[UISwitch alloc] initWithFrame:CGRectZero] autorelease];
[cell.contentView addSubview:shineSwitch];
cell.accessoryView = shineSwitch;
[shineSwitch addTarget:self action:#selector(switchChanged:) 
forControlEvents:UIControlEventValueChanged];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
shineSwitch.onTintColor = [UIColor colorWithRed:0.0 green:0.61 blue:0.99 alpha:1.0];
//crash Log below
2012-05-13 10:19:45.033 PreviewMaker[41611:207] -[UISwitch setOnTintColor:]:
unrecognized selector sent to instance 0x5eab860
2012-05-13 10:19:45.034 PreviewMaker[41611:207] *** Terminating app due to uncaught
exception 'NSInvalidArgumentException', reason: '-[UISwitch setOnTintColor:]:
unrecognized selector sent to instance 0x5eab860'
*** Call stack at first throw:
(
0 CoreFoundation 0x013fc5a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0178b313 objc_exception_throw + 44
2 CoreFoundation 0x013fe0bb -[NSObject(NSObject)
doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0136d966 ___forwarding___ + 966
4 CoreFoundation 0x0136d522 _CF_forwarding_prep_0 + 50
5 PreviewMaker 0x0000f6fb -[FlipsideViewController
tableView:cellForRowAtIndexPath:] + 1353
6 UIKit 0x004ecb98 -
[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 634
7 UIKit 0x004e24cc -
[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 75
8 UIKit 0x004f78cc -
[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 1561
9 UIKit 0x004ef90c -[UITableView layoutSubviews] +
242
10 QuartzCore 0x001e2a5a -[CALayer layoutSublayers] + 181
11 QuartzCore 0x001e4ddc CALayerLayoutIfNeeded + 220
12 QuartzCore 0x0018a0b4
_ZN2CA7Context18commit_transactionEPNS_11TransactionE + 310
13 QuartzCore 0x0018b294 _ZN2CA11Transaction6commitEv +
292
14 QuartzCore 0x0018b46d
_ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
15 CoreFoundation 0x013dd89b
__CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
16 CoreFoundation 0x013726e7 __CFRunLoopDoObservers + 295
17 CoreFoundation 0x0133b1d7 __CFRunLoopRun + 1575
18 CoreFoundation 0x0133a840 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x0133a761 CFRunLoopRunInMode + 97
20 GraphicsServices 0x01eb71c4 GSEventRunModal + 217
21 GraphicsServices 0x01eb7289 GSEventRun + 115
22 UIKit 0x00485c93 UIApplicationMain + 1160
23 PreviewMaker 0x00002e07 main + 121
24 PreviewMaker 0x00002d85 start + 53
)
terminate called after throwing an instance of 'NSException'
Any help would be greatly appreciated!

Resources