Iphone Restkit RKObjectLoader error

I have created an app, for Iphone, that uses Three20 and RestKit framework.

The app works almost perfectly, but there is a problem in the following situation:

I have a view that calls another using the method TTOpenURL(@"tt://reports");

In my loadView i have the method

[[RKObjectManager sharedManager] loadObjectsAtResourcePath:@"/checks" queryParams:params delegate:self];

I have those two methods for the returns:

- (void)objectLoader:(RKObjectLoader*)objectLoader didLoadObjects:(NSArray*)objects 
- (void)objectLoader:(RKObjectLoader*)objectLoader didFailWithError:(NSError*)error

Everything works correctly, the view shows the results and after i selected the back button everything keeps running correctly. But if I open the screen and select the back button before finishing the loading, an error occurs in the class RKObjectLoader in the method - (void) didFinishLoad (RKResponse *) response;

most precisely in line

if ([_delegate respondsToSelector:@selector(request:didLoadResponse:)]) {

Does anyone know how can I solve this problem?

Thanks in advance.

Andre

Answers


You just need to add the following to your controller's (RKObjectLoaderDelegate's) dealloc method:

[[RKRequestQueue sharedQueue] cancelRequestsWithDelegate:self];

Need Your Help

Spring 3 MVC request validation

java spring rest model-view-controller

I have a Spring 3.2 application and I've created a REST API that uses a token-based security. Every REST JSON payload contains a "token" field that is used to perform security validation.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.