| Article: |
Inside the Objective-C Runtime | |
| Subject: | Adding categories at runtime | |
| Date: | 2003-02-26 14:48:41 | |
| From: | anonymous2 | |
|
Is it possible to add categories at runtime and even override existing methods? (and, if it is, could you please give a short example or point me / us to some information?) |
||
Showing messages 1 through 2 of 2.
-
Adding categories at runtime
2003-02-26 15:15:46 eepstein [View]
-
Adding categories at runtime
2003-03-20 17:02:19 eepstein [View]
Take a look the the - (void)openAction:(id)sender
method in the AppController.m file in the source for the RuntimeBrowser. (See http://source.prajnait.com/src_RuntimeBrowser.html for the RB home page.)
The gist of dynamically loading a bundle into the rutime is a call to NSBundle's -load method.
There are ways to directly install a single method into the runtime. One way to find out more is to study the Objective-C runtime implementation source code which is released as part of Apple's Darwin project.



Am curious about the application of this technique, if you'd care to share.