0

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

Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57
Andre
  • 1
  • 1
  • Andre, please include as much information as possible to help you resolve this error. For example, you may include the traceback you're getting when error occurs. – Victor K. Jul 18 '11 at 15:40

1 Answers1

2

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

[[RKRequestQueue sharedQueue] cancelRequestsWithDelegate:self];
jeffarena
  • 501
  • 2
  • 8