I will give you an example of how you can create and download a package as a plugin. Hope this helps you a lot. I have to say that I agree with the other 2 (for now) answers. So that...
Create an Xcode project as a "Bundle" (in Xcode 3.2.6, in New Project-> Framework and Library-> select "Bundle"). Create the following files ...
PClass.h
#import <Foundation/Foundation.h>
@interface PClass : NSObject {
}
- (NSString*) stringMessage;
@end
PClass.m
- (NSString*) stringMessage {
return @"Hallo from plugin";
}
.plist :
" " "MyPlugin"
" " "PClass"
(.../build/Debug/yourPlugin.bundle) , ( aProject.app/Plugins/ ).
Xcode :
- (void) loadPlugin {
id bundle = [NSBundle bundleWithPath:@"the path you/placed/yourPlugin.bundle"];
NSLog(@"%@", [[bundle infoDictionary] valueForKey:@"CFBundleDisplayName"]);
NSError *err;
if(![bundle loadAndReturnError:&err]) {
} else {
Class PluginClass = [bundle principalClass];
id instance = [[PluginClass alloc] init];
NSLog(@"%@", [instance stringMessage]);
[instance release];
[bundle unload];
}
}
.