Reputation: 604
When i am trying to execute select query not executing .
after the below line of code execution of program stopped.
NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =? ",din];
Upvotes: 1
Views: 100
Reputation: 21221
Din must me an nsstring, what is the object type of din
if it is int, please wrap it in an NSString
Upvotes: 0
Reputation: 8947
if din is integer then,
NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din =%d ",din];
and if din is string then,
NSString *query = [NSString stringWithFormat:@"select * from maintable_master where din ='%@' ",din];
Upvotes: 5