xavierlacot / joli.js

joli.js is an Activerecord-like javascript ORM, particularly suited for being used in the Appcelerator Titanium Mobile framework.
MIT License
267 stars 60 forks source link

'<fieldCount>' is not a function (evaluating 'rows.fieldCount()'... #46

Open Pita95 opened 9 years ago

Pita95 commented 9 years ago

"Prior to Release 3.3.0 of the Titanium SDK, note that fieldCount is exposed as a method on iOS, but as a property on Android. Blackberry supported it both as a property and a method. Starting from Release 3.3.0 of the Titanium SDK, fieldCount is supported only as a read only property." (Excerpt from http://docs.appcelerator.com/titanium/3.0/#!/api/Titanium.Database.ResultSet)

Therefore using 3.3.0 of Titanium SDK or higher, when trying to perform a select on iOS you will get the error: '' is not a function (evaluating 'rows.fieldCount()'...

This is due to line 586 in joli.js fieldCount = rows.fieldCount();

Since this is now a property in iOS, the surrounding logic can be condensed to something like :

var fieldCount = rows.fieldCount;

Hope this helps... Keep up the good work! I love joli.js!

trs-mark commented 9 years ago

Thanks.

antongorodezkiy commented 8 years ago

+1, faced the same problem and came here to post an issue.