[TIMOB-2317] Contact Picker crashes when selecting an email
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-06-23T14:57:23.000+0000 |
Affected Version/s | Release 1.6.0 |
Fix Version/s | Sprint 2011-25, Release 1.7.2 |
Components | iOS |
Labels | address, contacts, crash, defect, email, ios, rplist |
Reporter | dcpedit |
Assignee | Stephen Tramer |
Created | 2011-04-15T03:16:32.000+0000 |
Updated | 2011-07-08T17:10:58.000+0000 |
Description
Using the following code:
Ti.Contacts.showContacts({
fields: ['email'],
selectedProperty: function(e) {
Ti.API.info('property selected');
}
});
This will crash the Contacts Picker if an email is selected when using a physical iphone. I think it has something to do with the fact that that the email labels are all "email" versus on the simulator, they are "home", "work", and "other". Here is the error that appears in the debugger at the time of the crash:
[ERROR] The application has crashed with an unhandled exception. Stack trace:
0 CoreFoundation 0x30897ec1 __exceptionPreprocess + 96
1 libobjc.A.dylib 0x3002f811 objc_exception_throw + 24
2 CoreFoundation 0x308290bd -[__NSArrayI objectAtIndex:] + 160
3 Scratcher 0x00067567 -[ContactsModule peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:] + 354
4 AddressBookUI 0x338a8d97 -[ABPeoplePickerNavigationController personViewController:shouldPerformDefaultActionForPerson:property:identifier:withMemberCell:] + 158
5 AddressBookUI 0x338b1b35 -[ABPersonViewControllerHelper personTableViewDataSource:selectedPropertyAtIndex:inPropertyGroup:withMemberCell:forEditing:] + 228
6 AddressBookUI 0x338c06ab -[ABPersonTableViewDataSource valueAtIndex:selectedForPropertyGroup:withMemberCell:forEditing:] + 46
7 AddressBookUI 0x338bf101 -[ABPersonTableViewDataSource tableView:didSelectRowAtIndexPath:] + 360
8 UIKit 0x31f7ae6f -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 662
9 UIKit 0x31f772af -[UITableView _userSelectRowAtIndexPath:] + 130
10 Foundation 0x349c7e8d __NSFireDelayedPerform + 368
11 CoreFoundation 0x3084e7fb __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
12 CoreFoundation 0x3084e2ad __CFRunLoopDoTimer + 860
13 CoreFoundation 0x3081f7a5 __CFRunLoopRun + 1088
14 CoreFoundation 0x3081f277 CFRunLoopRunSpecific + 230
15 CoreFoundation 0x3081f17f CFRunLoopRunInMode + 58
16 GraphicsServices 0x31e445f3 GSEventRunModal + 114
17 GraphicsServices 0x31e4469f GSEventRun + 62
18 UIKit 0x31e51123 -[UIApplication _run] + 402
19 UIKit 0x31e4f12f UIApplicationMain + 670
20 Scratcher 0x00003c8b main + 42
21 Scratcher 0x0000384c start + 40
2010-11-09 18:34:47.455 Scratcher[383:307] *** Terminating app due to uncaught exception 'NSRangeException', reason: '*** -[NSArray objectAtIndex:]: index 0 beyond bounds for empty array'
*** Call stack at first throw:
(
0 CoreFoundation 0x30897ed3 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3002f811 objc_exception_throw + 24
2 CoreFoundation 0x308290bd -[__NSArrayI objectAtIndex:] + 160
3 Scratcher 0x00067567 -[ContactsModule peoplePickerNavigationController:shouldContinueAfterSelectingPerson:property:identifier:] + 354
4 AddressBookUI 0x338a8d97 -[ABPeoplePickerNavigationController personViewController:shouldPerformDefaultActionForPerson:property:identifier:withMemberCell:] + 158
5 AddressBookUI 0x338b1b35 -[ABPersonViewControllerHelper personTableViewDataSource:selectedPropertyAtIndex:inPropertyGroup:withMemberCell:forEditing:] + 228
6 AddressBookUI 0x338c06ab -[ABPersonTableViewDataSource valueAtIndex:selectedForPropertyGroup:withMemberCell:forEditing:] + 46
7 AddressBookUI 0x338bf101 -[ABPersonTableViewDataSource tableView:didSelectRowAtIndexPath:] + 360
8 UIKit 0x31f7ae6f -[UITableView _selectRowAtIndexPath:animated:scrollPosition:notifyDelegate:] + 662
9 UIKit 0x31f772af -[UITableView _userSelectRowAtIndexPath:] + 130
10 Foundation 0x349c7e8d __NSFireDelayedPerform + 368
11 CoreFoundation 0x3084e7fb __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 14
12 CoreFoundation 0x3084e2ad __CFRunLoopDoTimer + 860
13 CoreFoundation 0x3081f7a5 __CFRunLoopRun + 1088
14 CoreFoundation 0x3081f277 CFRunLoopRunSpecific + 230
15 CoreFoundation 0x3081f17f CFRunLoopRunInMode + 58
16 GraphicsServices 0x31e445f3 GSEventRunModal + 114
17 GraphicsServices 0x31e4469f GSEventRun + 62
18 UIKit 0x31e51123 -[UIApplication _run] + 402
19 UIKit 0x31e4f12f UIApplicationMain + 670
20 Scratcher 0x00003c8b main + 42
21 Scratcher 0x0000384c start + 40
)
terminate called after throwing an instance of 'NSException'
I also tried using the selectedPerson callback:
Ti.Contacts.showContacts({
selectedPerson: function(e) {
var person = e.person;
var emails = person.email;
}
});
But that crashed as well with a different error:
[ERROR] The application has crashed with an unhandled exception. Stack trace:
0 CoreFoundation 0x30897ec1 __exceptionPreprocess + 96
1 libobjc.A.dylib 0x3002f811 objc_exception_throw + 24
2 CoreFoundation 0x30897d15 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x30897d4f +[NSException raise:format:] + 34
4 CoreFoundation 0x3081bbd5 -[__NSCFDictionary setObject:forKey:] + 244
5 Foundation 0x349b9b91 -[NSMutableDictionary(NSKeyValueCoding) setValue:forKey:] + 16
6 Scratcher 0x00056035 -[TiContactsPerson dictionaryFromMultiValue:] + 208
7 Scratcher 0x00056b33 -[TiContactsPerson valueForUndefinedKey:] + 298
8 CoreFoundation 0x308362eb -[NSObject(NSObject) performSelector:withObject:] + 22
9 Foundation 0x349c7825 __NSThreadPerformPerform + 268
10 CoreFoundation 0x3084df25 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
11 CoreFoundation 0x3081fba7 __CFRunLoopDoSources0 + 382
12 CoreFoundation 0x3081f44b __CFRunLoopRun + 230
13 CoreFoundation 0x3081f277 CFRunLoopRunSpecific + 230
14 CoreFoundation 0x3081f17f CFRunLoopRunInMode + 58
15 GraphicsServices 0x31e445f3 GSEventRunModal + 114
16 GraphicsServices 0x31e4469f GSEventRun + 62
17 UIKit 0x31e51123 -[UIApplication _run] + 402
18 UIKit 0x31e4f12f UIApplicationMain + 670
19 Scratcher 0x00003bb7 main + 42
20 Scratcher 0x00003778 start + 40
2010-11-09 20:21:26.424 Scratcher[828:307] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary setObject:forKey:]: attempt to insert nil key'
*** Call stack at first throw:
(
0 CoreFoundation 0x30897ed3 __exceptionPreprocess + 114
1 libobjc.A.dylib 0x3002f811 objc_exception_throw + 24
2 CoreFoundation 0x30897d15 +[NSException raise:format:arguments:] + 68
3 CoreFoundation 0x30897d4f +[NSException raise:format:] + 34
4 CoreFoundation 0x3081bbd5 -[__NSCFDictionary setObject:forKey:] + 244
5 Foundation 0x349b9b91 -[NSMutableDictionary(NSKeyValueCoding) setValue:forKey:] + 16
6 Scratcher 0x00056035 -[TiContactsPerson dictionaryFromMultiValue:] + 208
7 Scratcher 0x00056b33 -[TiContactsPerson valueForUndefinedKey:] + 298
8 CoreFoundation 0x308362eb -[NSObject(NSObject) performSelector:withObject:] + 22
9 Foundation 0x349c7825 __NSThreadPerformPerform + 268
10 CoreFoundation 0x3084df25 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 12
11 CoreFoundation 0x3081fba7 __CFRunLoopDoSources0 + 382
12 CoreFoundation 0x3081f44b __CFRunLoopRun + 230
13 CoreFoundation 0x3081f277 CFRunLoopRunSpecific + 230
14 CoreFoundation 0x3081f17f CFRunLoopRunInMode + 58
15 GraphicsServices 0x31e445f3 GSEventRunModal + 114
16 GraphicsServices 0x31e4469f GSEventRun + 62
17 UIKit 0x31e51123 -[UIApplication _run] + 402
18 UIKit 0x31e4f12f UIApplicationMain + 670
19 Scratcher 0x00003bb7 main + 42
20 Scratcher 0x00003778 start + 40
)
terminate called after throwing an instance of 'NSException'
Attachments
File | Date | Size |
---|---|---|
gmailContactsCrashLog.log | 2011-06-08T08:02:30.000+0000 | 9999 |