我在存储我正在下载的一些 json 数据时遇到问题。我认为的问题是从字符串到 json 再到 const char 的转换。也可能有更好的方法来做到这一点。这就是我所拥有的
NSDictionary *jsonAll = [[(NSString *)response uppercaseString] JSONValue];
//Get the objects within the seat number object
NSDictionary *seatInfo = [jsonAll objectForKey:seatMessage];
//Split the objects up accoridng to the track information -- we will have to structure
//we havethe maeesge with how ever many track
NSMutableString *Track1 = [seatInfo objectForKey:@"TRACK1'];
NSMutableString *Track2 = [seatInfo objectForKey:@"TRACK2"];
我带来的 json 文件看起来像这样
{A1 = {
TRACK1 = (
1462527,
1462527,
1462527,
1462527,
1462527,
1462527,
1462527,
1462527,
1462527,
1462527,
1462527
);
TRACK2 = (
12800016,
12800016,
12800016,
12800016,
12800016,
1462527,
12800016,
12800016,
12800016,
12800016,
12800016
);
};
}
我认为问题在于新线路。据我所知,当我尝试将数据存储在 sql 中时,我必须将其转换为 const char。
有人知道怎么做吗?
谢谢