Terminating app due to uncaught exception error - uitextfield

The app is supposed to save data in Text Fields when I click return on the keyboard. The app crashes when I click the return key. I have connected the IBActions to the textfields with "Did End on Exit" in .xib". Here is the error log:
Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSPlaceholderString initWithFormat:locale:arguments:]: nil argument'
*** First throw call stack:
(
0 CoreFoundation 0x0173b5e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x014be8b6 objc_exception_throw + 44
2 CoreFoundation 0x0173b3bb +[NSException raise:format:] + 139
3 Foundation 0x010da664 -[NSPlaceholderString initWithFormat:locale:arguments:] + 99
4 Foundation 0x010da5f4 -[NSString initWithFormat:] + 58
5 Attendance 0x00002ded -[ShiftAController1 saveRoster1:] + 157
6 libobjc.A.dylib 0x014d081f -[NSObject performSelector:withObject:] + 70
7 UIKit 0x0022e0c2 -[UIApplication sendAction:to:from:forEvent:] + 108
8 UIKit 0x0022e04e -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
9 UIKit 0x003260c1 -[UIControl sendAction:to:forEvent:] + 66
10 UIKit 0x00326484 -[UIControl _sendActionsForEvents:withEvent:] + 577
11 UIKit 0x0032da28 -[UIFieldEditor insertText:] + 263
12 UIKit 0x0091771f -[UITextField insertText:] + 59
13 UIKit 0x00409b40 -[UIKeyboardImpl insertText:] + 87
14 UIKit 0x0041af14 -[TIKeyboardOperationInsertText(UIKeyboardImpl) main] + 83
15 Foundation 0x01193829 -[__NSOperationInternal _start:] + 671
16 Foundation 0x01110558 -[NSOperation start] + 83
17 UIKit 0x004081cd -[UIKeyboardImpl performOperations:] + 153
18 UIKit 0x0040640b -[UIKeyboardImpl continueHandleKeyboardInputWithOperations:] + 40
19 UIKit 0x0040627c __73-[UIKeyboardImpl replyHandlerForHandleKeyboardInputWithExecutionContext:]_block_invoke_2 + 44
20 UIKit 0x0093b3c8 -[UIKeyboardTaskQueue continueExecutionOnMainThread] + 402
21 libobjc.A.dylib 0x014d081f -[NSObject performSelector:withObject:] + 70
22 Foundation 0x011139d8 __NSThreadPerformPerform + 285
23 CoreFoundation 0x016c483f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
24 CoreFoundation 0x016c41cb __CFRunLoopDoSources0 + 235
25 CoreFoundation 0x016e129e __CFRunLoopRun + 910
26 CoreFoundation 0x016e0ac3 CFRunLoopRunSpecific + 467
27 CoreFoundation 0x016e08db CFRunLoopRunInMode + 123
28 GraphicsServices 0x036e09e2 GSEventRunModal + 192
29 GraphicsServices 0x036e0809 GSEventRun + 104
30 UIKit 0x0022cd3b UIApplicationMain + 1225
31 Attendance 0x00003a1d main + 141
32 libdyld.dylib 0x01d7970d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
This is my code in .m:
-(IBAction)saveRoster1:(id)sender{
myString1 = [[NSString alloc] initWithFormat:roster1.text];
[roster1 setText:myString1];
NSUserDefaults *stringDefault1 = [NSUserDefaults standardUserDefaults];
[stringDefault1 setObject:myString1 forKey:#"stringKey1"];}
-(IBAction)savetimeIn:(id)sender{
myString2 = [[NSString alloc] initWithFormat:timeIn.text];
[timeIn setText:myString2];
NSUserDefaults *stringDefault2 = [NSUserDefaults standardUserDefaults];
[stringDefault2 setObject:myString2 forKey:#"stringKey2"];}
-(IBAction)savetimeOut:(id)sender{
myString3 = [[NSString alloc] initWithFormat:timeOut.text];
[timeOut setText:myString3];
NSUserDefaults *stringDefault3 = [NSUserDefaults standardUserDefaults];
[stringDefault3 setObject:myString3 forKey:#"stringKey3"];}

Related

Error while Launching saying NSInternalInconsistencyException

Need help. receiving below error while launching the application
Objective-C exception thrown. Name: NSInternalInconsistencyException Reason: Application windows are expected to have a root view controller at the end of application launch
Native stack trace:
0 CoreFoundation 0x00000001160421e6 exceptionPreprocess + 294
1 libobjc.A.dylib 0x0000000116fdf031 objc_exception_throw + 48
2 CoreFoundation 0x0000000116047472 +[NSException raise:format:arguments:] + 98
3 Foundation 0x0000000114f7b652 -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 193
4 UIKit 0x0000000112d1bb96 -[UIApplication _runWithMainScene:transitionContext:completion:] + 3064
5 UIKit 0x00000001130dde4a __111-[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:]_block_invoke + 866
6 UIKit 0x00000001134b0909 +[_UICanvas _enqueuePostSettingUpdateTransactionBlock:] + 153
7 UIKit 0x00000001130dda86 -[__UICanvasLifecycleMonitor_Compatability _scheduleFirstCommitForScene:transition:firstActivation:completion:] + 236
8 UIKit 0x00000001130de2a7 -[__UICanvasLifecycleMonitor_Compatability activateEventsOnly:withContext:completion:] + 675
9 UIKit 0x0000000113a4f4d4 __82-[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:]_block_invoke + 299
10 UIKit 0x0000000113a4f36e -[_UIApplicationCanvas _transitionLifecycleStateWithTransitionContext:completion:] + 433
11 UIKit 0x000000011373362d __125-[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:]_block_invoke + 221
12 UIKit 0x000000011392e387 _performActionsWithDelayForTransitionContext + 100
13 UIKit 0x00000001137334f7 -[_UICanvasLifecycleSettingsDiffAction performActionsForCanvas:withUpdatedScene:settingsDiff:fromSettings:transitionContext:] + 223
14 UIKit 0x00000001134affb0 -[_UICanvas scene:didUpdateWithDiff:transitionContext:completion:] + 392
15 UIKit 0x0000000112d19f0c -[UIApplication workspace:didCreateScene:withTransitionContext:completion:] + 515
16 UIKit 0x00000001132eca97 -[UIApplicationSceneClientAgent scene:didInitializeWithEvent:completion:] + 361
17 FrontBoardServices 0x000000011d9c32f3 -[FBSSceneImpl _didCreateWithTransitionContext:completion:] + 331
18 FrontBoardServices 0x000000011d9cbcfa __56-[FBSWorkspace client:handleCreateScene:withCompletion:]_block_invoke_2 + 225
19 libdispatch.dylib 0x0000000117c74779 _dispatch_client_callout + 8
20 libdispatch.dylib 0x0000000117c79931 _dispatch_block_invoke_direct + 317
21 FrontBoardServices 0x000000011d9f7470 __FBSSERIALQUEUE_IS_CALLING_OUT_TO_A_BLOCK + 24
22 FrontBoardServices 0x000000011d9f712e -[FBSSerialQueue _performNext] + 439
23 FrontBoardServices 0x000000011d9f768e -[FBSSerialQueue _performNextFromRunLoopSource] + 45
24 CoreFoundation 0x0000000115fe4bb1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 17
25 CoreFoundation 0x0000000115fc94af __CFRunLoopDoSources0 + 271
26 CoreFoundation 0x0000000115fc8a6f __CFRunLoopRun + 1263
27 CoreFoundation 0x0000000115fc830b CFRunLoopRunSpecific + 635
28 GraphicsServices 0x0000000119779a73 GSEventRunModal + 62
29 UIKit 0x0000000112d1d0b7 UIApplicationMain + 159
30 ??? 0x000000013437347e 0x0 + 5171000446
31 ??? 0x0000000134373213 0x0 + 5170999827
Application windows are expected to have a root view controller at the end of application
It seems that you didn't set the RootViewController.It worked fine in old version.But in the new version ,you should set it in AppDelegate
public override bool FinishedLaunching (UIApplication application, NSDictionary launchOptions)
{
// Override point for customization after application launch.
// If not required for your application you can safely delete this method
var indexVC = new XXXViewController ();//your viewcontroller
Window = new UIWindow ((CGRect)UIScreen.MainScreen.Bounds);
Window .RootViewController = indexVC;
Window .MakeKeyAndVisible ();
return true;
}

UIPopoverController iOS 8 crash.

I receive a frequent crash log of this in my application and it happens only in iOS8.
I've done a few testing, but it seems working alright in simulator.
Thread : Crashed: com.apple.main-thread
0 libobjc.A.dylib 0x38ccaf46 objc_msgSend + 5
1 UIKit 0x2ea813e9 -[UIPresentationController runTransitionForCurrentState] + 444
2 UIKit 0x2ea966bb -[UIViewController _presentViewController:presentationController:animationController:interactionController:completion:] + 822
3 UIKit 0x2ea9764f -[UIViewController _presentViewController:withAnimationController:completion:] + 2850
4 UIKit 0x2ea9915b __62-[UIViewController presentViewController:animated:completion:]_block_invoke + 258
5 UIKit 0x2e895d93 -[UIViewController presentViewController:animated:completion:] + 194
6 UIKit 0x2ed82add -[UIPopoverController _presentShimmedPopoverFromRect:inView:permittedArrowDirections:animated:] + 188
7 UIKit 0x2ed82c75 -[UIPopoverController presentPopoverFromRect:inView:permittedArrowDirections:animated:] + 276
8 AppName 0x001f41db -[ViewController selectDate:] (ViewController.m:1019)
9 UIKit 0x2e7e6d4b -[UIApplication sendAction:to:from:forEvent:] + 70
10 UIKit 0x2e7e6cf1 -[UIControl sendAction:to:forEvent:] + 44
11 UIKit 0x2e7d196b -[UIControl _sendActionsForEvents:withEvent:] + 582
12 UIKit 0x2e7e675d -[UIControl touchesEnded:withEvent:] + 588
13 UIKit 0x2e7e6437 -[UIWindow _sendTouchesForEvent:] + 522
14 UIKit 0x2e7dfcf9 -[UIWindow sendEvent:] + 544
15 UIKit 0x2e7b657d -[UIApplication sendEvent:] + 196
16 AppName 0x0030df93 -[IdleTimeCheck sendEvent:] (IdleTimeCheck.m:23)
17 UIKit 0x2ea29df9 _UIApplicationHandleEventFromQueueEvent + 13888
18 UIKit 0x2e7b4fd1 _UIApplicationHandleEventQueue + 1296
19 CoreFoundation 0x2b2de58f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14
20 CoreFoundation 0x2b2dd99f __CFRunLoopDoSources0 + 218
21 CoreFoundation 0x2b2dc005 __CFRunLoopRun + 772
22 CoreFoundation 0x2b22a621 CFRunLoopRunSpecific + 476
23 CoreFoundation 0x2b22a433 CFRunLoopRunInMode + 106
24 GraphicsServices 0x325b00a9 GSEventRunModal + 136
25 UIKit 0x2e815359 UIApplicationMain + 1440
26 AppName 0x0008f9d5 main (main.m:22)
The code for presenting it is somewhat like this.
- (void) selectDate:(UIButton *)button
{
SelectStartEndDate *selectStartEndDate = [[SelectStartEndDate alloc] initWithNibName:#"SelectStartEndDate" bundle:[NSBundle mainBundle]];
selectStartEndDate.delegate = self;
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:selectStartEndDate];
selectDate = [[UIPopoverController alloc] initWithContentViewController:navController];
selectDate.popoverContentSize = CGSizeMake(320, 208 + 44);
[selectDate presentPopoverFromRect:button.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionLeft animated:YES];
selectDate.delegate = self;
}
Thanks!

Xcode Storyboard - UITableViewCell UISwitch Value Changed

I have am using Xcode storyboards and have a View Controller that has a UITableView which in turn has a custom UITableViewCell.
The UITableViewCell has a UISwitch in it and I want to know when the value has changed. I have a IBAction that successfully fires when the value is changed
- (IBAction)updateSwitchAtIndexPath:(NSIndexPath *)indexPath
{
NSLog(#"In SettingsViewcontroller updateSwitchAtIndexPath row=|%d \n", indexPath.row);
}
However when it fires the app terminates
2014-07-10 23:38:10.037 reactor[2572:60b] -[UISwitch row]: unrecognized selector sent to instance 0x944b7e0
2014-07-10 23:38:10.072 reactor[2572:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UISwitch row]: unrecognized selector sent to instance 0x944b7e0'
*** First throw call stack:
(
0 CoreFoundation 0x01a281e4 __exceptionPreprocess + 180
1 libobjc.A.dylib 0x015758e5 objc_exception_throw + 44
2 CoreFoundation 0x01ac5243 -[NSObject(NSObject) doesNotRecognizeSelector:] + 275
3 CoreFoundation 0x01a1850b ___forwarding___ + 1019
4 CoreFoundation 0x01a180ee _CF_forwarding_prep_0 + 14
5 positivity 0x00003807 -[SettingsViewController updateSwitchAtIndexPath:] + 87
6 libobjc.A.dylib 0x0158782b -[NSObject performSelector:withObject:] + 70
7 UIKit 0x002373b9 -[UIApplication sendAction:to:from:forEvent:] + 108
8 UIKit 0x00237345 -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 61
9 UIKit 0x00338bd1 -[UIControl sendAction:to:forEvent:] + 66
10 UIKit 0x00338fc6 -[UIControl _sendActionsForEvents:withEvent:] + 577
11 UIKit 0x004c97a5 __31-[UISwitch _handleLongPressNL:]_block_invoke + 85
12 UIKit 0x004c8666 -[_UISwitchInternalViewNeueStyle1 _setPressed:on:animated:shouldAnimateLabels:completion:] + 243
13 UIKit 0x004c9681 -[UISwitch _handleLongPressNL:] + 286
14 UIKit 0x005d14f4 _UIGestureRecognizerSendActions + 230
15 UIKit 0x005d0168 -[UIGestureRecognizer _updateGestureWithEvent:buttonEvent:] + 383
16 UIKit 0x005d1bdd -[UIGestureRecognizer _delayedUpdateGesture] + 60
17 UIKit 0x005d513d ___UIGestureRecognizerUpdate_block_invoke + 57
18 UIKit 0x005d50be _UIGestureRecognizerRemoveObjectsFromArrayAndApplyBlocks + 317
19 UIKit 0x005cb7ac _UIGestureRecognizerUpdate + 199
20 UIKit 0x00276a5a -[UIWindow _sendGesturesForEvent:] + 1291
21 UIKit 0x00277971 -[UIWindow sendEvent:] + 1021
22 UIKit 0x002495f2 -[UIApplication sendEvent:] + 242
23 UIKit 0x00233353 _UIApplicationHandleEventQueue + 11455
24 CoreFoundation 0x019b177f __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 15
25 CoreFoundation 0x019b110b __CFRunLoopDoSources0 + 235
26 CoreFoundation 0x019ce1ae __CFRunLoopRun + 910
27 CoreFoundation 0x019cd9d3 CFRunLoopRunSpecific + 467
28 CoreFoundation 0x019cd7eb CFRunLoopRunInMode + 123
29 GraphicsServices 0x03a1c5ee GSEventRunModal + 192
30 GraphicsServices 0x03a1c42b GSEventRun + 104
31 UIKit 0x00235f9b UIApplicationMain + 1225
32 positivity 0x00005dbd main + 141
33 libdyld.dylib 0x0206f701 start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException
Any help would be greatly appreciated
UISwitch does not have a property called "row." The way your IBOutlet is set up, you will actually get an UISwitch object as a parameter instead of NSIndexPath.
The better thing to do here is to use the delegate pattern. That way, the custom cell can notify the UIViewController (containing the UITableView) that the switch has been pressed.
So it would be more like:
- (IBAction)updateSwitchAtIndexPath:(UISwitch *)mySwitch
{
// notify the delegate about the switch update
if ([self.delegate respondsToSelector:#selector(switchWasPressed:)]) {
[self.delegate switchWasPressed:mySwitch];
}
}

application terminating due to an uncaught exception , when using :(id) sender on an IBAction

I have an application that is using a modal view that has some buttons on it. When I press a button I am calling the following function:
-(IBAction)iconWasSelected:(id) sender
{
NSLog(#"icon button was pressed");
[self dismissModalViewControllerAnimated:YES];
}
If I remove the :(id) sender; it works just fine, but I am trying to get the object that is triggering the function.
This is the error its "vomiting":
2011-03-11 22:59:55.793 app[14107:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[IconPickerViewController iconWasSelected]: unrecognized selector sent to instance 0x800bbf0'
*** Call stack at first throw:
(
0 CoreFoundation 0x01629be9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0177e5c2 objc_exception_throw + 47
2 CoreFoundation 0x0162b6fb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x0159b366 ___forwarding___ + 966
4 CoreFoundation 0x0159af22 _CF_forwarding_prep_0 + 50
5 UIKit 0x0053da6e -[UIApplication sendAction:to:from:forEvent:] + 119
6 UIKit 0x005cc1b5 -[UIControl sendAction:to:forEvent:] + 67
7 UIKit 0x005ce647 -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527
8 UIKit 0x005cd1f4 -[UIControl touchesEnded:withEvent:] + 458
9 UIKit 0x005620d1 -[UIWindow _sendTouchesForEvent:] + 567
10 UIKit 0x0054337a -[UIApplication sendEvent:] + 447
11 UIKit 0x00548732 _UIApplicationHandleEvent + 7576
12 GraphicsServices 0x01ce4a36 PurpleEventCallback + 1550
13 CoreFoundation 0x0160b064 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
14 CoreFoundation 0x0156b6f7 __CFRunLoopDoSource1 + 215
15 CoreFoundation 0x01568983 __CFRunLoopRun + 979
16 CoreFoundation 0x01568240 CFRunLoopRunSpecific + 208
17 CoreFoundation 0x01568161 CFRunLoopRunInMode + 97
18 GraphicsServices 0x01ce3268 GSEventRunModal + 217
19 GraphicsServices 0x01ce332d GSEventRun + 115
20 UIKit 0x0054c42e UIApplicationMain + 1160
21 naggy 0x00002298 main + 102
22 naggy 0x00002229 start + 53
)
terminate called after throwing an instance of 'NSException'
Any clues?!! Help and Thanks!!
If you're calling the method programmatically, then make sure you set the action correctly. For example, this will work when (id)sender is present:
UIBarButtonItem *newButton = [[UIBarButtonItem alloc] initWithTitle:#"CLICK ME"
style:UIBarButtonItemStyleBordered
target:self
action:#selector(iconWasSelected:)];
and this will work when (id)sender is not present:
UIBarButtonItem *newButton = [[UIBarButtonItem alloc] initWithTitle:#"CLICK ME"
style:UIBarButtonItemStyleBordered
target:self
action:#selector(iconWasSelected)];
Notice the only difference in the code is the colon!

One line keeps crashing, I think it could be something to do with CFDictionary but not sure. Please help

I have a line of code that keeps crashing
NSArray* address = [NSArray arrayWithArray:[[[access.filteredResults objectAtIndex:[indexPath row]] addressArray] objectAtIndex:0]];
I debugged it and I discovered that addressArray is the culprit.
It's defined in a class called ABContact (created by Erica Sadun, author of Developer Cookbook)
#property (nonatomic, readonly) NSArray *addressArray;
The implementation file has
- (NSArray *) addressArray {return [self arrayForProperty:kABPersonAddressProperty];}
The error message that I get is
-[__NSCFDictionary getObjects:range:]: unrecognized selector sent to instance 0x18aeb0
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary getObjects:range:]: unrecognized selector sent to instance 0x18aeb0'
*** Call stack at first throw:
(
0 CoreFoundation 0x3284b987 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x31aca49d objc_exception_throw + 24
2 CoreFoundation 0x3284d133 -[NSObject(NSObject) doesNotRecognizeSelector:] + 102
3 CoreFoundation 0x327f4aa9 ___forwarding___ + 508
4 CoreFoundation 0x327f4860 _CF_forwarding_prep_0 + 48
5 CoreFoundation 0x327dc325 -[NSArray initWithArray:range:copyItems:] + 372
6 CoreFoundation 0x327e94d3 +[NSArray arrayWithArray:] + 62
7 ContactMapper 0x00003c17 -[RootViewController tableView:cellForRowAtIndexPath:] + 1110
8 UIKit 0x32c46a21 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] + 516
9 UIKit 0x32c467f3 -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] + 34
10 UIKit 0x32c44d2d -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow:] + 936
11 UIKit 0x32c43edd -[UITableView layoutSubviews] + 140
12 UIKit 0x32bf00cf -[UIView(CALayerDelegate) layoutSublayersOfLayer:] + 26
13 CoreFoundation 0x327e9bbf -[NSObject(NSObject) performSelector:withObject:] + 22
14 QuartzCore 0x3087b685 -[CALayer layoutSublayers] + 120
15 QuartzCore 0x3087b43d CALayerLayoutIfNeeded + 184
16 QuartzCore 0x3089e593 -[CALayer(CALayerPrivate) layoutBelowIfNeeded] + 18
17 UIKit 0x32c1c3f3 -[UIView(Hierarchy) layoutBelowIfNeeded] + 22
18 UIKit 0x32e41cb3 -[UISplitViewController willRotateToInterfaceOrientation:duration:] + 614
19 UIKit 0x32cadc71 -[UIViewController window:willRotateToInterfaceOrientation:duration:] + 540
20 UIKit 0x32ced6b3 -[UIWindow _setRotatableClient:toOrientation:updateStatusBar:duration:force:] + 1158
21 UIKit 0x32caef5f -[UIWindow _setRotatableViewOrientation:duration:force:] + 54
22 UIKit 0x32c27007 -[UIWindow _updateToInterfaceOrientation:duration:force:] + 74
23 UIKit 0x32c26f81 -[UIWindow _updateInterfaceOrientationFromDeviceOrientation:] + 112
24 UIKit 0x32c26ead -[UIWindow _handleDeviceOrientationChange:] + 88
25 Foundation 0x320f1623 _nsnote_callback + 142
26 CoreFoundation 0x327d2123 __CFXNotificationPost_old + 402
27 CoreFoundation 0x327d1dc3 _CFXNotificationPostNotification + 118
28 Foundation 0x320e0d23 -[NSNotificationCenter postNotificationName:object:userInfo:] + 70
29 UIKit 0x32bf0819 -[UIDevice setOrientation:animated:] + 144
30 UIKit 0x32c152ff -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 438
31 UIKit 0x32be148b -[UIApplication handleEvent:withNewEvent:] + 1114
32 UIKit 0x32be0ec9 -[UIApplication sendEvent:] + 44
33 UIKit 0x32be0907 _UIApplicationHandleEvent + 5090
34 GraphicsServices 0x3094af03 PurpleEventCallback + 666
35 CoreFoundation 0x327e06ff __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 26
36 CoreFoundation 0x327e06c3 __CFRunLoopDoSource1 + 166
37 CoreFoundation 0x327d2f7d __CFRunLoopRun + 520
38 CoreFoundation 0x327d2c87 CFRunLoopRunSpecific + 230
39 CoreFoundation 0x327d2b8f CFRunLoopRunInMode + 58
40 UIKit 0x32c14309 -[UIApplication _run] + 380
41 UIKit 0x32c11e93 UIApplicationMain + 670
42 ContactMapper 0x00002b67 main + 70
43 ContactMapper 0x00002b1c start + 40
I'm not sure how to fix it?
access.filteredResults is an NSArray
It might be how AddressBook data is handled (CFDictionary vs NSArray or NSDictionary). I've spent 15 hours and I'm stuck. Any help would be appreciated.
Nope. NSCFDictionary has nothing to do with your problem.
Your problem is that you have under-retained or over-released an array object, and that object died, and another object (in this case, it was a dictionary, but it could have been anything) got allocated at the same address. Your code is trying to create an array with the old object, but ends up passing the dictionary that has succeeded it instead.
You need to find out where you are unduly releasing or failing to retain the value of addressArray.
It may help to run your app under the Zombies instrument, whose very purpose is debugging an application that prematurely releases or fails to retain an object.

Resources