Comment on "
Replacing Objective-C Methods at Runtime
"
by
Rog
— Oct 10, 06
Can anyone actually come up with a real world use for this?
One possible meaning could be to transform mutable objects to immutable.
@implementation MyMutableObject
- (id)transition {
if ([self count] > 1) return [self copy];
// change all mutable methods to immutable methods
// ...
// Return the transited object
return (MyObject *)self;
}
@end
Back to "
Replacing Objective-C Methods at Runtime
"
Technorati Profile
Copyright © Scott Stevenson 2004-2006
by Rog — Oct 10, 06
One possible meaning could be to transform mutable objects to immutable.
@implementation MyMutableObject
- (id)transition {
if ([self count] > 1) return [self copy];
// change all mutable methods to immutable methods
// ...
// Return the transited object
return (MyObject *)self;
}
@end