Re: xcode 3.2.1 default delegate class
Re: xcode 3.2.1 default delegate class
- Subject: Re: xcode 3.2.1 default delegate class
- From: Matt Neuburg <email@hidden>
- Date: Wed, 14 Oct 2009 11:41:25 -0700
- Thread-topic: xcode 3.2.1 default delegate class
On or about 10/13/09 12:03 PM, thus spake
"email@hidden" <email@hidden>:
> Message: 3
> Date: Tue, 13 Oct 2009 16:54:41 +0200
> From: "Julius Guzy" <email@hidden>
> Subject: xcode 3.2.1 default delegate class
> To: email@hidden
> Message-ID: <email@hidden>
> Content-Type: text/plain; charset="us-ascii"
>
> Hi
> I've just installed xcode 3.2.1 and to my surprise saw that when I
> created a project e.g. MyProjectName it included by default
>
> MyProjectNameAppDelegate NSObject <NSApplicationDelegate>
>
> and that this object also had a presence in the MainMenu.xib of
> InterfaceBuilder.
>
> Clearly this has all been done for a reason and this reason includes
> ways I should take advantage of this object. Is it only there to
> facilitate program initialisation?
For years, basically since Mac OS X 10.0.0 or whatever it was, every time I
created a new Xcode (erstwhile Project Builder) project, my first move was
always to jump into Interface Builder, subclass NSObject as MyObject,
instantiate MyObject, hook it to the application as the application's
delegate, and generate the class files back to Xcode (Project Builder).
Again and again and again, I did this, and wondered to myself:
"Why doesn't Xcode do this *for* me? Under what circumstances would I *not*
want to start out with at least *some* automatically generated instance?
After all, I'm here to write code; that code has to go somewhere; it can
only go in a class; that class has to be instantiated. And surely it can do
no harm for that object also to be application's delegate, so that I can
perform initializations during applicationDidFinishLaunch. So why am I doing
all this work, every single darned time, manually, myself?"
Eventually the Core Data template came along, and presto, it included an
automatically instantiated object, which also functioned as the
application's delegate. Meanwhile, I learned that I could make my own
templates, so I made one that included a MyObject application delegate.
And now, all these years later, Apple has finally done this for me in the
default template. Wow. And that only took, what, eight years? :) Anyway, I'm
happy about it; better real late than never.
So anyway, Julius, you shouldn't be saying "what's this"; you should be
saying "about darned time!" :) m.
--
matt neuburg, phd = email@hidden, http://www.tidbits.com/matt/
pantes anthropoi tou eidenai oregontai phusei
Among the 2007 MacTech Top 25, http://tinyurl.com/2rh4pf
AppleScript: the Definitive Guide, 2nd edition
http://www.tidbits.com/matt/default.html#applescriptthings
Take Control of Exploring & Customizing Snow Leopard
http://tinyurl.com/kufyy8
RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
TidBITS, Mac news and reviews since 1990, http://www.tidbits.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden