On 30 Apr 2011, at 18:52, Mathieu Suen wrote:

> I still have the same issue the drawRect: is not called.
> But I suspect that I did not add correctly the method.
> 
> The step for creating the new class is:
> 
> 1. objc_allocateClassPair
> 2. objc_registerClassPair
> 3. class_addMethod
> 
> I did this way because in step 1 and 2  my smalltalk class doesn't have the 
> method yet.
> So is that ok?

Wrong way around.  Correct order is 1, 3, 2.  You should create the class, set 
its methods and ivars, and then register it.

You can still add methods after the class is registered, but not ivars.

David
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à