ABPeoplePickerNavigationController crashed while presentviewcontroller - ios

Some one help me to fix this crash issue. I am not able to get the root cause of it.
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
[self presentViewController:picker animated:YES completion:nil];
And I am getting the below crash, not sure why,
-[ABPeoplePickerNavigationController masterViewController]: unrecognized selector sent to instance 0xdd8cd40
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[ABPeoplePickerNavigationController masterViewController]: unrecognized selector sent to instance 0xdd8cd40'
*** First throw call stack:
(
0 CoreFoundation 0x03b5e5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x031f28b6 objc_exception_throw + 44
2 CoreFoundation 0x03bfb903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x03b4e90b ___forwarding___ + 1019
4 CoreFoundation 0x03b4e4ee _CF_forwarding_prep_0 + 14
5 UIKit 0x0271f544 -[UISearchDisplayController _areSearchContentsSplitViewMaster] + 63
6 UIKit 0x0271f6ac -[UISearchDisplayController _configureNewSearchBar] + 307
7 UIKit 0x0271ee63 -[UISearchDisplayController initWithSearchBar:contentsController:searchResultsTableViewStyle:] + 121
8 UIKit 0x0271ede5 -[UISearchDisplayController initWithSearchBar:contentsController:] + 55
9 AddressBookUI 0x03dffe5e -[ABMembersController contentView] + 1223
10 AddressBookUI 0x03e05d3e -[ABMembersViewController updateView] + 57
11 AddressBookUI 0x03e058b0 -[ABMembersViewController loadView] + 36
12 UIKit 0x0249d73e -[UIViewController loadViewIfRequired] + 78
13 UIKit 0x024c31a5 -[UINavigationController _layoutViewController:] + 39
14 UIKit 0x024c36bb -[UINavigationController _updateScrollViewFromViewController:toViewController:] + 235
15 UIKit 0x024c37b3 -[UINavigationController _startTransition:fromViewController:toViewController:] + 78
16 UIKit 0x024c472c -[UINavigationController _startDeferredTransitionIfNeeded:] + 645
17 UIKit 0x024c5349 -[UINavigationController __viewWillLayoutSubviews] + 57
18 UIKit 0x025fe39d -[UILayoutContainerView layoutSubviews] + 213
19 UIKit 0x024c1592 __53-[UINavigationController setNeedsDeferredTransition:]_block_invoke + 45
20 UIKit 0x023a6d33 ___afterCACommitHandler_block_invoke + 15
21 UIKit 0x023a6cde _applyBlockToCFArrayCopiedToStack + 403
22 UIKit 0x023a6b0a _afterCACommitHandler + 532
23 CoreFoundation 0x03b2653e __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 30
24 CoreFoundation 0x03b2648f __CFRunLoopDoObservers + 399
25 CoreFoundation 0x03b043b4 __CFRunLoopRun + 1076
26 CoreFoundation 0x03b03b33 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x03b0394b CFRunLoopRunInMode + 123
28 GraphicsServices 0x04df39d7 GSEventRunModal + 192
29 GraphicsServices 0x04df37fe GSEventRun + 104
30 UIKit 0x0238a94b UIApplicationMain + 1225
31 ShowRoomPrive 0x0026dfd5 main + 181
32 ShowRoomPrive 0x00002ba5 start + 53
)
libc++abi.dylib: terminating with uncaught exception of type NSException

use below code i think you had not added delegate and may this help you..
ABPeoplePickerNavigationController *picker =
[[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentViewController:picker animated:YES completion:nil];
or go through this url its will give you step by tutorial how to use it
http://yuvarajmanickam.wordpress.com/2012/09/19/get-contact-number-from-abpeoplepickernavigationcontroller-ios-apps/
or with apple documentation it is show helpfull
https://developer.apple.com/library/ios/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/Chapters/QuickStart.html

Related

Tableview / ScrollView within the UIPageController cause crash while navigating to next Page

I have a UIPageViewController which holds two screens.
self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStyleScroll navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options:nil];
And one of the screen contains tableview on iphone /Collection view on ipad.On some user event we are setting the contentOfset to move the tableview a bit up
[table setContentOffset:cell.frame.origin animated:YES];
Then user navigates to next screen using UIPageviewcontroller
Above usecase causes crash on the app with the following logs
2014-11-14 09:04:46.783 tibbr[12329:79833] *** Assertion failure in -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:], /SourceCache/UIKit_Sim/UIKit-3318.16.14/_UIQueuingScrollView.m:338
2014-11-14 09:04:46.786 tibbr[12329:79833] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Unexpected subviews'
*** First throw call stack:
(
0 CoreFoundation 0x0000000113512f35 __exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000111be7bb7 objc_exception_throw + 45
2 CoreFoundation 0x0000000113512d9a +[NSException raise:format:arguments:] + 106
3 Foundation 0x00000001115c15df -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 195
4 UIKit 0x00000001108715e0 -[_UIQueuingScrollView _setWrappedViewAtIndex:withView:] + 215
5 UIKit 0x0000000110871b0a -[_UIQueuingScrollView _replaceViews:updatingContents:adjustContentInsets:animated:] + 672
6 UIKit 0x0000000110873e57 -[_UIQueuingScrollView setView:direction:animated:completion:] + 524
7 UIKit 0x00000001107d5e16 -[UIPageViewController _setViewControllers:withScrollInDirection:animated:completion:] + 483
8 UIKit 0x00000001107d5f78 -[UIPageViewController setViewControllers:direction:animated:completion:] + 157
12 UIKit 0x000000011024e8be -[UIApplication sendAction:to:from:forEvent:] + 75
13 UIKit 0x0000000110355410 -[UIControl _sendActionsForEvents:withEvent:] + 467
14 UIKit 0x00000001103cf9ea -[UISegmentedControl _setSelectedSegmentIndex:notify:animate:] + 570
15 UIKit 0x00000001103d1a0f -[UISegmentedControl touchesEnded:withEvent:] + 143
16 UIKit 0x00000001105fb540 _UIGestureRecognizerUpdate + 9487
17 UIKit 0x0000000110293ff6 -[UIWindow _sendGesturesForEvent:] + 1041
18 UIKit 0x0000000110294c23 -[UIWindow sendEvent:] + 667
19 UIKit 0x00000001102619b1 -[UIApplication sendEvent:] + 246
20 UIKit 0x000000011026ea7d _UIApplicationHandleEventFromQueueEvent + 17370
21 UIKit 0x000000011024a103 _UIApplicationHandleEventQueue + 1961
22 CoreFoundation 0x0000000113448551 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
23 CoreFoundation 0x000000011343e41d __CFRunLoopDoSources0 + 269
24 CoreFoundation 0x000000011343da54 __CFRunLoopRun + 868
25 CoreFoundation 0x000000011343d486 CFRunLoopRunSpecific + 470
26 GraphicsServices 0x0000000113e859f0 GSEventRunModal + 161
27 UIKit 0x000000011024d420 UIApplicationMain + 1282
28 tibbr 0x000000010cb942d1 tibbr + 58065
29 libdyld.dylib 0x0000000112660145 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Kindly do suggest me what could be root cause of this issue

Crash attempting to set delegate of textfield

I have a lot of textfields and what I am trying to make them do is dismiss when the return key is used. In order for this to work you need to set the delegate of each textfield to self, like this [textfield setDelegate: self];. I have over 50 textfields in my project and in order to make it so they all dismiss I have to copy that line of code for each textfield. In the example below I used a for loop to try to shrink this down, but my project crashes and gives me this error when I try. Can someone tell me what im doing wrong and how i can fix this?
//.h
#interface InsertScheduleCGPS : UIViewController <UITextFieldDelegate>{
NSArray *Dayh;
IBOutlet UITextField *Day11;
}
#property(nonatomic, assign) id<UITextFieldDelegate> delegate;
#property (nonatomic,strong) NSArray *Dayh;
.
//.m
- (void)viewDidLoad
{
[super viewDidLoad];
Dayh = [NSArray arrayWithObjects:#"Day11", nil];
NSLog(#"euf");
for(int i=0; i<[self.Dayh count]; i++) {
NSLog(#"dd%#",[self.Dayh objectAtIndex:i]);
[[self.Dayh objectAtIndex:i] setDelegate: self];
}
- (BOOL)textFieldShouldReturn:(UITextField *)Day11 {
[[self view] endEditing:YES];
return NO;
}
ERROR:
2014-01-18 19:15:26.712 Swepple[64912:70b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString setDelegate:]: unrecognized selector sent to instance 0x144ec'
*** First throw call stack:
(
0 CoreFoundation 0x0183b5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015be8b6 objc_exception_throw + 44
2 CoreFoundation 0x018d8903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x0182b90b ___forwarding___ + 1019
4 CoreFoundation 0x0182b4ee _CF_forwarding_prep_0 + 14
5 Swepple 0x0000bbd6 -[InsertScheduleCGPS viewDidLoad] + 4262
6 UIKit 0x00440318 -[UIViewController loadViewIfRequired] + 696
7 UIKit 0x004405b4 -[UIViewController view] + 35
8 UIKit 0x0044f361 -[UIViewController viewControllerForRotation] + 63
9 UIKit 0x00446f00 -[UIViewController _visibleView] + 84
10 UIKit 0x006d511a -[UIWindowController transition:fromViewController:toViewController:target:didEndSelector:animation:] + 5199
11 UIKit 0x0044c0fc -[UIViewController presentViewController:withTransition:completion:] + 6433
12 UIKit 0x0044c61f -[UIViewController presentViewController:animated:completion:] + 130
13 UIKit 0x0044c65f -[UIViewController presentModalViewController:animated:] + 56
14 UIKit 0x00870e16 -[UIStoryboardModalSegue perform] + 271
15 UIKit 0x0086107e -[UIStoryboardSegueTemplate _perform:] + 174
16 UIKit 0x00442280 -[UIViewController performSegueWithIdentifier:sender:] + 72
17 Swepple 0x000052d4 -[SecondViewController insert:] + 244
18 libobjc.A.dylib 0x015d0874 -[NSObject performSelector:withObject:withObject:] + 77
19 UIKit 0x0032e0c2 -[UIApplication sendAction:to:from:forEvent:] + 108
20 UIKit 0x0032e04e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
21 UIKit 0x004260c1 -[UIControl sendAction:to:forEvent:] + 66
22 UIKit 0x00426484 -[UIControl _sendActionsForEvents:withEvent:] + 577
23 UIKit 0x00425733 -[UIControl touchesEnded:withEvent:] + 641
24 UIKit 0x0036b51d -[UIWindow _sendTouchesForEvent:] + 852
25 UIKit 0x0036c184 -[UIWindow sendEvent:] + 1232
26 UIKit 0x0033fe86 -[UIApplication sendEvent:] + 242
27 UIKit 0x0032a18f _UIApplicationHandleEventQueue + 11421
28 CoreFoundation 0x017c483f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
29 CoreFoundation 0x017c41cb __CFRunLoopDoSources0 + 235
30 CoreFoundation 0x017e129e __CFRunLoopRun + 910
31 CoreFoundation 0x017e0ac3 CFRunLoopRunSpecific + 467
32 CoreFoundation 0x017e08db CFRunLoopRunInMode + 123
33 GraphicsServices 0x037e09e2 GSEventRunModal + 192
34 GraphicsServices 0x037e0809 GSEventRun + 104
35 UIKit 0x0032cd3b UIApplicationMain + 1225
36 Swepple 0x0000e04d main + 141
37 libdyld.dylib 0x01d7c70d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
You probably meant
Dayh = [NSArray arrayWithObjects:Day11, nil];
At present, Dayh is an array containing the string "Day11", not the text field.

Unwind segue issue when navigating back to parent scene

I'm trying to unwind segue form a scene. It works fine but I need to get a value to the parent screen. (I use the push segue to navigate from parent to child scene)
I'm calling the unwind segue like this
- (IBAction)done:(UIStoryboardSegue *)segue {
NSLog(#"gonna navigate");
RESTToppingTableViewController *vc = [segue destinationViewController];
[self setSelectedToppings:[vc toppingList]];
NSLog(#"%#", [vc toppingList]);
}
But the issue is, it seems the toppingList array is removed from memory even before the parent view is called.
Below is the error I got.
2013-12-06 13:26:42.192 Pizza to Go[2319:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[RESTAddToCartViewController toppingList]: unrecognized selector sent to instance 0x9b681a0'
*** First throw call stack:
(
0 CoreFoundation 0x01f405e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x01cc38b6 objc_exception_throw + 44
2 CoreFoundation 0x01fdd903 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01f3090b ___forwarding___ + 1019
4 CoreFoundation 0x01f304ee _CF_forwarding_prep_0 + 14
5 Pizza to Go 0x0004a3a2 -[RESTAddToCartViewController done:] + 130
6 libobjc.A.dylib 0x01cd581f -[NSObject performSelector:withObject:] + 70
7 UIKit 0x010d01f1 -[UIStoryboardUnwindSegueTemplate _perform:] + 536
8 UIKit 0x00f660f9 -[UIStoryboardSegueTemplate perform:] + 115
9 libobjc.A.dylib 0x01cd5874 -[NSObject performSelector:withObject:withObject:] + 77
10 UIKit 0x00a330c2 -[UIApplication sendAction:to:from:forEvent:] + 108
11 UIKit 0x00d07c9b -[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 139
12 libobjc.A.dylib 0x01cd5874 -[NSObject performSelector:withObject:withObject:] + 77
13 UIKit 0x00a330c2 -[UIApplication sendAction:to:from:forEvent:] + 108
14 UIKit 0x00a3304e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
15 UIKit 0x00b2b0c1 -[UIControl sendAction:to:forEvent:] + 66
16 UIKit 0x00b2b484 -[UIControl _sendActionsForEvents:withEvent:] + 577
17 UIKit 0x00b2a733 -[UIControl touchesEnded:withEvent:] + 641
18 UIKit 0x00a7051d -[UIWindow _sendTouchesForEvent:] + 852
19 UIKit 0x00a71184 -[UIWindow sendEvent:] + 1232
20 UIKit 0x00a44e86 -[UIApplication sendEvent:] + 242
21 UIKit 0x00a2f18f _UIApplicationHandleEventQueue + 11421
22 CoreFoundation 0x01ec983f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
23 CoreFoundation 0x01ec91cb __CFRunLoopDoSources0 + 235
24 CoreFoundation 0x01ee629e __CFRunLoopRun + 910
25 CoreFoundation 0x01ee5ac3 CFRunLoopRunSpecific + 467
26 CoreFoundation 0x01ee58db CFRunLoopRunInMode + 123
27 GraphicsServices 0x03e159e2 GSEventRunModal + 192
28 GraphicsServices 0x03e15809 GSEventRun + 104
29 UIKit 0x00a31d3b UIApplicationMain + 1225
30 Pizza to Go 0x000574ad main + 141
31 libdyld.dylib 0x0285e725 start + 0
)
libc++abi.dylib: terminating with uncaught exception of type NSException
What could be the possible fix? thanks for your time in advance.
I'm not sure but I think your destinationViewController isn't a RESTToppingTableViewController.
The log:
-[RESTAddToCartViewController toppingList]:
unrecognized selector sent to instance 0x9b681a0
states that you are trying to get the toppingList of a RESTAddToCartViewController but this controller has no toppingList property.
Make sure that the UIViewController returned by [segue destinationViewController] really is what you are expecting.

Crashing after change the viewController iOS4.3

I wanted to know why I have this crash in my iOS app (deployment target iOS 4.3 - xcode 4).
I tested in iPad simulator 5.0 to 6.1 and worked 100% but in my iPad with iOS 4.3 (well, it's not mine so I can't update the iOS but it's good to practice with old iOS version) crash the app saying this:
2013-02-07 16:07:45.093 GeoRuta[169:707] -[mainViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x331960
2013-02-07 16:07:45.113 GeoRuta[169:707] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[mainViewController presentViewController:animated:completion:]: unrecognized selector sent to instance 0x331960'
*** Call stack at first throw:
(
0 CoreFoundation 0x30f8064f __exceptionPreprocess + 114
1 libobjc.A.dylib 0x32828c5d objc_exception_throw + 24
2 CoreFoundation 0x30f841bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x30f83649 ___forwarding___ + 508
4 CoreFoundation 0x30efa180 _CF_forwarding_prep_0 + 48
5 GeoRuta 0x00003781 -[mainViewController saltarConfiguracion:] + 184
6 CoreFoundation 0x30ef0571 -[NSObject(NSObject) performSelector:withObject:withObject:] + 24
7 UIKit 0x3575eec9 -[UIApplication sendAction:to:from:forEvent:] + 84
8 UIKit 0x3575ee69 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 32
9 UIKit 0x3575ee3b -[UIControl sendAction:to:forEvent:] + 38
10 UIKit 0x3575eb8d -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 356
11 UIKit 0x3575f423 -[UIControl touchesEnded:withEvent:] + 342
12 UIKit 0x3575dbf5 -[UIWindow _sendTouchesForEvent:] + 368
13 UIKit 0x3575d56f -[UIWindow sendEvent:] + 262
14 UIKit 0x35746313 -[UIApplication sendEvent:] + 298
15 UIKit 0x35745c53 _UIApplicationHandleEvent + 5090
16 GraphicsServices 0x31a4de77 PurpleEventCallback + 666
17 CoreFoundation 0x30f57a97 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
18 CoreFoundation 0x30f5983f __CFRunLoopDoSource1 + 166
19 CoreFoundation 0x30f5a60d __CFRunLoopRun + 520
20 CoreFoundation 0x30eeaec3 CFRunLoopRunSpecific + 230
21 CoreFoundation 0x30eeadcb CFRunLoopRunInMode + 58
22 GraphicsServices 0x31a4d41f GSEventRunModal + 114
23 GraphicsServices 0x31a4d4cb GSEventRun + 62
24 UIKit 0x35770d69 -[UIApplication _run] + 404
25 UIKit 0x3576e807 UIApplicationMain + 670
26 GeoRuta 0x000030a9 main + 172
27 GeoRuta 0x00002ff8 start + 40
)
terminate called after throwing an instance of 'NSException'
The selector is:
- (IBAction) saltarConfiguracion: (id)sender
{
configuracionViewController *obj = [[configuracionViewController alloc]initWithNibName:#"configuracionViewController" bundle:nil];
[self presentViewController:obj animated:YES completion:nil];
}
Because [self presentViewController:obj animated:YES completion:nil] is a new iOS 5 methods. You can't use it on iOS 4. Instead, try calling [self presentModalViewController:obj animated:YES] (something like that)

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