{"id":7857,"date":"2023-09-18T17:50:35","date_gmt":"2023-09-18T09:50:35","guid":{"rendered":"https:\/\/h5app.yimenapp.cn\/h5app\/?p=7857"},"modified":"2023-09-18T17:50:35","modified_gmt":"2023-09-18T09:50:35","slug":"ios%e6%89%93%e5%8c%85%e6%88%90sdk%e6%9c%89%e4%bb%80%e4%b9%88%e7%94%a8%e9%80%94%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/h5app.yimenapp.cn\/h5app\/2023\/sjapp\/7857\/","title":{"rendered":"ios\u6253\u5305\u6210sdk\u6709\u4ec0\u4e48\u7528\u9014\uff1f"},"content":{"rendered":"<p>iOS\u6253\u5305\u6210SDK\u662f\u5c06iOS\u9879\u76ee\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u4f9b\u5176\u4ed6\u5f00\u53d1\u8005\u4f7f\u7528\u7684\u5e93\u6587\u4ef6\uff0c\u4e00\u822c\u4ee5.framework\u5f62\u5f0f\u63d0\u4f9b\u3002\u8fd9\u6837\u5176\u4ed6\u5f00\u53d1\u8005\u5c31\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u5f15\u5165\u8be5\u5e93\u6587\u4ef6\uff0c\u65b9\u4fbf\u5feb\u6377\u5730\u4f7f\u7528\u5176\u4e2d\u7684\u529f\u80fd\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecdiOS\u6253\u5305\u6210SDK\u7684\u539f\u7406\u548c\u6b65\u9aa4\u3002<\/p>\n<p>\u4e00\u3001SDK\u7684\u539f\u7406<\/p>\n<p>iOS S<\/p>\n<p><figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/i.cdn.yimenapp.com\/2023-03\/20\/14\/30529677160.jpg\" \/><\/figure>\n<\/p>\n<p>DK\u7684\u672c\u8d28\u662f\u4e00\u4e2a\u9759\u6001\u5e93\uff0c\u5b83\u662f\u7531\u591a\u4e2a.o\u6587\u4ef6\u94fe\u63a5\u800c\u6210\u7684\u3002\u9759\u6001\u5e93\u7684\u7279\u70b9\u662f\u5728\u7f16\u8bd1\u65f6\u88ab\u94fe\u63a5\u5230\u5e94\u7528\u7a0b\u5e8f\u4e2d\uff0c\u4e0e\u5e94\u7528\u7a0b\u5e8f\u4e00\u8d77\u6253\u5305\u53d1\u5e03\uff0c\u8fd0\u884c\u65f6\u4e0d\u9700\u8981\u518d\u52a0\u8f7d\u3002\u56e0\u6b64\uff0c\u4f7f\u7528\u9759\u6001\u5e93\u53ef\u4ee5\u63d0\u9ad8\u5e94\u7528\u7a0b\u5e8f\u7684\u6027\u80fd\u3002<\/p>\n<p>\u4e8c\u3001SDK\u7684\u6253\u5305\u6b65\u9aa4<\/p>\n<p>1. \u521b\u5efa\u9759\u6001\u5e93\u9879\u76ee<\/p>\n<p>\u9996\u5148\uff0c\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u9759\u6001\u5e93\u9879\u76ee\u3002\u5728Xcode\u4e2d\uff0c\u9009\u62e9File-&gt;New-&gt;Project\uff0c\u9009\u62e9iOS-&gt;Framework &amp; Library-&gt;Cocoa Touch Static Library\uff0c\u7136\u540e\u70b9\u51fbNext\uff0c\u8f93\u5165\u9879\u76ee\u540d\u79f0\u3001\u9009\u62e9\u5b58\u653e\u8def\u5f84\u7b49\uff0c\u6700\u540e\u70b9\u51fbCreate\u3002<\/p>\n<p>2. \u7f16\u5199\u4ee3\u7801<\/p>\n<p>\u5728\u521b\u5efa\u597d\u7684\u9759\u6001\u5e93\u9879\u76ee\u4e2d\uff0c\u53ef\u4ee5\u6dfb\u52a0\u9700\u8981\u7684\u4ee3\u7801\u6587\u4ef6\u3001\u8d44\u6e90\u6587\u4ef6\u7b49\u3002\u7f16\u5199\u4ee3\u7801\u65f6\u9700\u8981\u6ce8\u610f\uff0c\u9759\u6001\u5e93\u9879\u76ee\u4e2d\u7684\u4ee3\u7801\u9700\u8981\u5c3d\u91cf\u907f\u514d\u4f7f\u7528\u4e0e\u5176\u4ed6\u9879\u76ee\u4e2d\u53ef\u80fd\u5b58\u5728\u51b2\u7a81\u7684\u547d\u540d\u3001\u7c7b\u3001\u65b9\u6cd5\u7b49\u3002<\/p>\n<p>3. \u914d\u7f6eBuild Settings<\/p>\n<p>\u5728\u9759\u6001\u5e93\u9879\u76ee\u7684Build Settings\u4e2d\uff0c\u9700\u8981\u8bbe\u7f6e\u4ee5\u4e0b\u51e0\u4e2a\u9009\u9879\uff1a<\/p>\n<p>(1) Base SDK: \u9009\u62e9\u6700\u4f4e\u652f\u6301\u7684iOS\u7248\u672c\u3002<\/p>\n<p>(2) Architectures: \u9009\u62e9\u9700\u8981\u652f\u6301\u7684CPU\u67b6\u6784\uff0c\u4e00\u822c\u9009\u62e9armv7\u3001arm64\u3002<\/p>\n<p>(3) Build Active Architecture Only: \u8bbe\u7f6e\u4e3aNO\uff0c\u8fd9\u6837\u53ef\u4ee5\u540c\u65f6\u652f\u6301\u6a21\u62df\u5668\u548c\u771f\u673a\u3002<\/p>\n<p>(4) Other Linker Flags: \u6dfb\u52a0-lc++\uff0c\u8fd9\u662f\u4e3a\u4e86\u652f\u6301C++\u4ee3\u7801\u3002<\/p>\n<p>4. \u7f16\u8bd1\u9759\u6001\u5e93<\/p>\n<p>\u7f16\u5199\u597d\u4ee3\u7801\u5e76\u914d\u7f6e\u597dBuild Settings\u540e\uff0c\u53ef\u4ee5\u9009\u62e9Build-&gt;Build Library For Archive\uff0c\u7f16\u8bd1\u9759\u6001\u5e93\u3002\u7f16\u8bd1\u6210\u529f\u540e\uff0c\u53ef\u4ee5\u5728\u9879\u76ee\u76ee\u5f55\u4e0b\u7684Produc<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-1783.html\">apkapp<\/a>ts\u6587\u4ef6\u5939\u4e2d\u627e\u5230\u751f\u6210\u7684\u9759\u6001\u5e93\u6587\u4ef6\u3002<\/p>\n<p>5. \u6253\u5305\u6210SDK<\/p>\n<p>\u5c06\u751f\u6210\u7684\u9759\u6001\u5e93\u6587\u4ef6\u62f7\u8d1d\u5230\u4e00\u4e2a\u65b0\u7684\u6587\u4ef6\u5939\u4e2d\uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u5934\u6587\u4ef6\uff0c\u5c06\u9700\u8981\u5bf9\u5916\u66b4\u9732\u7684\u7c7b\u3001\u65b9\u6cd5\u7b49\u58f0\u660e\u5728\u5934\u6587\u4ef6\u4e2d\u3002\u6700\u540e\u5c06\u5934\u6587\u4ef6\u548c\u9759\u6001\u5e93\u6587\u4ef6\u4e00\u8d77\u6253\u5305\uff0c\u5c31\u5f97\u5230\u4e86\u4e00\u4e2a\u53ef\u4f9b\u5176\u4ed6\u5f00\u53d1\u8005\u4f7f\u7528\u7684SDK\u3002<\/p>\n<p>\u4e09\u3001SDK\u7684\u4f7f\u7528<\/p>\n<p>\u5176\u4ed6\u5f00\u53d1\u8005\u53ef\u4ee5\u5c06\u6253\u5305\u597d\u7684SDK\u6587\u4ef6\u5bfc\u5165\u5230\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u3002\u5728\u9879\u76ee<a href=\"https:\/\/appdabao.yimenapp.com\/jiage-541.html\">\u6253\u5305app\u5de5\u5177<\/a>\u4e2d\u5f15\u5165SDK\u540e\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u4f7f\u7528SDK\u4e2d\u66b4\u9732\u51fa\u6765\u7684\u7c7b\u3001\u65b9\u6cd5\u7b49\u3002<\/p>\n<p>\u4f8b\u5982\uff0c\u5047\u8bbe\u6709\u4e00\u4e2a\u540d\u4e3aMySDK\u7684SDK\uff0c\u5176\u4e2d\u66b4\u9732\u4e86\u4e00\u4e2a\u540d\u4e3aMyClass\u7684\u7c7b\u548c\u4e00\u4e2a\u540d\u4e3amyMethod\u7684\u65b9\u6cd5\u3002\u5728\u5176\u4ed6\u9879\u76ee\u4e2d\u4f7f\u7528\u8be5SDK\u65f6\uff0c\u53ef\u4ee5\u5728\u4ee3\u7801\u4e2d\u8fd9\u6837\u5f15\u5165\uff1a<\/p>\n<p>#import <\/p>\n<p><p>\u7136\u540e\u5c31\u53ef\u4ee5\u4f7f\u7528MyClass\u548cmyMethod\u4e86\uff1a<\/p>\n<p>MyClass *myObj = [[MyClass alloc] init];<\/p>\n<p>[myObj myMethod];<\/p>\n<p>\u56db\u3001\u6ce8\u610f\u4e8b\u9879<\/p>\n<p>\u5728\u6253\u5305SDK\u65f6\u9700\u8981\u6ce8\u610f\u4ee5\u4e0b\u51e0\u70b9\uff1a<\/p>\n<p>1. \u9759\u6001\u5e93\u9879\u76ee\u4e2d\u7684\u4ee3\u7801\u9700\u8981\u5c3d\u91cf\u907f\u514d\u4e0e\u5176\u4ed6\u9879\u76ee\u4e2d\u53ef\u80fd\u5b58\u5728\u51b2\u7a81\u7684\u547d\u540d\u3001\u7c7b\u3001\u65b9\u6cd5\u7b49\u3002<\/p>\n<p>2. \u6253\u5305SDK\u65f6\u9700\u8981\u5c06\u9700\u8981\u5bf9\u5916\u66b4\u9732\u7684\u7c7b\u3001\u65b9\u6cd5\u7b49\u58f0\u660e\u5728\u5934\u6587\u4ef6\u4e2d\u3002<\/p>\n<p>3. \u9759\u6001\u5e93\u9879\u76ee\u4e2d\u9700\u8981\u8bbe\u7f6e\u6b63\u786e\u7684Build Settings\uff0c\u5426\u5219\u53ef\u80fd\u4f1a\u5bfc\u81f4\u7f16\u8bd1\u5931\u8d25\u6216\u8005\u8fd0\u884c\u65f6\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n<p>4. SDK\u7684\u4f7f\u7528\u9700\u8981\u6ce8\u610f\u7248\u672c\u517c\u5bb9\u6027\uff0c\u907f\u514d\u51fa\u73b0\u7248\u672c\u4e0d\u517c\u5bb9\u7684\u60c5\u51b5\u3002<\/p>\n<p>\u603b\u4e4b\uff0c\u5c06iOS\u9879\u76ee\u6253\u5305\u6210SDK\u53ef\u4ee5\u65b9\u4fbf\u5176\u4ed6\u5f00\u53d1\u8005\u4f7f\u7528\u5176\u4e2d\u7684\u529f\u80fd\uff0c\u63d0\u9ad8\u4ee3\u7801\u590d\u7528\u7387\uff0c\u52a0\u5feb\u5f00\u53d1\u901f\u5ea6\u3002\u4f46\u662f\u6253\u5305SDK\u9700\u8981\u6ce8\u610f\u4e00\u4e9b\u7ec6\u8282\u548c\u6ce8\u610f\u4e8b\u9879\uff0c\u907f\u514d\u51fa\u73b0\u95ee\u9898\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iOS\u6253\u5305\u6210SDK\u662f\u5c06iOS\u9879\u76ee\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u4f9b\u5176\u4ed6\u5f00\u53d1\u8005\u4f7f\u7528\u7684\u5e93\u6587\u4ef6\uff0c\u4e00\u822c\u4ee5.framework\u5f62\u5f0f\u63d0\u4f9b\u3002\u8fd9\u6837\u5176\u4ed6\u5f00\u53d1\u8005\u5c31\u53ef\u4ee5\u5728\u81ea\u5df1\u7684\u9879\u76ee\u4e2d\u5f15\u5165\u8be5\u5e93\u6587\u4ef6\uff0c\u65b9\u4fbf\u5feb\u6377\u5730\u4f7f\u7528\u5176\u4e2d\u7684\u529f\u80fd\u3002\u4e0b\u9762\u5c06\u8be6\u7ec6\u4ecb\u7ecdiO<\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[13811,13812,81,189,913],"topic":[],"class_list":["post-7857","post","type-post","status-publish","format-standard","hentry","category-sjapp","tag-app","tag-tvapp","tag-81","tag-189","tag-913"],"_links":{"self":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/7857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/comments?post=7857"}],"version-history":[{"count":0,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/posts\/7857\/revisions"}],"wp:attachment":[{"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/media?parent=7857"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/categories?post=7857"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/tags?post=7857"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/h5app.yimenapp.cn\/h5app\/wp-json\/wp\/v2\/topic?post=7857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}