I made some demo to retrieve some text from the server using Asinetworkqueue, and show it on the UITableView (Using UINavigation). Let's say i have one table for showing all the text and when i click the row, it goes to some view (Using UIView) the program look like this : /**** Code here *****/ NSURL *url = [NSURL URLWithString:@"http://test.myasianhobby.com/"]; ASIFormDataRequest *request = [ASIFormDataRequest requestWithURL:url]; [request setDelegate:self]; [request setRequestMethod:@"POST"]; [request setPostValue:"4" forKey:@"message_id"]; [request setPostValue:"1" forKey:@
It looks like ASIHTTPRequest is trying to call your delegate after it has been freed."user_id"]; /*************************/ I handling the finish selector by doing this : /******** Code here ********/ - (void) getReplyDataCompleted : (ASIHTTPRequest*)request { NSError *error; SBJSON *json = [[SBJSON new] autorelease]; NSString *response = [request responseString]; etc.. } /************************/ This code running perfectly fine but i got the error when i tap back and forth between the table content and the uiview... The error is like this :
[request clearDelegatesAndCancel];
[request release];
There are other possible approaches, eg. you could remove the
delegates for all items in your queues.--
You received this message because you are subscribed to the Google Groups "ASIHTTPRequest" group.
To post to this group, send email to asihttp...@googlegroups.com.
To unsubscribe from this group, send email to asihttpreques...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/asihttprequest?hl=en.
On 06/02/2011 15:30, charles leonhart wrote:
>
> I already tried to release the networkqueue (there's no cleardelegate
> for queue) and then i got the error :
> Program received signal: �EXC_BAD_ACCESS�.
> Are there something error with my code?
Try adding [queue setDelegate:nil]; before you release the network queue.
Cheers,
Joseph
Hi Charles,
On 06/02/2011 15:30, charles leonhart wrote:
I already tried to release the networkqueue (there's no cleardelegate for queue) and then i got the error :
Program received signal: “EXC_BAD_ACCESS”.
Are there something error with my code?
Try adding [queue setDelegate:nil]; before you release the network queue.
Cheers,
Joseph
--
You received this message because you are subscribed to the Google Groups "ASIHTTPRequest" group.
To post to this group, send email to asihttp...@googlegroups.com.
To unsubscribe from this group, send email to asihttpreques...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/asihttprequest?hl=en.
On 06/02/2011 15:44, charles leonhart wrote:
> Dear Joseph
>
> in the dealloc i add this...
> [networkQueue setDelegate:nil];
> [networkQueue release];
>
Looks right.
>
> after trying for 1-2 minutes.. going between one view controller and
> another
> i got the error again :
>
> - (void)requestReceivedResponseHeaders:(NSMutableDictionary
> *)newResponseHeaders
> {
> if ([self error] || [self mainRequest]) {
> return;
> }
>
> if (delegate && [delegate
> respondsToSelector:didReceiveResponseHeadersSelector]) {
> [delegate performSelector:didReceiveResponseHeadersSelector
> withObject:self withObject:newResponseHeaders]; <-- out of scope.
> }
>
> the didReceiveResponseHeadersSelector go out of scope.
This seems to be a different error again - this looks like you're back
to a problem with a request delegate not being cleared.
If you're already calling clearDelegateAndCancel in the dealloc, then
all check any other places you assign to the "request" member variable
and/or property - each time you assign to it, you must clear the
delegate for the old value first.
Joseph
Joseph
--
You received this message because you are subscribed to the Google Groups "ASIHTTPRequest" group.
To post to this group, send email to asihttp...@googlegroups.com.
To unsubscribe from this group, send email to asihttpreques...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/asihttprequest?hl=en.