coresmart / persistencejs

persistence.js is an asynchronous Javascript database mapper library. You can use it in the browser, as well on the server (and you can share data models between them).
http://persistencejs.org
1.72k stars 240 forks source link

Titanium platform bug cause android platform not working #87

Open summersmile1984 opened 12 years ago

summersmile1984 commented 12 years ago

Hi, i have run the Titanium platform on android,but it did not work. After days to find it's a Titanium platform bug. The Ti.Database.Resultset fieldCount() function does not work on android but ok for iOS. https://jira.appcelerator.org/browse/TIMOB-2945 It has not be resloved yet and not likely to be solved in a near future. So the way to pass maybe is add a platform detect code in the Titanium.js. while (rs.isValidRow()) { var result = {}; //to sovle the titanium bug,on android ,resultset has a fieldCount attribute but ios it is a method var fc ; if(Ti.Platform.osname == 'android'){ fc = rs.fieldCount; }else{ fc = rs.fieldCount(); } for ( var i = 0; i < fc; i++) { result[rs.fieldName(i)] = rs.field(i); } results.push(result); rs.next(); }