0

As I'm new to iOS programming,I have a doubt in retrieving data corresponding to a particular integer id from SQLite database table?

This is what I tried but seems wrong:

NSInteger id=  sender.tag;
FMResultSet *rs = [self.databaseFM executeQuery:@"select * from tblVenue where venue_id = ?",id];

Is the problem related to Integer typecasting?

2
  • what are you using instead of "venue_id = ?" ? Commented Feb 10, 2016 at 5:34
  • 1
    it's showing any error ?. what is FMResultSet ? Commented Feb 10, 2016 at 5:35

1 Answer 1

1

Just use -numberWithInteger: like this :-

NSInteger id=  sender.tag;
FMResultSet *rs = [self.databaseFM executeQuery:@"select * from tblVenue where venue_id = ?", [NSNumber numberWithInteger:id]];
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.