I'm having a weird problem with Restkit+iOS 5 + Rails: when I attempt to do a post on the server like this:
NSArray *topicsList=[self.topicsTV.text componentsSeparatedByString:@","];
RKParams *params = [NSDictionary dictionaryWithObjectsAndKeys: self.questionTV.text,@"question[text]",
self.descriptionTV.text,@"question[detail]",
topicsList,@"topics[]", nil
];
[[RKClient sharedClient] post:@"/questions.json" params:params delegate:self];
The log will be like this:
2012-01-11 17:24:21.725 APP[29087:fb03] I restkit.network:RKRequest.m:562 Status Code: 401
2012-01-11 17:24:21.725 APP[29087:fb03] I restkit.network:RKRequest.m:563 Body: {"error":"You have to register or login."}
Note that before posting I was logged at 100% because I could get access to some private content and what happened is that if I refresh the private content (get sent to server) it gives me this error:
2012-01-11 17:35:51.337 APP[29087:fb03] D restkit.network.queue:RKRequestQueue.m:455 Request <RKObjectLoader: 0x811c360> failed loading in queue <RKRequestQueue: 0xc60ea10 name=(null) suspended=NO requestCount=0 loadingCount=0/5> with error: The operation couldn’t be completed. (org.restkit.RestKit.ErrorDomain error 1004.).(Now loading 0 of 5).
Did that operation log me out? How should I mantain the login session alive?