FROM : Nir Soffer
DATE : Tue Feb 26 22:14:07 2008
On Feb 25, 2008, at 18:18, Doug Penny wrote:
>> NSURLConnection *imageConnection = [[NSURLConnection alloc]
>> initWithRequest:request
>>
>> delegate:self];
>>
>> if (!imageConnection) {
>> NSLog(@"A problem was encountered while trying to download an
>> image from %@", imageURL);
>> }
>>
[sniped]
> Turns out garbage collection was doing me in. When the
> NSURLConnection object was hanging out waiting for a response, it
> would get collected. To work around this, after creating the
> NSURLConnection object I just stick it in a NSMutableSet. When the
> delegate gets the -connectionDidFinishLoading: message I remove the
> connection object from the set. Works great now.
Any object you create on the stack will be gone when the method is
finished :-)
You must keep a reference to the connection.
Best Regards,
Nir Soffer
DATE : Tue Feb 26 22:14:07 2008
On Feb 25, 2008, at 18:18, Doug Penny wrote:
>> NSURLConnection *imageConnection = [[NSURLConnection alloc]
>> initWithRequest:request
>>
>> delegate:self];
>>
>> if (!imageConnection) {
>> NSLog(@"A problem was encountered while trying to download an
>> image from %@", imageURL);
>> }
>>
[sniped]
> Turns out garbage collection was doing me in. When the
> NSURLConnection object was hanging out waiting for a response, it
> would get collected. To work around this, after creating the
> NSURLConnection object I just stick it in a NSMutableSet. When the
> delegate gets the -connectionDidFinishLoading: message I remove the
> connection object from the set. Works great now.
Any object you create on the stack will be gone when the method is
finished :-)
You must keep a reference to the connection.
Best Regards,
Nir Soffer
| Related mails | Author | Date |
|---|---|---|
| Doug Penny | Feb 25, 17:18 | |
| Jerry Krinock | Feb 26, 18:55 | |
| Hamish Allan | Feb 26, 19:07 | |
| Nir Soffer | Feb 26, 22:14 | |
| Antonio Nunes | Mar 20, 12:03 |






Cocoa mail archive

