Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-2317

Contact Picker crashes when selecting an email

    Details

      Description

      {html}<div><p>Using the following code:</p>
      <pre>
      <code> Ti.Contacts.showContacts({
      fields: ['email'],
      selectedProperty: function(e) { Ti.API.info('property selected'); }
      });</code>
      </pre>
      <p>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:</p>
      <pre>
      <code>[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'</code>
      </pre>
      <p>I also tried using the selectedPerson callback:</p>
      <pre>
      <code> Ti.Contacts.showContacts({
      selectedPerson: function(e) { var person = e.person; var emails = person.email; }
      });</code>
      </pre>
      <p>But that crashed as well with a different error:</p>
      <pre>
      <code>[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'</code>
      </pre></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              stephentramer Stephen Tramer
              Reporter:
              dcpedit dcpedit
            • Watchers:
              0 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  TIMOB-2032
                  Sync status:
                  ERROR
                  Last received:
                  Last sent:

                  Git Integration