Hello I'm writing an iPhone app using JSON framework. I couldn't serialize an NSObject, I found only serialize for nsstring, nsarray, nsdata, but I want to serialize a generic object from template object; any class library for this?
I have a user class, with userid, username and password. I want to serialize this class and send to server. After I want to deserialize result from server. Result could be class User, or any other class. In c# I have this: (In this case I use JSONRpc)
private int userid; [JsonIgnore] public int Userid { get { return userid; } set { userid = value; } } private string username; [JsonProperty("username")] public string Username { get { return username; } set { username = value; } } private string password; [JsonProperty("password")] public string Password { get { return password; } set { password = value; } } And method for response is: public JsonRpcResponse Invoke(string method, params object[] args). (T = template, in this case User) I can do this in Objectiv C?
Do you know any solution?