Ok, Now I want to add a menu in the safari menubar. I Create a Cocoa bundle project in Xcode .and then change the target extension is "webplugin" .and then add WebPluginMIMETypesFilename com.example.webplugin.plist to the info.plist.but I don't know the is right?. I make the prinpical class is my main plugin class SafariPlug . and then In the safariPlug.m I implement the methods:
// This method returns an NSView object that conforms to the WebPlugIn informal protocol.
- (NSView *)plugInViewWithArguments:(NSDictionary *)arguments
{
return [[[self alloc] initWithArguments:arguments] autorelease];
}
- (id)initWithArguments:(NSDictionary *)arguments
{
self = [super init];
if (self)
[MenuController sharedController]; // trigger the menu items to be added
return self;
}
at the end I followed the url:run safari to debug plunIn project
add a debug bundle:myProject.webplugin into the folder:/library/internet plug-ins/
But when I make a breakpoint into the
- (NSView *)plugInViewWithArguments:(NSDictionary *)arguments
the program didn't load in the debug mode? SomeOne which have experience can tell me the step of add a menu into the safari? Thank you very much!