Hi,

2013/4/24 Mohammad Al Houssami (Alumni) <mha53@mail.aub.edu>

Hello again,


If I have an instance variable A in ClassA and I want to use it in ClassB.

If I do the following �in ClassB

objectA := ClassA new.

objectA �A: "new value for A".


Why doesn�t this work? Isnt this calling the setter of A on the objectA ?� Pharo doesn�t understand it for some reason .


yes.
but a setter is regular method.
did you defined the method in ClassA.
also, by convention method names start with a lowercase.
Example:

Object subclass: #ClassA
� iv: 'a'

ClassA>>a: newValue
� �a := newValue

objA := ClassA new.
objA a: 1

Cheers,

Luc�