objective c - iPhone NSURLConnection initialization problem -


what difference between 2 lines, in different apps first 1 seems work , have problems second one; , 1 should choose on another? app receive , send data webservice.

nsurlconnection *theconnection = [[nsurlconnection alloc] initwithrequest:therequest delegate:self];  nsurlconnection *theconnection = [nsurlconnection connectionwithrequest:request delegate:self]; 

and should release connection object, after every didfinishloading? doesn't take time on every request connect?

the first 1 instance of nsurlconnection take ownership of object, have responsibility , hence must release it. details on ownership reference.

the second 1 auto-released object dont need release it. released automatically when auto-release pool drained.


Comments

Popular posts from this blog

javascript - Iterate over array and calculate average values of array-parts -

iphone - Using nested NSDictionary with Picker -

objective c - Newbie question -multiple parameters -