In the example in the Xcode Documentation : URL Loading System Programming Guide : Using NSURLConnection, they alloc
an NSURLConnection
(theConnection
) and then release it in the callbacks: -connection:didFailWithError:
& -connectionDidFinishLoading:
. But, won't theConnection
leak (i.e. never get released) if the delegate is released before either of the callback methods get called?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
No,
theConnection
won't leak because, as the Xcode Documentation for-[NSURLConnection initWithRequest:delegate:]
states under Special Considerations: "The connection retains delegate. It releases delegate when the connection finishes loading, fails, or is canceled."