@机具内部。mm未运行? 我有一个运行Obj-C的东西的C++文件,但是Obj-C的东西好像没有被运行(它编译得很好),但是我得到一个错误,说Obj-C是假设要做的(在这个例子中为咆哮登记)没有运行。
GrowlRapper.mm@机具内部。mm未运行? 我有一个运行Obj-C的东西的C++文件,但是Obj-C的东西好像没有被运行(它编译得很好),但是我得到一个错误,说Obj-C是假设要做的(在这个例子中为咆哮登记)没有运行。,c++,objective-c,growl,C++,Objective C,Growl,GrowlRapper.mm #import "growlwrapper.h" @implementation GrowlWrapper - (NSDictionary *) registrationDictionaryForGrowl { return [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObject:@"Upload"], GROWL_NOTIFICATIONS_ALL,
#import "growlwrapper.h"
@implementation GrowlWrapper
- (NSDictionary *) registrationDictionaryForGrowl {
return [NSDictionary dictionaryWithObjectsAndKeys:
[NSArray arrayWithObject:@"Upload"], GROWL_NOTIFICATIONS_ALL,
[NSArray arrayWithObject:@"Upload"], GROWL_NOTIFICATIONS_DEFAULT
, nil];
}
@end
void showGrowlMessage(std::string title, std::string desc) {
std::cout << "[Growl] showGrowlMessage() called." << std::endl;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
[GrowlApplicationBridge setGrowlDelegate: @""];
[GrowlApplicationBridge
notifyWithTitle: [NSString stringWithUTF8String:title.c_str()]
description: [NSString stringWithUTF8String:desc.c_str()]
notificationName: @"Upload"
iconData: nil
priority: 0
isSticky: YES
clickContext: nil
];
[pool drain];
}
int main() {
showGrowlMessage("Hello World!", "This is a test of the growl system");
return 0;
}
#导入“growlrapper.h”
@实现growlrapper
-(NSDictionary*)注册词典FORGROWL{
返回[NSDictionary Dictionary WithObjectsAndKeys:
[NSArray arrayWithObject:@“上传”],咆哮着发出所有通知,
[NSArray arrayWithObject:@“Upload”],咆哮通知\u默认值
,无];
}
@结束
void showGrowlMessage(std::string title,std::string desc){
std::cout您正在将growl委托设置为空字符串,而不是GrowlRapper
类的实例。growl委托仅用于单击返回跟踪和处理。它与注册无关。不是真的,它还可以提供注册字典。?Hrmmm我怎么做?您说它需要S是要附加到我的咆哮器类的实例上的?当你说实例(代码)>(空)BLAH <代码>时,你是什么意思?我正在看,他们似乎正在把它传递给露比的DATAJSORT结构,但我不能这样做,还有什么别的东西我可以通过C++吗?
#ifndef growlwrapper_h
#define growlwrapper_h
#include <string>
#include <iostream>
#include <Cocoa/Cocoa.h>
#include <Growl/Growl.h>
using namespace std;
void showGrowlMessage(std::string title, std::string desc);
int main();
#endif
@interface GrowlWrapper : NSObject <GrowlApplicationBridgeDelegate>
@end