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

Hyperloop: iOS - Property returns function instead of string

    Details

    • Type: Bug
    • Status: Reopened
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Hyperloop
    • Environment:

      MacOS, iOS, HomeKit, Appcelerator Studio 5.0.0

      Description

      Instead of strings, I only get functions that produce errors when processing the Hyperloop results. That said: console.log prints the correct value for the unmodified variable. I need to access the string that console.log prints.

      var HMHomeManager = require('HomeKit/HMHomeManager');
      var NSArray = require('Foundation/NSArray');
      	
      var HMHomeManagerDelegate = Hyperloop.defineClass('HMHomeManagerDelegate', 'NSObject'); 
      	
      HMHomeManagerDelegate.addMethod({
      	selector: 'homeManagerDidUpdateHomes:',
      	instance: true,
      	arguments: ['HMHomeManager'],
      	callback: function(sender) {
      		if (this.homeManagerDidUpdateHomes) {
      			this.homeManagerDidUpdateHomes(sender);
      		}
      	}
      });
       
      var HMHome = require('HomeKit/HMHome');		
       
      var delegate = new HMHomeManagerDelegate();
      delegate.homeManagerDidUpdateHomes = function(sender) {
      	
      	var name = sender.primaryHome.name;
      	console.log('name: '+ name);
      	console.log(JSON.stringify({"name":"name","value":name}));
      };
       
      var homeManager = new HMHomeManager();
      homeManager.delegate = delegate;
      

      Prints:

      [INFO] :   name: My Home
      

      Should print:

      [INFO] :   name: My Home
      [INFO] :  {"name":"name","value":"My Home"}
      

        Attachments

          Activity

            People

            • Assignee:
              jvennemann Jan Vennemann
              Reporter:
              aschräder Andreas Schräder
            • Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

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

                  Git Source Code