Problem has solved.
I had the instance variable to instance := self new. instead of
instance := self basicNew.
Roelof
Op 5-11-2018 om 22:50 schreef Sven Van Caekenberghe:
On 5 Nov 2018, at 22:41, Roelof Wobben <r.wob...@home.nl> wrote:
I use this code to try to read things:
json paintingCollection |
json := (NeoJSONReader fromString: (ZnEasy get: '
https://www.rijksmuseum.nl/api/nl/collection?key=14OGzuak&format=json&type=schilderij&toppieces=True
') contents).
paintingCollection := PaintingCollection fromJSON: json.
paintingCollection inspect
and now suddenly I see a message that #add: is sent to nill
I am guessing here: is the instance variable holding your collection inside
PaintingCollection initialized to an actual collection before you #add: to it
in #addPainting: ? You could initialize it lazily if you want.
Roelof
Op 5-11-2018 om 22:33 schreef Erik Stel:
Roelof,
What does not work in your code? How do you call
PaintingCollection>>fromJSON: ?
>From what I see this code could work if used like (replace URL with actual
URL):
--
Sent from:
http://forum.world.st/Pharo-Smalltalk-Users-f1310670.html