title: Titanium not load menu and menuItem visible/not visible
body: <p>I have two problems with the menu.
  The menu is created by .xml file.</p>
  
  <p>example:</p>
  
  <pre><code>&lt;Menu&gt;
  &lt;MenuItem id = "search" onclick = "search" /&gt;
  &lt;MenuItem id = "add" onclick = "add" /&gt;
  &lt;/ Menu&gt;
  </code></pre>
  
  <p>1) The first problem is that sometimes strangely the menu is not loaded, that is, do not see the buttons.
  Can you tell me why.</p>
  
  <p>2) The second problem is that I have a menuItem field normally not visible, only determiate conditions in the field will have to be visible.
  Could you tell me how I can have access to the field.</p>
  
  <p>.xml</p>
  
  <pre><code>&lt;MenuItem id = "profile" /&gt;
  </code></pre>
  
  <p>.tss</p>
  
  <pre><code>"#profile[platform=android]": {
        title: "Profile",
           icon: "/global/profile.png"
           showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS,
           visible: false
      }
  </code></pre>
  
  <p>.js</p>
  
  <pre><code>$ .profile.visible = True;
  </code></pre>
  
  <p>Error message: Can not set property visible of undefined.</p>
  
  <p>I apologize for my bad English.</p>
  
  <p>Thank you.</p>
  
  <p>Edit:</p>
  
  <p>Example:</p>
  
  <pre><code>         var activity = $ .index.activity;
           activity.onPrepareOptionsMenu = function (e) {
               var favoriteGroup e.menu.add = ({
                   title: "Profile",
                   icon: "/global/profile.png"
                   showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS,
               });
               favoriteGroup.addEventListener ('click', function () {
                  Alloy.createController ("favorite_group", args) .getView (). Open ();
               });
           };
           activity.invalidateOptionsMenu ();
  </code></pre>