Re: [F-Script-talk] Dictionary and a shell command wanted :)
Brought to you by:
pmougin
From: Giovanni G. <jj...@ob...> - 2006-08-25 19:00:26
|
On 24/ago/06, at 12:07, Philippe Mougin wrote: > >> NSObject subclass:'MyClass' instanceVariableNames:'a b c' > MyClass > >> MyClass setFSBlock:[:self :_cmd| 'Method ' ++ _cmd ++ ' called on ' > ++ self printString] asInstanceMethod:#method1 > >> myInstance := MyClass alloc init > >> myInstance method1 > 'Method method1 called on <MyClass: 0x4bb69c0>' > > Using the setFSBlock... methods you can also add methods to existing > Cocoa classes. Nice! How can access to instance variable inside methods block? I tried with (self a) without so much success. Even valueForKey: didn't work :| -- [ [ [ JJ ] ] ] | When you encounter seemingly good advice | that contradicts other seemingly good advice, http://www.siforge.org | ignore them both. Al Franken |