• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
      • From: "Clint Shryock" <email@hidden>
  • Prev by Date: Re: How does NSButtonCell do its drawing?
  • Next by Date: Leopard - interaction with Spaces from own applications
  • Previous by thread: [OT] Re: Using assembly in objective-c
  • Next by thread: Re: NSURL loadResourceDataNotifyingClient callbacks never called when -fobjc-gc is used
  • Index(es):
    • Date
    • Thread