RE: Instantiation
RE: Instantiation
- Subject: RE: Instantiation
- From: "Jonathan E. Jackel" <email@hidden>
- Date: Thu, 17 Jul 2003 14:18:11 -0400
>
Here's a general question. When should I instantiate, and when
>
should I not?
You should instantiate when you need an instance. You shouldn't when you
don't.;>
Seriously, other than UI objects (which are instantiated by dragging them
onto the window) and controllers, I tend to instantiate rarely. One thing
I've done is instantiate a custom formatter and then hook it up to numerous
textfields' formatter outlets. That way the fields each share the same
formatter, which may save a little memory but mostly saves me the pain of
attaching formatters in some more labor-intensive way.
>
Is an instantiated object necessarily a controller?
No. See above. I seem to remember that someone made an IB Palette to
instantiate dictionaries and arrays, but I never used it.
>
Should I even *have*
>
that many instatiations in a nib?
I like my nibs clean, and I haven't seen very compelling reasons to
instantiate a lot of other objects, but I'm sure there are a lot of
different points of view on this topic. I'd be interested in hearing about
what other people do; maybe I'm working harder than I should.
Jonathan
_______________________________________________
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.