logo       

Re: tutorial: "doesNotUnderstand" instance variable: msg#00078

lang.smalltalk.squeak.beginners

Subject: Re: tutorial: "doesNotUnderstand" instance variable

Karl a écrit :
Andrew n marshall wrote:
I'm trying to go through the pipsqueak tutorial, but it throws a doesNotUnderstand error when I try to initialize the exitSides instance variable the first time. The browser shows the exitSides variable (with nil value), so the VM knows its there.

This is my class declaration:
Object subclass: #BlankCell
instanceVariableNames: 'activeSegments exitSides'
classVariableNames: ''
poolDictionaries: ''
category: 'Laser-Game-Model'

This is my init function:
initializeExitSides
self exitSides: Dictionary new.
The error message says that #existSides: doesn't exist. So either you create it (the accessor) or you directly affect the instance variable.

BlankCell>>existSide: aDictionary
existSide := aDictionary

or you replace in you initialize method "self exitSides: Dictionary" new by:
existSide := Dictionary new

self exitSides at: #north put: #south.
self exitSides at: #east put: #west.
self exitSides at: #south put: #north.
self exitSides at: #west put: #east.

And a screen shot of my error stack trace is here:
http://www.isi.edu/~amarshal/transfers/squeak_error.png
(How do I copy it as text anyway?)


Anm
_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
Beginners@xxxxxxxxxxxxxxxxxxxxxxxxxx
http://lists.squeakfoundation.org/mailman/listinfo/beginners



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise