+ (void)initialize
+ (void)initialize
- Subject: + (void)initialize
- From: "Mark's Studio" <email@hidden>
- Date: Mon, 26 Aug 2002 18:40:53 +0200
I original had this problem.
An NSMatrix with custom button cells that i place in the toolbar, and
that works,
but when i bring up the customize toolbar sheet there is no image of
the control, not even the original buttoncell.
the custom view is setup in IB.
I have found a solution.
my original code used awakeFromNib to initialize the custom cell,but
that was called after the toolbar was setup,
and then i tried initImageCell: and initTextCell: but that was never
called,
then i read that custom toolbar views should conform to NSCoder,
so now i do my initializing in initWithCoder: and that works.
but i wanted some sort of init that was called before that, so i only
had one place of declarations
so after looking some more at NSObject i found,
+ (void)initialize
it's only called once
so i changed my instance variables to static , and declared them in the
initialize method.
The variables are some NSImage used to draw the cell.
It works, so is that ok?
and do i save memory, if the cell images are only declared once?
Peter Mark
Mark's Recording Studio A/S
Faelledvej 19 b DK2200 N
Copenhagen Denmark
Tel: +45 35366078 Fax: +45 35366038
www.marks-studio.dk
email@hidden
_______________________________________________
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.