Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No config.adapter.idAttribute specified for table "books" in Titanium Appcelerator

Tags:

appcelerator

I am new very new to appcelerator. And while following quick start guide, I cannot produce the build on iOS simulator, even after exactly copy pasting the code in the required models and controllers. Console gives me following info:

  • No config.adapter.idAttribute specified for table "books"
  • Adding "alloy_id" to uniquely identify rows

Simulator stops at the default splash screen and nothing happens after that. Can gurus walk me through this?

like image 350
kk497055 Avatar asked Feb 14 '23 19:02

kk497055


2 Answers

When you edited controllers/index.js you probably erased everything that was there and not only the doClick() function. You need to leave $.index.open(); at the end of the file, or you will get No config.adapter.idAttribute specified for table "books" error

Your code should look like this:

var myBooks = Alloy.Collections.books;
var book = Alloy.createModel('books', { 
 title : 'Great Expectations', 
 author: 'Charles Dickens' 
});
myBooks.add(book); 
book.save();
$.index.open();

Hope this helps

like image 196
JeffT Avatar answered Apr 28 '23 09:04

JeffT


Are you stuck at the first build stage? If so check out my answer here:

Appcelerator Dev Questions - favebooks tutorial

It's because nothing is being called to launch the app when it initially loads so it hangs at the splash screen, the model is fine, it's the index.js and index.xml you need to look at.

like image 20
Maz Avatar answered Apr 28 '23 08:04

Maz