Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は両方に気づきました:
Components.classes["@me.org/mycomponent;1"].createInstance();
と
Components.classes["@me.org/mycomponent;1"].getService();
xul コンポーネントを取得する場合と同じように機能します。それで、どちらかを使用することの違いは何ですか?
getServiceシングルトンを作成しますcreateInstanceが、呼び出すたびに新しいインスタンスを作成します。 getService毎回同じオブジェクトを返します。
getService
createInstance