Re: how to centralize functionality more elegantly?
Re: how to centralize functionality more elegantly?
- Subject: Re: how to centralize functionality more elegantly?
- From: James DiPalma <email@hidden>
- Date: Sat, 7 Sep 2002 13:31:29 -0400
Yeah, I should have said something like that. I was trying to point out
one advantage of using a singleton.
If [MainController sharedController] does not return an instance of
MainController, you will get a compile time warning. If [NSApp delegate]
does not return an instance of MainController, you will get no compile
time warning.
Because there is no compile time type checking for [NSApp delegate], you
should consider using a run time type check (as Ondra shows below), but
your code does not type check at run time (which was my point: this code
performs no compile time check nor any run time check to verify that
[NSApp delegate] is actually an instance of MainController).
-jim
On Saturday, September 7, 2002, at 01:01 PM, Ondra Cada wrote:
On Saturday, September 7, 2002, at 06:52 , James DiPalma wrote:
there is no compile time or run time check to verify that [NSApp
delegate]
actually is a (MainController*)
Ammm... have I overlooked something?
if ([[NSApp delegate] isKindOfClass:[MainController class]]) ...
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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.