Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBSDKProfilePictureView CGImage]: - ios

declare in .h file for facebook sdk integration
#property (weak, nonatomic) IBOutlet FBSDKProfilePictureView *profilePicture;
in .m file declare that
self.profilePicture.profileID = [ result objectForKey:#"id"];
UIImage *img=self.profilePicture;
giving error that
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[FBSDKProfilePictureView CGImage]: unrecognized selector sent to instance 0x7fdd5a5651e0'
*** First throw call stack:(
0 CoreFoundation 0x0000000106366a75 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000105ffabb7 objc_exception_throw + 45
2 CoreFoundation 0x000000010636dd1d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x00000001062c59dc ___forwarding___ + 988
4 CoreFoundation 0x00000001062c5578 _CF_forwarding_prep_0 + 120
5 UIKit 0x00000001048c5732 UIImagePNGRepresentation + 33
6 SmartCookieProgram 0x0000000103bd0770 __47-[LoginViewController loginViewFetchedUserInfo]_block_invoke + 2880
7 SmartCookieProgram 0x0000000103c0b903 -[FBSDKGraphRequestMetadata invokeCompletionHandlerForConnection:withResults:error:] + 146
8 SmartCookieProgram 0x0000000103c11c6d __64-[FBSDKGraphRequestConnection processResultBody:error:metadata:]_block_invoke370 + 142
9 SmartCookieProgram 0x0000000103c11a02 -[FBSDKGraphRequestConnection processResultBody:error:metadata:] + 1046
10 SmartCookieProgram 0x0000000103c114d0 __64-[FBSDKGraphRequestConnection completeWithResults:networkError:]_block_invoke + 428
11 CoreFoundation 0x000000010629e782 __53-[__NSArrayM enumerateObjectsWithOptions:usingBlock:]_block_invoke + 114
12 CoreFoundation 0x000000010629dedc -[__NSArrayM enumerateObjectsWithOptions:usingBlock:] + 300
13 SmartCookieProgram 0x0000000103c11287 -[FBSDKGraphRequestConnection completeWithResults:networkError:] + 670
14 SmartCookieProgram 0x0000000103c10574 -[FBSDKGraphRequestConnection completeFBSDKURLConnectionWithResponse:data:networkError:] + 669
15 SmartCookieProgram 0x0000000103c0eca2 __36-[FBSDKGraphRequestConnection start]_block_invoke_2 + 72
16 SmartCookieProgram 0x0000000103c0c034 -[FBSDKURLConnection invokeHandler:error:response:responseData:] + 85
17 SmartCookieProgram 0x0000000103c0bfa9 -[FBSDKURLConnection logAndInvokeHandler:response:responseData:] + 395
18 SmartCookieProgram 0x0000000103c0c2fa -[FBSDKURLConnection connectionDidFinishLoading:] + 135
19 CFNetwork 0x0000000108e3b98c __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
20 CFNetwork 0x0000000108e3b930 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
21 CFNetwork 0x0000000108e3ba97 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
22 CFNetwork 0x0000000108d0b937 ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 107
23 CFNetwork 0x0000000108dd8a31 ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 273
24 CFNetwork 0x0000000108cf6d16 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 72
25 CoreFoundation 0x000000010626eb44 CFArrayApplyFunction + 68
26 CFNetwork 0x0000000108cf6bd7 _ZN19RunloopBlockContext7performEv + 133
27 CFNetwork 0x0000000108cf6a16 _ZN17MultiplexerSource7performEv + 256
28 CFNetwork 0x0000000108cf682c _ZN17MultiplexerSource8_performEPv + 72
29 CoreFoundation 0x000000010629bc91 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
30 CoreFoundation 0x0000000106291b5d __CFRunLoopDoSources0 + 269
31 CoreFoundation 0x0000000106291194 __CFRunLoopRun + 868
32 CoreFoundation 0x0000000106290bc6 CFRunLoopRunSpecific + 470
33 GraphicsServices 0x0000000107e02a58 GSEventRunModal + 161
34 UIKit 0x0000000104892580 UIApplicationMain + 1282
35 SmartCookieProgram 0x0000000103bce9c3 main + 115
36 libdyld.dylib 0x0000000107648145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
please provide solution for the error and also want to know how to get user Location using FBSDKGraphRequest and FBSDKGraphRequestConnection

FBSDKProfilePictureView is kind of UIView class, not an Image.
Add an UIImageVIew on your xib or storyboard and create an IBOutlet of the same.
#property (weak, nonatomic) IBOutlet UIImageView *imageView;
Use the following code:
self.profilePicture = [[FBSDKProfilePictureView alloc] initWithFrame:_imageView.frame];
[_profilePicture setProfileID: result[#"id"]];
[self.view addSubview:_profilePicture];
It will work!!

Related

Not able to find crash Swift

App is crashing with these logs, but couldn't able to find what's causing the crash
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull set]: unrecognized selector sent to instance 0x118f33590'
*** First throw call stack:
(
0 CoreFoundation 0x0000000118ccf8ab __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00000001117a5ba3 objc_exception_throw + 48
2 CoreFoundation 0x0000000118cdeab8 +[NSObject(NSObject) instanceMethodSignatureForSelector:] + 0
3 CoreFoundation 0x0000000118cd3d71 ___forwarding___ + 1431
4 CoreFoundation 0x0000000118cd6068 _CF_forwarding_prep_0 + 120
5 UIFoundation 0x0000000125ff888b -[NSCoreTypesetter _NSFastDrawString:length:attributes:paragraphStyle:typesetterBehavior:lineBreakMode:rect:padding:graphicsContext:baselineRendering:usesFontLeading:usesScreenFont:scrollable:syncAlignment:mirrored:boundingRectPointer:baselineOffsetPointer:drawingContext:] + 5857
6 UIFoundation 0x0000000125ffa518 -[NSCoreTypesetter _stringDrawingCoreTextEngineWithOriginalString:rect:padding:graphicsContext:forceClipping:attributes:stringDrawingOptions:drawingContext:stringDrawingInterface:] + 1266
7 UIFoundation 0x0000000125ff1ea8 __NSStringDrawingEngine + 1882
8 UIFoundation 0x0000000125fef7a8 _NSStringDrawingCore + 173
9 UIFoundation 0x0000000125ff31ae -[NSAttributedString(NSExtendedStringDrawing) drawWithRect:options:context:] + 91
10 UIKitCore 0x0000000123c32a50 -[UILabel _drawTextInRect:baselineCalculationOnly:returningDeviceMetricsOfFirstLine:] + 4359
11 UIKitCore 0x0000000123c39393 -[UILabel _drawTextInRect:baselineCalculationOnly:] + 37
12 UIKitCore 0x0000000123c39c3f -[UILabel _drawTextInRect:] + 257
13 UIKitCore 0x0000000123c38e8a -[UILabel drawTextInRect:] + 615
14 UIKitCore 0x0000000123c39cd2 -[UILabel drawRect:] + 70
15 UIKitCore 0x0000000123d0881d -[UIView(CALayerDelegate) drawLayer:inContext:] + 613
16 QuartzCore 0x0000000114c3cd74 CABackingStoreUpdate_ + 223
17 QuartzCore 0x0000000114df5101 ___ZN2CA5Layer8display_Ev_block_invoke + 53
18 QuartzCore 0x0000000114deb29a -[CALayer _display] + 2114
19 QuartzCore 0x0000000114dfe748 _ZN2CA5Layer28layout_and_display_if_neededEPNS_11TransactionE + 464
20 QuartzCore 0x0000000114d0fb0c _ZN2CA7Context18commit_transactionEPNS_11TransactionEdPd + 626
21 QuartzCore 0x0000000114d4769b _ZN2CA11Transaction6commitEv + 735
22 QuartzCore 0x0000000114d48b64 _ZN2CA11Transaction25flush_as_runloop_observerEb + 60
23 CoreFoundation 0x0000000118c2e055 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 23
24 CoreFoundation 0x0000000118c289c2 __CFRunLoopDoObservers + 515
25 CoreFoundation 0x0000000118c28f0d __CFRunLoopRun + 1161
26 CoreFoundation 0x0000000118c286a7 CFRunLoopRunSpecific + 560
27 GraphicsServices 0x000000011d4df28a GSEventRunModal + 139
28 UIKitCore 0x00000001236d6ad3 -[UIApplication _run] + 994
29 UIKitCore 0x00000001236db9ef UIApplicationMain + 123
30 libswiftUIKit.dylib 0x0000000117366c72 $s5UIKit17UIApplicationMainys5Int32VAD_SpySpys4Int8VGGSgSSSgAJtF + 98
31 MyAppName 0x00000001044eb198 $sSo21UIApplicationDelegateP5UIKitE4mainyyFZ + 104
32 MyAppName 0x00000001044eb127 $s19MyAppName11AppDelegateC5$mainyyFZ + 39
33 MyAppName 0x00000001044eb2c8 main + 24
34 dyld 0x000000010e3e52bf start_sim + 10
35 ??? 0x0000000205ea6310 0x0 + 8689181456
)
libc++abi: terminating with uncaught exception of type NSException
Message from debugger: Terminated due to signal 6

iOS - Crash with google admob SDK after upgraded to v7.7.0

We upgraded google admob v7.5.1 to v7.7.0 through pod file. After upgrade app crash on launching with following log.
2016-03-21 12:17:47.065 myAppName[3672:83997] -[NSTaggedPointerString count]: unrecognized selector sent to instance 0xa0110632e20924c9
2016-03-21 12:17:47.119 myAppName[3672:83997] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSTaggedPointerString count]: unrecognized selector sent to instance 0xa0110632e20924c9'
*** First throw call stack:
(
0 CoreFoundation 0x000000010a3e8e65 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000109e5fdeb objc_exception_throw + 48
2 CoreFoundation 0x000000010a3f148d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x000000010a33e90a ___forwarding___ + 970
4 CoreFoundation 0x000000010a33e4b8 _CF_forwarding_prep_0 + 120
5 CoreFoundation 0x000000010a300e84 -[NSSet initWithArray:] + 36
6 myAppName 0x000000010579e66e hasRequiredParams + 19102
7 myAppName 0x000000010579c3a3 hasRequiredParams + 10195
8 myAppName 0x000000010579c1fc hasRequiredParams + 9772
9 myAppName 0x000000010579c048 hasRequiredParams + 9336
10 myAppName 0x000000010573ad87 GADiTunesMetadataForFileAtPath + 2024
11 myAppName 0x000000010573a7d2 GADiTunesMetadataForFileAtPath + 563
12 Foundation 0x0000000106d07790 -[__NSObserver _doit:] + 304
13 CoreFoundation 0x000000010a3b569c __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 12
14 CoreFoundation 0x000000010a3b53db _CFXRegistrationPost + 427
15 CoreFoundation 0x000000010a3b5142 ___CFXNotificationPost_block_invoke + 50
16 CoreFoundation 0x000000010a3fa972 -[_CFXNotificationRegistrar find:object:observer:enumerator:] + 1986
17 CoreFoundation 0x000000010a2b0279 _CFXNotificationPost + 633
18 Foundation 0x0000000106ceb109 -[NSNotificationCenter postNotificationName:object:userInfo:] + 66
19 UIKit 0x0000000107cb06f0 -[UIApplication _callInitializationDelegatesForMainScene:transitionContext:] + 4272
20 UIKit 0x0000000107cb6cc6 -[UIApplication _runWithMainScene:transitionContext:completion:] + 1760
21 UIKit 0x0000000107cb3e7b -[UIApplication workspaceDidEndTransaction:] + 188
22 FrontBoardServices 0x000000010bcdf754 -[FBSSerialQueue _performNext] + 192
23 FrontBoardServices 0x000000010bcdfac2 -[FBSSerialQueue _performNextFromRunLoopSource] + 45
24 CoreFoundation 0x000000010a314a31 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
25 CoreFoundation 0x000000010a30a95c __CFRunLoopDoSources0 + 556
26 CoreFoundation 0x000000010a309e13 __CFRunLoopRun + 867
27 CoreFoundation 0x000000010a309828 CFRunLoopRunSpecific + 488
28 UIKit 0x0000000107cb37cd -[UIApplication _run] + 402
29 UIKit 0x0000000107cb8610 UIApplicationMain + 171
30 myAppName 0x00000001055b4c7e main + 62
31 libdyld.dylib 0x000000010a8d492d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

iOS - Crash issue on reload table

after recently updating an app to 64 bit, and 7.1 im getting a crash on a reload of a table. Ive tried various begin/end update attempts, but nothing seems to resolve.
Behaviour is around 2 seconds of hang then crash - here code called, then is the crash.
[myTableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:UITableViewRowAnimationFade];
crash:
2015-11-02 20:10:24.827 ABC[43144:971620] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]'
*** First throw call stack:
(
0 CoreFoundation 0x000000010cbe9f45 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x000000010c663deb objc_exception_throw + 48
2 CoreFoundation 0x000000010caeceae -[__NSPlaceholderDictionary initWithObjects:forKeys:count:] + 318
3 CoreFoundation 0x000000010caff21b +[NSDictionary dictionaryWithObjects:forKeys:count:] + 59
4 ABC 0x0000000106d7d426 -[ABCViewController tableView:heightForRowAtIndexPath:] + 1926
5 UIKit 0x00000001087105cf __66-[UISectionRowData refreshWithSection:tableView:tableViewRowData:]_block_invoke + 240
6 UIKit 0x000000010870fc5f -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 4876
7 UIKit 0x0000000108712898 -[UITableViewRowData ensureAllSectionsAreValid] + 109
8 UIKit 0x00000001084e3132 -[UITableView _endCellAnimationsWithContext:] + 598
9 UIKit 0x00000001084fd1bf -[UITableView _updateSections:updateAction:withRowAnimation:headerFooterOnly:] + 403
10 ABC 0x0000000106d7b780 -[ABCTimesViewController updateData] + 8288
11 ABC 0x0000000106d79705 -[ABCTimesViewController connectionDidFinishLoading:] + 309
12 CFNetwork 0x000000010be689ae __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 69
13 CFNetwork 0x000000010be68952 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 199
14 CFNetwork 0x000000010be68aa7 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 48
15 CFNetwork 0x000000010bcd6452 ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 104
16 CFNetwork 0x000000010bdc45eb ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 100
17 libdispatch.dylib 0x000000010d51449b _dispatch_client_callout + 8
18 libdispatch.dylib 0x000000010d4f654b _dispatch_block_invoke + 716
19 CFNetwork 0x000000010bcc26f0 _ZN19RunloopBlockContext13_invoke_blockEPKvPv + 24
20 CoreFoundation 0x000000010cae94c4 CFArrayApplyFunction + 68
21 CFNetwork 0x000000010bcc25e9 _ZN19RunloopBlockContext7performEv + 137
22 CFNetwork 0x000000010bcc24a2 _ZN17MultiplexerSource7performEv + 282
23 CFNetwork 0x000000010bcc22c4 _ZN17MultiplexerSource8_performEPv + 72
24 CoreFoundation 0x000000010cb16011 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
25 CoreFoundation 0x000000010cb0bf3c __CFRunLoopDoSources0 + 556
26 CoreFoundation 0x000000010cb0b3f3 __CFRunLoopRun + 867
27 CoreFoundation 0x000000010cb0ae08 CFRunLoopRunSpecific + 488
28 GraphicsServices 0x000000010dc2dad2 GSEventRunModal + 161
29 UIKit 0x00000001083be30d UIApplicationMain + 171
30 ABC 0x0000000106d56cd1 main + 97
31 libdyld.dylib 0x000000010d54892d start + 1
32 ??? 0x0000000000000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

app crash when try get user photo by Facebook iOS Graph API with app-scoped user id

I use Facebook for iOS. I get user's data without problem by Graph Api. From user's data I get app-scoped user id. Then I try get user's picture but application crashed. I tried use [FBRequestConnection startWithGraph:#"/me/picture" ...] and [FBRequestConnection startWithGraph:#"/(app id from user's data)/picture" ...] but still crashed. Why?
2014-06-02 16:16:51.669 testapp[448:60b] -[NSNull dataUsingEncoding:]: unrecognized selector sent to instance 0x19f8068
2014-06-02 16:16:51.679 testapp[448:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull dataUsingEncoding:]: unrecognized selector sent to instance 0x19f8068'
*** First throw call stack:
(
0 CoreFoundation 0x018ac1e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x0162b8e5 objc_exception_throw + 44
2 CoreFoundation 0x01949243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0189c50b ___forwarding___ + 1019
4 CoreFoundation 0x0189c0ee _CF_forwarding_prep_0 + 14
5 testapp 0x00022721 +[FBUtility simpleJSONDecode:error:] + 42
6 testapp 0x0000a75e -[FBRequestConnection parseJSONOrOtherwise:error:] + 69
7 testapp 0x0000a5a0 -[FBRequestConnection parseJSONResponse:error:statusCode:] + 1256
8 testapp 0x00009e04 -[FBRequestConnection completeWithResponse:data:orError:] + 666
9 testapp 0x00007564 __68-[FBRequestConnection startWithCacheIdentity:skipRoundtripIfCached:]_block_invoke + 201
10 testapp 0x00045fbc -[FBURLConnection invokeHandler:error:response:responseData:] + 49
11 testapp 0x00045ec7 -[FBURLConnection logAndInvokeHandler:response:responseData:] + 414
12 testapp 0x00046442 -[FBURLConnection connectionDidFinishLoading:] + 248
13 Foundation 0x013f4e49 ___NSURLConnectionDidFinishLoading_block_invoke + 40
14 Foundation 0x0138b7e1 __65-[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:]_block_invoke + 62
15 Foundation 0x01213f5e -[NSURLConnectionInternalConnection invokeForDelegate:] + 119
16 Foundation 0x01213ec6 -[NSURLConnectionInternal _withConnectionAndDelegate:onlyActive:] + 208
17 Foundation 0x01213dd8 -[NSURLConnectionInternal _withActiveConnectionAndDelegate:] + 76
18 Foundation 0x01214188 _NSURLConnectionDidFinishLoading + 43
19 CFNetwork 0x064aa69f ___ZN27URLConnectionClient_Classic26_delegate_didFinishLoadingEU13block_pointerFvvE_block_invoke + 111
20 CFNetwork 0x064a83de ___ZN27URLConnectionClient_Classic18_withDelegateAsyncEPKcU13block_pointerFvP16_CFURLConnectionPK33CFURLConnectionClientCurrent_VMaxE_block_invoke_2 + 104
21 CoreFoundation 0x0184dc69 CFArrayApplyFunction + 57
22 CFNetwork 0x06411441 _ZN19RunloopBlockContext7performEv + 155
23 CFNetwork 0x064f33f4 _ZThn16_N19RunloopBlockContext24multiplexerClientPerformEv + 20
24 CFNetwork 0x06411257 _ZN17MultiplexerSource7performEv + 299
25 CFNetwork 0x0641106c _ZN17MultiplexerSource8_performEPv + 76
26 CoreFoundation 0x0183577f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
27 CoreFoundation 0x0183510b __CFRunLoopDoSources0 + 235
28 CoreFoundation 0x018521ae __CFRunLoopRun + 910
29 CoreFoundation 0x018519d3 CFRunLoopRunSpecific + 467
30 CoreFoundation 0x018517eb CFRunLoopRunInMode + 123
31 GraphicsServices 0x038a05ee GSEventRunModal + 192
32 GraphicsServices 0x038a042b GSEventRun + 104
33 UIKit 0x002ebf9b UIApplicationMain + 1225
34 testapp 0x00003b2d main + 141
35 libdyld.dylib 0x01ef3701 start + 1
36 ??? 0x00000001 0x0 + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Thanks!
I guess this is because you don't handle the http redirect Facebook is sending if you query /me/picture. If you just want the URL of the picture, use /me/picture?redirect=false as stated in the docs: https://developers.facebook.com/docs/graph-api/reference/v2.0/user/picture/#read
Otherwise add some code to handle http redirects.
I resolved my problem. I send redirect parameter like Bool. When I change to string it begin working.
Thanks.

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