Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!dali.cs.montana.edu!milton!wjs From: wjs@milton.u.washington.edu (William Shipley) Newsgroups: comp.sys.next Subject: Re: Run-time object loading Message-ID: <6326@milton.u.washington.edu> Date: 15 Aug 90 00:03:40 GMT References: <1990Aug13.223632.312@svc.portal.com> Organization: University of Washington, Seattle Lines: 34 In article <1990Aug13.223632.312@svc.portal.com> moose@svc.portal.com writes: > > I am looking for a way to dynamically load objects at run-time. I want >an application that can allow people to drop in their own custom objects >whenever they want to. I know how to drop in interface files, I don't know >how to drop in raw objects. Currently it's pretty easy to dynamically load functions, but pretty difficult to dynamically load objects. Functions are easy because all you need is a pointer to them and you can call them. Here at Stanford Linear Accelerator I have created a set of routines which allow the user to dynamically link in functions: it took about 2 pages of code. (Available on request.) For objects, it depends on what you mean by "object". If you want to drop in an object of an already existing (in the target program) class, you can just unarchive it (or do somehting similar). If you want to dynamically add a new class, it's harder, because you have to inform the run-time Obj-C system all about your new class, including the size of the objects and the methods they respond to. This may be as easy as calling objc_addClass(), but, honestly, I have no idea. It hasn't been made clear to me whether 2.0 will actually support run-time loading of new classes, or just run-time linking of new functions. -william shipley NeXT developer at Stanford Linear Accelerator (student at University of Washington, too) PS: Thanks should be given to Alan Marcum at NeXT for assistance getting dynamic linking to work.