NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
- Subject: NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
- From: Vance <email@hidden>
- Date: Mon, 21 Jan 2008 11:18:08 -0800
Hi all,
I am new to cocoa development and I am trying to figure out how to go
about finding why the following code worked before on 10.4 and 10.5 with
garbage collection DISABLED.
However when recompiled on 10.5 with garbage collection ENABLED, none of
the callbacks that NSURL should call, are not called for some reason.
There are no exceptions or anything during debugging or in the Debugger
Console window. Just they are never called.
- (void)startDownloadWithName:(NSString*)name forURL:(NSString*)url
callbackTarget:(id)target callbackSelector:(SEL)selector
argument:(id)argument
{
NSLog(@"downloader->startDownloadWithName");
state = downloaderStateDownloading;
NSURL *urlObject = [[NSURL alloc] initWithString: url ];
NSMutableData *dataObject = [[NSMutableData alloc] initWithCapacity:
0 ];
NSMutableDictionary *props = [[NSMutableDictionary alloc] init];
[props setObject: name forKey: @"name" ];
[props setObject: urlObject forKey: @"url" ];
[props setObject: dataObject forKey: @"data" ];
[props setObject: target forKey: @"target" ];
[props setObject: argument forKey: @"argument"];
[props setObject: [NSNumber numberWithBool: NO] forKey: @"downloaded"];
[props setObject: [NSNumber numberWithLong:(int)selector] forKey:
@"selector"];
[downloadsLock lock];
[downloads addObject: props];
[downloadsLock unlock];
[urlObject loadResourceDataNotifyingClient:self usingCache:NO];
[props release];
[dataObject release];
[urlObject release];
}
- (void)URL:(NSURL *)sender resourceDataDidBecomeAvailable:(NSData
*)newBytes
{
NSLog(@"downloader->resourceDataDidBecomeAvailable 0x%x size %u",
sender, [newBytes length]);
...
}
- (void)URLResourceDidFinishLoading:(NSURL *)sender
{
NSLog(@"downloader->URLResourceDidFinishLoading 0x%X (%@)", sender,
[prop objectForKey: @"name"]);
}
- (void)URLResourceDidCancelLoading:(NSURL *)sender
{
NSLog(@"downloader->URLResourceDidCancelLoading 0x%X (%@)", sender,
[prop objectForKey: @"name"]);
}
- (void)URL:(NSURL *)sender resourceDidFailLoadingWithReason:(NSString
*)reason
{
NSLog(@"downloader->resourceDidFailLoadingWithReason %@ (%@)",
reason, [prop objectForKey: @"name"]);
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden