iSQL Goto Method
Currently you can use moveNext to step through the array of records, I really need to be able to Goto a specific index! There does'nt appear to be an 'objectAtIndex' function either?? This is necessary in functions like UIViewTables cellForRowAtIndexPath.
6 comments
-
Brandon
commented
I've even gone so far as to create my own custom objects to represent a row in a table. so the while move next loop will create an instance of my object and set all it's values and then add the object to a mutable array. Then my table will just call for the object and just reference the values. Pretty nifty actually.
-
Adminmobile[foo]
(MobileFoo, MobileFoo)
commented
Hi Jason (and others!),
I agree that providing row-indexed access to the result sets would be useful, for exactly the reasons you describe. I've just not quite had time to implement it as yet, I'm afraid :-).
In the meantime, you're obviously aware of the workarounds, but I agree it's not ideal.
Many thanks,
Rob
mobile[foo] -
Jason Podwojski
commented
The original observation was that the raw data is already stored in an array, iSQL gives you some access to this array via moveNext, but why not full array access like objectAtIndex etc.. As it stands we have to make a copy of the array to access records properly, so read for example, read 500 records, copy 500 records via moveNext to new array, then use objectAtIndex on new array. See the extra step?
-
Brandon
commented
I add each column of returned data an array or dictionary. Then I can retrieve the results later for my tableview... it's not the job of iSql... it's your job ;)
-
Jason Podwojski
commented
This what I have done, just seems like an addition step, as there is already an array of data as such in the resultsets object.
-
Dale
commented
Just pull through all the data into a dictionary or array and use that for object at index or whatever for your cell row at path.