且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Objective-C / iOS:将对象数组转换为JSON字符串

更新时间:2022-12-10 14:07:14

关于你的结构 - 你的 contactsToBeSynced 必须是 NSDictionary 类,联系应该是 NSArray 包含 NSDictionary 不同联系人的对象。顺便问一下,你试过 JSONKit 吗?它的序列化比标准 NSJSONSerialization 更好。

About your structure - your contactsToBeSynced must be of NSDictionary class, and contact should be an NSArray containing NSDictionary objects for different contacts. By the way, have you tried JSONKit? It's serialization works better than standard NSJSONSerialization.