Re: NSProxy vs plain old NSObject
Re: NSProxy vs plain old NSObject
- Subject: Re: NSProxy vs plain old NSObject
- From: "Laurent Daudelin" <email@hidden>
- Date: Wed, 03 Dec 2003 13:10:41 -0500
On 03/12/03 12:29, "Jonathan Wight" <email@hidden> wrote:
>
I've created an NSProxy subclass that sends a notification out every
>
time a message is sent to it. It works fine except for one weird side
>
effect. If I execute 'NSLog(@"%@", theProxy)' it tries to call a method
>
called '_copyDescription' instead of 'description' (which I provided).
>
This is making debugging a little bothersome.
>
>
This made me wonder why I am using an NSProxy subclass over a NSObject
>
subclass. As far as I can tell either will work. So what are the
>
advantages NSProxy has over NSObject in situations like this?
A proxy object is a stand-in object in an application space where the
original object is in a different application space, like a client software
and a server software. The client might have a proxy instance that
represents an object in the server software. For other local objects in the
client, the proxy just looks like any other object. However, whenever it
gets a message, it will forward it to the real object in the server
software. Usually, if you're not doing that king of things, you should not
subclass NSProxy but NSObject instead.
-Laurent.
--
========================================================================
Laurent Daudelin Developer, Multifamily, ESO, Fannie Mae
mailto:email@hidden Washington, DC, USA
************************ Usual disclaimers apply ***********************
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.