Details

      Description

      {html}<div><p>Using 1.5 <a href=
      "http://github.com/appcelerator/titanium_mobile/commit/43358e5f7b4bb194f79e343398f648008b353293">
      continuous build</a> (Dec. 9), I confirm that
      <code>Ti.Contacts.createPerson</code> is undefined for the
      Ti.Contacts namespace. This is a documentation or a functional bug
      to be addressed. Code that should work:</p>
      <pre>
      <code class="javascript">
      var contacts = Ti.Contacts.getPeopleWithName('Johnson');
      var contact = Ti.Contacts.createPerson();
      contact.firstName = 'John';
      contact.lastName = 'Smith';
      contact.phone = {'work':['5555555555']};
      contact.email = {'work':['foo@bar.com']};
      contact.address = {
      'home':[{ street: '555 Happy Drive', city: 'Saint Paul', state: 'MN', postalCode: '55119', country: 'US' }]
      };
      Ti.Contacts.save();
      Ti.API.info('Contact added');</code>
      </pre>
      <p>Produces:</p>
      <pre>
      <code>[TRACE] E/KrollContext( 400): (kroll$1) [127,940] ECMA Error evaluating source: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)
      [TRACE] E/KrollContext( 400): org.mozilla.javascript.EcmaError: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3761)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.constructError(ScriptRuntime.java:3739)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.typeError(ScriptRuntime.java:3767)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.typeError2(ScriptRuntime.java:3786)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.notFunctionError(ScriptRuntime.java:3850)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThisHelper(ScriptRuntime.java:2343)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.getPropFunctionAndThis(ScriptRuntime.java:2310)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:1524)
      [TRACE] E/KrollContext( 400): at script(app://app.js:1)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.Interpreter.interpret(Interpreter.java:854)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:164)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:426)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:3161)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.InterpretedFunction.exec(InterpretedFunction.java:175)
      [TRACE] E/KrollContext( 400): at org.mozilla.javascript.Context.evaluateReader(Context.java:1142)
      [TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.evaluateScript(KrollContext.java:195)
      [TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.handleEvalFile(KrollContext.java:220)
      [TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollContext.handleMessage(KrollContext.java:115)
      [TRACE] E/KrollContext( 400): at android.os.Handler.dispatchMessage(Handler.java:95)
      [TRACE] E/KrollContext( 400): at android.os.Looper.loop(Looper.java:123)
      [TRACE] E/KrollContext( 400): at org.appcelerator.titanium.kroll.KrollHandlerThread.run(KrollHandlerThread.java:73)
      [TRACE] E/TiContext( 400): (kroll$1) [24,964] Rhino Error: app://app.js:1,0
      [TRACE] E/TiContext( 400): (kroll$1) [2,966] Message: TypeError: Cannot find function createPerson in object [Ti.Contacts]. (app://app.js#1)
      [TRACE] E/TiContext( 400): (kroll$1) [1,967] Source: null</code>
      </pre></div>{html}

        Attachments

          Activity

            People

            • Assignee:
              billdawson Bill Dawson
              Reporter:
              kwhinnery Kevin Whinnery
            • Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Integration