Я использую Objective-C ++ в своем проекте Firebreath. Проблема в том, что я использую Xcode 4, и я не могу найти способ отладки своего проекта. Поэтому я подумал о том, вызван ли мой метод с веб-страницы.
Вот мой исходный код:
В моем OpenOnDesktopPluginAPI.h
классе:
class OpenOnDesktopPluginAPI : public FB::JSAPIAuto
{
public:
OpenOnDesktopPluginAPI(const OpenOnDesktopPluginPtr& plugin, const FB::BrowserHostPtr& host);
virtual ~OpenOnDesktopPluginAPI();
OpenOnDesktopPluginPtr getPlugin();
...
//This is my method
void runNotification();
...
};
В моем OpenOnDesktopPluginAPI.mm
классе:
OpenOnDesktopPluginAPI::OpenOnDesktopPluginAPI(const OpenOnDesktopPluginPtr& plugin, const FB::BrowserHostPtr& host) : m_plugin(plugin), m_host(host)
{
...
//Register my method
registerMethod("runNotification", make_method(this, &OpenOnDesktopPluginAPI::runNotification));
...
}
// Класс DistributedNotification - это мой класс target-c с реализацией для публикации распределенного уведомления.
void OpenOnDesktopPluginAPI::runNotification()
{
DistributedNotification * notificationClass = [[DistributedNotification alloc] init];
[notificationClass postNotification];
[notificationClass release];
}
По моему FBControl.html
:
...
функция myFunction ()
{
. Плагин () runNotification ();
}
...
Мой новый метод
...
Я положил DistributedNotification.mm
класс в
Build Phases -> "Compile Sources"
для моей цели плагина.
Но я не знаю, вызван ли мой метод runNotification
, потому что когда (на моей веб-странице) я нажимаю на ссылку My new method
, ничего не происходит.