如何在无ARC项目的情况下使用新的iOS Google Maps SDK [英] How to work with new iOS Google Maps SDK under no ARC project
问题描述
我正在尝试将新的Google Maps API添加到我的iOS应用程序中,但是它尚未使用ARC.因此,检查文档后,我认为必须具有ARC,SDK才能正常工作.我该怎么办?我的意思是仅针对与Google地图一起使用的资源激活ARC. (.xib文件,控制器)该怎么办?
I'm trying to add the new Google Maps API into my iOS application, however it does not use ARC yet. So, checking at the docs I think it's a requirement to have ARC in order for the SDK to work. How could I do that? I mean an option would be activating ARC just for the resources that will work with Google maps. (.xib files, controllers) How could that be done?
推荐答案
您可以通过添加编译器标志 -fno-objc-arc
you can disable ARC for individual files by adding a compiler flag -fno-objc-arc
此标志告诉编译器文件不是基于ARC的.
This flag tells the compiler that the files are not ARC based.
要执行此操作
- 选择目标
- 转到构建阶段"标签
- 扩展编译源
- 选择不是基于Arc的文件
- 按Enter
- 在出现的对话框中输入文本 -fno-objc-arc
- 完成
- Select the target
- Go to Build Phases tab
- Expand the Compile Sources
- Select the files which are not Arc based
- Press Enter
- In the appeared dialog box enter the text -fno-objc-arc
- Done
For more reference please check this question how-can-i-disable-arc-for-a-single-file-in-a-project
这篇关于如何在无ARC项目的情况下使用新的iOS Google Maps SDK的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!