Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-4590

chooseContact in CDVContacts crashes app

    XMLWordPrintableJSON

Details

    Description

      Using Cordova 2.9:

      In chooseContact I send the option in JS:

      var contactOptions =

      {allowsEditing: false}

      ;

      with the chooseContacts call, which then causes on line 194 in CDVContacts:

      pickerController.allowsEditing = (BOOL)[options existsValue : @"true" forKey : @"allowsEditing"];

      To crash. When you put a breakpoint in to check the options dictionary it comes back with

      { allowsEditing = 0; }

      and the crash in the logs from this line is:

      -[__NSCFBoolean compare:options:]: unrecognized selector sent to instance 0x3ab59528
      2013-08-15 10:46:50.081 in uncaughtExceptionHandler
      2013-08-15 10:46:50.082 *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFBoolean compare:options:]: unrecognized selector sent to instance 0x3ab59528' First throw call stack:
      (0x327ef3e7 0x3a4ea963 0x327f2f31 0x327f164d 0x32749208 0xc1071 0xc33f7 0x11584d 0x1150e1 0x114cd7 0x114e63 0x114d8d 0x331074a1 0x327c48f7 0x327c415d 0x327c2f2f 0x3273623d 0x327360c9 0x3631533b 0x346522b9 0x5cdf9 0x5cdd0)
      libc++abi.dylib: terminate called throwing an exception

      If I comment the line out, the code executes with no crashes and I receive the contact viewController, can select a contact and return back successfully with the contacts data.

      UPDATE: Contact I receive back (when that line is commented out) is a different contact than the one I selected. The contact I receive exists in my contacts though, but for example I choose "Chelsea" it brings back "Corey", both are in my contacts, just different contact than anticipated.

      UPDATE (again): Reason why I was getting the above results is because I was trying to filter with their id to find the contact afterwards. I understand that the chooseContact method returns both (id, contact), but this is also broken. When I print out the contact object in JS, I receive the following:
      Contact

      {"id":56,"rawId":null,"displayName":null,"name":null,"nickname":null,"phoneNumbers":null,"emails":null,"addresses":null,"ims":null,"organizations":null,"birthday":null,"note":null,"photos":null,"categories":null,"urls":null}

      Attachments

        Issue Links

          Activity

            People

              shazron Shazron Abdullah
              drm75 Daniel Morgan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: