0

私はfirebreathプロジェクトでObjective-C++を使用しています。問題は、Xcode 4を使用していて、プロジェクトをデバッグする方法が見つからないことです。そこで、自分のメソッドがWebページから呼び出されるかどうかを考えました。これが私のソースコードです:私の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クラスは、分散通知を投稿するための実装を備えた私のObjective-cクラスです。

void OpenOnDesktopPluginAPI::runNotification()
{
     DistributedNotification * notificationClass = [[DistributedNotification alloc] init]; 
    [notificationClass postNotification];
    [notificationClass release];
}

私の中でFBControl.html:...関数myFunction(){plugin()。runNotification(); }...私の新しいメソッド
..。

私は自分のDistributedNotification.mmクラスを

 Build Phases -> "Compile Sources"

私のプラグインターゲット用。しかしrunNotification、(私のWebページで)My new methodリンクをクリックしても何も起こらないため、メソッドが呼び出されているかどうかはわかりません。

4

1 に答える 1

0

質問されたら、フォーラムで言ったことを繰り返します。おそらく、あなたはまだその答えを見たことがないでしょう:

まず第一に、少なくとも一部のブラウザーでは Xcode4 でデバッグできます。コツは、接続するプロセスを見つけることです。

次に、いつでも NSLog を使用してコンソールにログを記録できます。3 番目に、log4cplus を使用できます ( http://www.firebreath.org/display/documentation/Loggingを参照)。

最後に、テストしているブラウザーを指定しておらず、何が起こるかを示していません。合理的に見えますが、どうやらうまくいきませんか?何がうまくいかないのですか?それは何をするためのものか?

遭遇したことに関する詳細な情報がなければ、有益なアドバイスを提供することはほぼ不可能です。

于 2011-10-13T20:36:39.530 に答える