首页 \ 问答 \ Swift没有在Build Options下添加Ob-C桥接头文件的选项(Swift no option to add an Ob-C bridging header file under Build Options)

Swift没有在Build Options下添加Ob-C桥接头文件的选项(Swift no option to add an Ob-C bridging header file under Build Options)

我使用Cocoapods为我的Swift项目添加了一些Objective C文件。 我使用File-> New-> File IOS Source Header File创建了一个Bridging-Header.h文件。 它在项目中。 请参阅左侧带有项目文件的屏幕截图。 我现在需要将该文件添加到Project Build Settings - > Swift Compiler - Code Generation。

问题是(参见屏幕截图)添加Bridge文件的选项不存在! ??? 我无法在网络,cocoapods或苹果的任何地方找到这样的问题的参考。 任何人都可以建议一种方法来获得添加桥接文件的选项出现在构建设置中

在此处输入图像描述


I have added some Objective C files to my Swift project using Cocoapods. I created a Bridging-Header.h file using File->New->File IOS Source Header File. It is in the project. See screen shot with project files on left. I now need to add that file to the Project Build Settings -> Swift Compiler - Code Generation.

The problem is (see screen shot) that the option to add the Bridge file does not exist!!! ??? I cannot find a reference to a problem like this anywhere on the web, cocoapods or apple. Can anyone suggest a way to get the option to add the bridging file appear in the Build Settings

enter image description here


原文:https://stackoverflow.com/questions/30405358
更新时间:2021-11-21 07:11

最满意答案

看起来您在本地计算机上运行该代码并尝试连接到Google Compute Engine VM; 默认情况下,GCE具有严格的防火墙设置,以避免将外部IP地址暴露给任意入站连接。 如果您使用的是默认值,那么您的Hadoop集群应该位于“默认”GCE网络上。 您需要按照添加防火墙说明来允许端口8020上的传入TCP连接以及其他Hadoop端口上的连接以及本地IP地址以实现此操作。 它看起来像这样:

gcloud compute firewall-rules create allow-http \
    --description "Inbound HDFS." \
    --allow tcp:8020 \
    --format json \
    --source-ranges your.ip.address.here/32

请注意,您确实希望避免打开0.0.0.0/0源范围,因为Hadoop没有对这些传入请求进行身份验证或授权。 您需要尽可能地将其限制为仅计划拨入的入站IP地址。您可能还需要打开其他几个端口,具体取决于您使用哪种功能连接到Hadoop。

更一般的建议是,只要有可能,您应该尝试在Hadoop集群本身上运行代码; 在这种情况下,您将使用主主机名本身作为HDFS权限而不是外部IP:

hdfs://<master hostname>/foo/bar

这样,您可以将端口暴露限制在仅仅SSH端口22,SSH端口守护程序正确地控制传入流量,然后您的代码不必担心哪些端口是打开的,甚至不必担心处理IP地址所有。


It looks like you're running that code on your local machine and trying to connect to the Google Compute Engine VM; by default, GCE has strict firewall settings to avoid exposing your external IP addresses to arbitrary inbound connections. If you're using defaults then your Hadoop cluster should be on the "default" GCE network. You'll need to follow the adding a firewall instructions to allow incoming TCP connections on port 8020 and possible on other Hadoop ports as well from your local IP address for this to work. It'll look something like this:

gcloud compute firewall-rules create allow-http \
    --description "Inbound HDFS." \
    --allow tcp:8020 \
    --format json \
    --source-ranges your.ip.address.here/32

Note that you really want to avoid opening a 0.0.0.0/0 source-range since Hadoop isn't doing authentication or authorization on those incoming requests. You'll want to restrict it as much as possible to only the inbound IP addresses from which you plan to dial in. You may need to open up a couple other ports as well depending on what functionality you use connecting to Hadoop.

The more general recommendation is that wherever possible, you should try to run your code on the Hadoop cluster itself; in that case, you'll use the master hostname itself as the HDFS authority rather than external IP:

hdfs://<master hostname>/foo/bar

That way, you can limit the port exposure to just the SSH port 22, where incoming traffic is properly gated by the SSH daemon, and then your code doesn't have to worry about what ports are open or even about dealing with IP addresses at all.

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)