ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.


AddThis Social Bookmark Button
  Inside the Objective-C Runtime
Subject:   Adding categories at runtime
Date:   2003-03-20 17:02:19
From:   eepstein
Response to: Adding categories at runtime

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.