Re: problem with NSMatrix
Re: problem with NSMatrix
- Subject: Re: problem with NSMatrix
- From: "Erik M. Buck" <email@hidden>
- Date: Sat, 6 Apr 2002 12:03:10 -0600
----- Original Message -----
From: "joie" <email@hidden>
>
well, setting a custom cell class in IB wouldn't help, as at my
>
program's start, since there are a variable number of cells, i must set
>
it programatically- i only threw in the setCellClass: to illustrate that
>
I was using a custom NSButtonCell subclass...
>
I can't remove all the cells and respawn them, either, as this is a
>
level editor for a tile-based RPG, and to lose all one's work just
>
because one mis-sized the map would be quite frustrating.
You should not be storing your game's state in cells. Cells are part of a
view in the model-view-controller paradigm. You need a model that stores
game information. The fact that you use cells or a custom view or text to a
terminal should not matter to the model. Besides, if you are creating the
matrix programmatically then there is no problem. Set the cell class BEFORE
you populate the matrix with cells.
See
http://www.stepwise.com/Articles/Technical/NSCell.html which
coincidentally describes using cells in a game's map editor.
_______________________________________________
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.