I've a custom class QBChatDialog object, that I'm storing in sqlite database like
-(void)storeInDB:(QBChatDialog *)dialog {
NSString *query = = [NSString stringWithFormat:@"INSERT INTO dialogs (dialog_id,last_message) VALUES ('%@','%@')",dialog.ID,dialog.lastMessageText];
//run the query
}
Then I'm retrieving as NSDictionary from database.
// after fetching as an array in dbrecord
NSDictionary *dialogDictionary = @{@"dialog_id":[dbrecord objectAtIndex:DIALOG_ID_INDEX],
@"dialog_last_message":dbrecord objectAtIndex:DIALOG_LAST_MESSAGE_INDEX]
};
How can I map it back to QBChatDialog
class, to get values like dialog.ID
or dialog.lastMessageText
. The class is third party API, and some properties are read-only
.
Thanks