[Newbies] overwriting #new

Daniel Priewasser daniel at priewasser.net
Thu Jul 12 20:56:22 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

Hello,

I have a class Foo inherited from Object. When I try to create a user
defined #new (newFoo), to avoid the #initialize instance method to run
as part of the object instantiation, I get the following error:
... class(Object)>>doesNotUnderstand: #newFoo ...

method definition:
- --------------
newFoo
  | model|
  model := self basicNew.
  .. do something ..
  model initialize.
  ^model
- --------------
usage:
someMethod
  | foo |
  foo := Foo newFoo.
  .. do something ..
- --------------

Is there something that I missed to overwrite the #new method?

Cheers,
Daniel.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFGlpV2gUMEmDMCeAARA5uvAKCDAw6ag+qHEDrFce8EjNKjD+QYbQCfZVLw
OypIlyLFBLJOLB/rIktphwI=
=Rfyg
-----END PGP SIGNATURE-----


More information about the Beginners mailing list