2009-02-27 14 views
8

मैंने इसे विंडोज़ में किया है, मै मैक ओएसएक्स पर प्रोटोकॉल कैसे पंजीकृत करूं। मैं फ़ायरफ़ॉक्स में लिंक क्लिक करना चाहता हूं (a href = "somename: // mylinkAndData") और बाइनरी लॉन्च करें?मैक ओएसएक्स पर प्रोटोकॉल पंजीकृत करें?

उत्तर

13

ऐप्पल के Launch Services Programming Guide पर एक नज़र डालें। आपको अपने ऐप्स Info.plist पर CFBundleURLTypes जोड़ना होगा और LSRegisterURL() के साथ अपना ऐप पंजीकृत करना होगा।

अंश से Firefox.app/Contents/Info.plist:

<key>CFBundleURLTypes</key> 
    <array> 
      <dict> 
        <key>CFBundleURLIconFile</key> 
        <string>document.icns</string> 
        <key>CFBundleURLName</key> 
        <string>http URL</string> 
        <key>CFBundleURLSchemes</key> 
        <array> 
          <string>http</string> 
        </array> 
      </dict> 
.... 

संपादित करें: एक कैसे लेख

के लिए Handling URL schemes in Cocoa देखें