Hi, I'm seeing a problem with TableViewStyle. I basically have a heavyweight window that I'm tabbing into. Inside the heavyweight window is the file, where I just cut and pasted from the kitchensink's table_view_section_header.js
var win = Titanium.UI.currentWindow var inputData = [ {title:'row 1', header:'Header 1'}, {title:'row 2'}, {title:'row 3'}, {title:'row 4', header:'Header 2'}, {title:'row 5'} ]; var tableView = Titanium.UI.createTableView({ data:inputData, style:Titanium.UI.iPhone.TableViewStyle.GROUPED }); win.add(tableView);However, that gives me the error: Result of expression 'Titanium.UI.iPhone.TableViewStyle [undefined] is not an object. at settings.js'. I don't think I'm spelling things wrong
And while I've seen previous questions, the solutions offered up don't seem to work. I've tried cleaning and building, etc.
Also, when I remove the style attribute, it compiles, which means that Titanium.UI is at least available.
Anyone run into this before?
5 Answers
Try going to your project root folder, then to "build/iphone/" and deleting the entire folder. Then, just simply run it on a device/simulator and it should work.
Whenever I have gotten that error (Usually when trying to use SystemButtons) I just have to do that and it'll work fine after I do a fresh re-build.
I ended up just hardcoding it to the number "1" for the time being. It's not ideal, esp if appcelerator decides to change things around for no reason.
var tableView = Titanium.UI.createTableView({ data:inputData, style:1 });If you've got a solution, I'd like to hear it.
What version of the SDK are you using? 1.4.1.1? A daily build? What device are you targeting? I tried your code in 1.4.1.1 and the 1.5 daily and it worked for me but I was specifically targeting iPad.
I second the recommendation to clean.
This happened to me when I installed the app on an iPhone with an older version 4.2 of iOS then I was testing with (4.3)
Cleaning the project fixed this.
I got the same error when creating a table view. I am using SDK 1.7.5, iPhone simulator. I went to the Project menu, and hit Clean, then selected my project. The next time I ran the app it ran cleanly, so that fixed the problem.
Your Answer
Think you can help? Login to answer this question!