disable method redefinition--is it really necessary when the class is being redefined?
parent
3b003551f9
commit
d4835de50b
|
@ -51,17 +51,17 @@ IN: cocoa.subclassing
|
||||||
! : verify-method-type ( class sel imp types -- class sel imp types )
|
! : verify-method-type ( class sel imp types -- class sel imp types )
|
||||||
! 4 ndup nip (verify-method-type) ;
|
! 4 ndup nip (verify-method-type) ;
|
||||||
|
|
||||||
: (redefine-objc-method) ( class method -- )
|
! : (redefine-objc-method) ( class method -- )
|
||||||
init-method ! verify-method-type
|
! init-method ! verify-method-type
|
||||||
drop
|
! drop
|
||||||
[ class_getInstanceMethod ] dip method_setImplementation drop ;
|
! [ class_getInstanceMethod ] dip method_setImplementation drop ;
|
||||||
|
!
|
||||||
: redefine-objc-methods ( imeth name -- )
|
! : redefine-objc-methods ( imeth name -- )
|
||||||
dup class-exists? [
|
! dup class-exists? [
|
||||||
objc_getClass swap [ (redefine-objc-method) ] with each
|
! objc_getClass swap [ (redefine-objc-method) ] with each
|
||||||
] [
|
! ] [
|
||||||
2drop
|
! 2drop
|
||||||
] if ;
|
! ] if ;
|
||||||
|
|
||||||
SYMBOL: +name+
|
SYMBOL: +name+
|
||||||
SYMBOL: +protocols+
|
SYMBOL: +protocols+
|
||||||
|
@ -71,7 +71,7 @@ SYMBOL: +superclass+
|
||||||
clone [
|
clone [
|
||||||
prepare-methods
|
prepare-methods
|
||||||
+name+ get "cocoa.classes" create drop
|
+name+ get "cocoa.classes" create drop
|
||||||
+name+ get 2dup redefine-objc-methods swap [
|
+name+ get swap [
|
||||||
+protocols+ get , +superclass+ get , +name+ get , ,
|
+protocols+ get , +superclass+ get , +name+ get , ,
|
||||||
\ (define-objc-class) ,
|
\ (define-objc-class) ,
|
||||||
] [ ] make import-objc-class
|
] [ ] make import-objc-class
|
||||||
|
|
Loading…
Reference in New Issue