NSDate *date_of_purchase;
sqlite3_bind_text(addStmt, 5, [date_of_purchase UTF8String], -1, SQLITE_TRANSIENT);
When I run this code, the above error(NSDate may not respond to UTF8String) was coming. Can any one help?
NSDate *date_of_purchase;
sqlite3_bind_text(addStmt, 5, [date_of_purchase UTF8String], -1, SQLITE_TRANSIENT);
When I run this code, the above error(NSDate may not respond to UTF8String) was coming. Can any one help?
Yes. NSDate doesn't have a method called "UTF8String": http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSDate_Class/Reference/Reference.html
That is a method of NSString. So you might have to create an instance of NSString from your date first, like so: Convert NSDate to NSString
sqlite3_bind_text(addStmt, 5, **[[date_of_purchase] description] UTF8String]**, -1, SQLITE_TRANSIENT);
UTF8String is method of NSString class.