Re: How to use [NSURL loadResourceDataNotifyingClient:usingCache:] ?

2003-03-25 Thread Richard Frith-Macdonald
On Monday, March 24, 2003, at 09:54  pm, Yen-Ju Chen wrote:

Hi,

 I try to use [NSURL loadResourceDataNotifyingClient:usingCahce:],
 but it doesn't work at all.
 I implement both -URLHandleResourceDidBeginLoading:
 and -URLResourceDidBeginLoading: in the client.
 But they are never called.
 Does it work in GNUstep ? Or am I doing something wrong ?
You are doing something wrong ...

1. The -URLHandleResourceDidBeginLoading: method is sent to the NSURL 
object, not to its client.  So implementing this in the client will 
have no effect.  If you want the method to be called you need to make 
your object a client of an NSURLHandle rather than an NSURL.

2. The -URLResourceDidBeginLoading: method is not part of the URLClient 
protocol, so NSURL clients should not and do not get sent a method 
notifying them when loading starts.  This is presumably because the 
only way to make an object a client of an NSURL is by sending the NSURL 
instance a -loadReasourceDataNotifyingClient:usingCache: method.  ie 
your code already knows that loading has just begun, so it can tell the 
client that itsself.  I can't think of any other reason why Apple would 
have decided not to put a method like that in the protocol.



___
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep


Re: How to use [NSURL loadResourceDataNotifyingClient:usingCache:] ?

2003-03-25 Thread Richard Frith-Macdonald
On Tuesday, March 25, 2003, at 04:53  pm, Yen-Ju Chen wrote:

 Thanx a lot. It works.
 But I notice it doesn't work in the background.
 Is it supposed to be non-blocking ?
I don't know ... It's written to block.
I guess I'll have to check the apple implementation and change the 
GNUstep one to match if necessary.



___
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep


Re: How to use [NSURL loadResourceDataNotifyingClient:usingCache:] ?

2003-03-25 Thread Richard Frith-Macdonald
On Tuesday, March 25, 2003, at 05:38  pm, Richard Frith-Macdonald wrote:

On Tuesday, March 25, 2003, at 04:53  pm, Yen-Ju Chen wrote:

 Thanx a lot. It works.
 But I notice it doesn't work in the background.
 Is it supposed to be non-blocking ?
I don't know ... It's written to block.
I guess I'll have to check the apple implementation and change the 
GNUstep one to match if necessary.
I've looked at the apple stuff, and it does seem it does a background 
load.

I've modified GNUstep CVS ... but I don't have a test program ready ... 
want to try it out?



___
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep


Re: How to use [NSURL loadResourceDataNotifyingClient:usingCache:] ?

2003-03-25 Thread Yen-Ju Chen
 Thanx a lot.
 It works perfectly.
 Yen-Ju

From: Richard Frith-Macdonald [EMAIL PROTECTED]
To: Yen-Ju Chen [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
Subject: Re: How to use [NSURL loadResourceDataNotifyingClient:usingCache:] 
?
Date: Tue, 25 Mar 2003 19:21:15 +

On Tuesday, March 25, 2003, at 06:29  pm, Yen-Ju Chen wrote:

 I tried. It now works as non-blocking.
 But the URLClient protocol is never called again.
 I attach a test program.
 It will run infinitely until the loading is finished.
 Hope it help.
Thanks ... please update from CVS again (I made a typo).

Also ... your program needs to run the main runloop while waiting for the 
URL operation to complete ...

  [[NSRunLoop currentRunLoop] runMode: NSDefaultRunLoopMode beforeDate: 
[NSDate distantFuture]];



_
Add photos to your messages with MSN 8. Get 2 months FREE*.  
http://join.msn.com/?page=features/featuredemail



___
Help-gnustep mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/help-gnustep