问题标签 [embedded-binary]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
2807 浏览

ios - Building a Swift Framework with Xcode 7 (Beta 3) to use as an Embedded Binary

Ever since Embedded Binaries were introduced in iOS 8, I have been wanting to port a lot of my common code into frameworks. I decided to wait one year before doing it and this year, with Xcode 7 Beta and iOS 9, I'm starting to do that just that.

I have started a Cocoa Touch framework project in Xcode 7 and I want to compile it into a usable framework. I can get it to compile my project into a .framework, but there's a few issues; namely, the framework doesn't appear to be importable into new projects (I will describe the steps I did for that shortly). Because of that, I'm not sure if my framework has any visible symbols.

This is what I have done to create the Framework:

  1. Created my Framework as a Cocoa Touch Framework.
  2. Went to my target's Build Phases, went to Headers, and added all my Swift files to the "Public" section, in hopes that will export all my simbols without having to mark them as public.
  3. I tried to archive my project as a framework. Currently, it looks like Xcode 7 Beta 3 has a bug (going to report it later today) in which it generates corrupted archive files. For this reason I couldn't get my framework from the Organizer Window. To work around this, I changed the schema of the Run action in Xcode from Debug to Release, built it and grabbed it's generated .framework from my project's build/iphoneos-release directory. This was a quick test so I didn't need the frameworks generated for emulators.

And this is what I did to try to add the framework to a new project:

  1. Created a "Frameworks" group (for organizational purposes) and dragged the framework there, selecting "yes" when it asked me if I want to copy the file to my project's directory.
  2. Went to my target's settings, removed my framework from "Linked Libraries" (it was added there automatically), added it to Embedded Binaries instead. This added the framework to Linked Libraries again, so I had to remove it from there twice. Leaving the framework in Linked Libraries causes a linker error (can't find the framework - no idea why but I think it's irrelevant to my problem and something I should report to Apple as well), but once you remove it from there it seems to compile fine when you add it to Embedded Binaries.
  3. Tried to import my framework in a file. Xcode complains there is "no such module".

Unfortunately, despite the fact that embedded frameworks have been around for around a year, I can't find much writing on the topic.

So my question is: Am I creating the framework correctly, making it possible that my framework/anything else is failing due to an Xcode 7 Beta bug? Or is there a different procedure to create a framework that I want to use as an Embedded Binary? I should probably mention that I want to make this library open source, and I think distributing a plain .framework file to the people who want to use it would be neat.

0 投票
3 回答
36329 浏览

ios - 我们什么时候应该在 Xcode 中使用“嵌入式二进制文件”而不是“链接框架”?

如Link Binary with libraries VS Embed Frameworks中所述,关于这两个选项之间的区别有一个很好的问题。

似乎我们可以选择同时使用它们,只是想知道在哪种情况下我们应该更好地使用嵌入式二进制文件,还是使用链接框架?

有什么可靠的例子可以更清楚地解决这个问题吗?谢谢

0 投票
0 回答
780 浏览

xcode - 未找到 Xcode 11.3.1 嵌入式二进制文件部分

我在 React Native 项目中使用 Xcode 11.3.1。

我应该在“常规”选项卡的“嵌入式二进制文件”部分添加一个框架,但该部分未显示。

感谢您的解释

0 投票
1 回答
120 浏览

xcode - 如何在 SwiftUI Mac 应用程序中运行嵌入式二进制文件?

我正在尝试开发一个基于 XIDEL 的非常简单的 XML 验证器。

到目前为止,这是我的 SwiftUI 代码,它执行嵌入式 XIDEL 二进制文件,但我不知道如何传递应该验证的 XML。我的目标是从我的计算机中选择一个 XML 文件,并在我的应用程序内的内容视图中显示 XIDEL 结果。

}

在此处输入图像描述