Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

JS Warning for Read Only attribute

Hey guys,

this line:

parent = Ti.Filesystem.getresourcesDirectory();

produces this error:

[WARN] JavaScript compiler reported "Read only." at app.js:18

Why? It's more of an annoyance because my app is working fine, but I'd really like to know why and how to fix it.

Any ideas? Thx!

— asked December 2nd 2010 by Kelly Redd
  • ipad
  • js
  • mobile
  • only
  • read
0 Comments

2 Answers

  • maybe should be

    parent = Ti.Filesystem.resourcesDirectory();
    

    or

    parent = Ti.Filesystem.getResourcesDirectory();
    

    ( capital R) ?

    — answered December 2nd 2010 by Dan Tamas
    permalink
    0 Comments
  • Thanks Tamas, changing the r to R didn't work but it got me thinking and I changed my variable name. Apparently my 'parent' variable was conflicting with a lower-level Ti variable. As soon as I renamed my var the warning went away.

    Much thanks

    — answered December 2nd 2010 by Kelly Redd
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.