Xcode X Switt X SQLite

Hi, Has anyone developing an app for Mac, Xcode 14.3 and using SQLite ever had the errors below? Detail: the application compiles and runs without errors!!

Tks.

Answered by AndyJJ in 754321022

Should this...:

fmResultSet = ...

...be:

let fmResultSet = ...

..instead? And apparently:

while fmResultSet!.next() == true

Is not the valid way since next() returns the next result object, not a boolean value true or false. So perhaps you need to replace that with:

while fmResultSet!.next() != nil

Later you use the isEmpty property, and that is either true or false but you compare that to nil instead.

Accepted Answer

Should this...:

fmResultSet = ...

...be:

let fmResultSet = ...

..instead? And apparently:

while fmResultSet!.next() == true

Is not the valid way since next() returns the next result object, not a boolean value true or false. So perhaps you need to replace that with:

while fmResultSet!.next() != nil

Later you use the isEmpty property, and that is either true or false but you compare that to nil instead.

Hi AndyJJ, Thanks for the tips, after corrections the error messages disappeared. However, the command

while fmResultSet!.next() != nil

It always returns True, so the loop ends up giving an error when finding one of the columns of the ResultSet where I check if it is different from nil. To work around, I now check if the PkLivro field is equal to zero then I break the loop.

Thanks.

Xcode X Switt X SQLite
 
 
Q