[Newbies] new and initialize
ron at usmedrec.com
Tue May 10 18:20:11 UTC 2016
Excellent question. Try this.
Highlight it and do debug it. Click "Into" to go into the #new method.
Notice the implementation of #new.
You should be able to see there that #initialize is called automatically.
Also for extra points notice what class new is implemented on. What method should you call to skip initialize?
All the best,
> -----Original Message-----
> From: beginners-bounces at lists.squeakfoundation.org [mailto:beginners-
> bounces at lists.squeakfoundation.org] On Behalf Of Joseph Alotta
> Sent: Tuesday, May 10, 2016 2:07 PM
> To: beginners at lists.squeakfoundation.org
> Subject: [Newbies] new and initialize
> I have an instance method called ‘initialize’ that defines instance variables.
> I want it to run whenever a new instance is created. How do I accomplish
> I tried to add a class method ‘new’ that contained ^(super new) initialize.
> But it warned me about adding the message saying it would have serious
> So where do I put it?
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
More information about the Beginners