[comp.sys.next] Specifying a "factory object"

jacob@gore.com (Jacob Gore) (09/30/89)

What exactly is a "factory object id?"  For example, if I have MyCell, a
subclass of Cell, which I want to be the cell class of a matrix, what do I
give to -setCellClass: ?

In 0.9, I could just say
	[aMatrix setCellClass:MyCell]
but in 1.0 that gives me a compile-time error: "parse error prior to
MyCell" (may not be the exact wording).

Do you need to do something like 
	[aMatrix setCellClass:[self findClass:"MyCell"]]
or is there a more natural way to do this?

Jacob
--
Jacob Gore		Jacob@Gore.Com			boulder!gore!jacob

ali@polya.Stanford.EDU (Ali T. Ozer) (09/30/89)

In article <130021@gore.com> jacob@gore.com (Jacob Gore) writes:
>What exactly is a "factory object id?"  For example, if I have MyCell, a
>subclass of Cell, which I want to be the cell class of a matrix, what do I
>give to -setCellClass: ?
>
>In 0.9, I could just say
>	[aMatrix setCellClass:MyCell]
>but in 1.0 that gives me a compile-time error: "parse error prior to
>MyCell" (may not be the exact wording).

In 0.9, factory ids used to be global variables, so you could do the above.
In 1.0, they aren't. You need to use [Factory class] instead of just
Factory:

	[aMatrix setClassCell:[MyCell class]];

Ali Ozer, NeXT Developer Support
aozer@NeXT.com