Hi!
I am working on an iPhone project where we need to fetch data from aa sqlite database. I have done this many times before, and everything works out fine. But now I am having problems fetching the value of an integer field (the primary key).
The varchar fields I can fetch with:
NSString *forfatter=[[NSString alloc] initWithUTF8String:(char *)sqlite3_column_text(selectstmt, 11)];
I suppose i have to use sqlite3_column_int for this, but i cant find out how to get the number right. When i NSLog it, it always comes out wrong, like: "107096896" instead of "35".
Here is one of the ways i tried to do it:
int pKey = sqlite3_column_int(selectstmt, 0);
NSLog(@"fant id: %i",pKey);
I also tried with NSIntegers and NSUIntegers. Can anyone help me out with this one? I would be very grateful!