Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4532108
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T13:59:16+00:00 2026-05-21T13:59:16+00:00

Greetings, I have been working on a custom namespace in appcelerator but have run

  • 0

Greetings,

I have been working on a custom namespace in appcelerator but have run into a problem updating global namespace variables from within certain Titanium objects.

I have a wrapper called “myObj“, and inside of myObj is another object called “globals” which contains variables that are set and used throughout the namespace.

myObj.globals = {
    userBalance: null,
    userAuthenticated: false,
    deviceGeoActive: false
}

So I’ve created a custom wrapper for the geolocation module and inside of that wrapper is the standard Ti.Geolocation.getCurrentPosition(e) function and some custom stuff to be used with the app.

Inside of the Ti.Geolocation.getCurrent…(e) I check to see if location service is available on the device and has been authorized for the app. Then I want to update the deviceGeoActive object property in myObj.

Ti.Geolocation.getCurrent...(e){
    if (e.success){
        myObj.globals.deviceGeoActive = true
    }
}

This way I’ll be able to check if the device is Geo enabled anywhere, anytime.

Why I believe it’s failing (and this is a guess, I’m fairly new at javascipt) is because Ti is outside of the myObj namespace and therefore cant access it in this way.

Can anybody point me in the proper direction?

Thanks,

Josey

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T13:59:17+00:00Added an answer on May 21, 2026 at 1:59 pm

    Thanks @Khez for helping get me to this point!

    The only solution I can think of is to do window.myObj in both cases to ensure proper scope. Let me know of the outcome of this – @khez

    Titanium Appcelerator doesn’t work inside of the window namespace but your suggestion did make me think to add myObj to the global Ti (or Titanium) namespace.

    So in the beginning I had this:

    var myObj = {}
    

    But myObj was being ignored by Ti.

    To add it to the global Titanium namespace I modified it like so:

    Ti.myObj = {}
    myObj = Ti.myObj;
    

    This way any calls to myObj remain don’t have to be changed to reference Ti.

    This means that myObj is now a child of the parent (global) Ti namespace.

    Thanks again Khez

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings, I have been into iOS for only 1.5 months now and I hope
Greetings. I'm just getting started with the boost::asio library and have run into some
Greetings collective, I am new to Cocoa and have been tasked with working on
Greetings , I am a new developer in BlackBerry Application. I have been working
Greetings! I have been tasked to create a report off files we receive from
Greetings, Well I am bewildered. I have been tasked with updating a PHP script
Greetings, Until now I have mostly been working with google maps v2. I am
Greetings. I have been looking at Literate Programming a bit now, and I do
Greetings, I have a particular object which can be constructed from a file, as
Greetings, I've been working on a C#.NET app that interacts with a data logger.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.