开发者

How to store JSON output into SQLite i iphone app

I have JSON output data. I want to store it into table row. So whenever I will fetch it from table I will must be able to work as array.

I tried and store data in SQLite. But when I am trying to initialize with an array variable I am getting warning.

How to store JSON array in SQLite table?

Here is my code details.

fethcing values form JSON output

NSArray* getFacebookFriendName = [[NSArray alloc] initWithArray:[getFacebookFriendRecord  valueForKey:@"name"]];

Here is query for Insertion

 NSString* insertSql=[NSString strin开发者_开发百科gWithFormat:@"Insert into Facebook(ID,FacebookAccountName,LogoOfFaves,MessageString,FriendsName,FriendsUID,LinksOfFaveData,LikeCountValues,FriendsProfileImage,EachPostID) values(1,'%@','','','%@','','','','','')", facebookAccountName,getFacebookFriendName]; 

And here I want to fetch data;

NSArray* getFacebookFriendName=sqlite3_column_text(selectstmt,4);

But it is returning String and I have written lots of code in keep mind with Array for FacebookFreindsName.

Thanks

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜