Memory management, and async operations: when does an object become nil?

Posted by Kenny Winker on Stack Overflow See other posts from Stack Overflow or by Kenny Winker
Published on 2010-03-23T21:29:26Z Indexed on 2010/03/23 21:33 UTC
Read the original article Hit count: 443

I have a view that will be displaying downloaded images and text. I'd like to handle all the downloading asynchronously using ASIHTTPRequest, but I'm not sure how to go about notifying the view when downloads are finished...

If I pass my view controller as the delegate of the ASIHTTPRequest, and then my view is destroyed (user navigates away) will it fail gracefully when it tries to message my view controller because the delegate is now nil?

i.e. if i do this:

UIViewController *myvc = [[UIViewController alloc] init];
request.delegate = myvc;
[myvc release];

Do myvc, and request.delegate now == a pointer to nil?

This is the problem with being self-taught... I'm kinda fuzzy on some basic concepts.

Other ideas of how to handle this are welcome.

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about memory-management