使用AFNetworking遇到的2个警告解决方法。

1.编译警告 object file (/Users/liangchris/Library/Developer/Xcode/DerivedData/ShowTracker-frpchxkxofnchfgnttvtdgvltekp/Build/Products/Debug-iphonesimulator/libAFNetworking.a(AFHTTPRequestOperationManager.o)) was built for newer iOS version (8.0) than being linked (7.0)

  


通过看提示得知是版本的问题:


通过修改版本可以解决,解决方法为: 

选择8.0或更高的版本号,这样就解决了版本号过低的提示。







2. 编译警告: 


/Users/liangchris/zw/ios_app/ShowTracker/Pods/AFNetworking/AFNetworking/AFHTTPRequestOperation.h:39:60: Auto property synthesis will not synthesize property 'response'; it will be implemented by its superclass, use @dynamic to acknowledge intention


在网上搜了一下,虽然说这个警告不影响使用,但是很碍眼,解决的这个问题的方法是升级AFNetworking的版本号,可见是源码本身存在的警告,最新版的已经解决了此问题。为了验证,我看了一下我的Podfile文件,果然里面的版本号是按照网上的教程写的2.2.1,修改使用最新版后解决了这个问题。

以下是Podfile的内容:


  1 source 'https://github.com/CocoaPods/Specs.git'

  2 # Uncomment this line to define a global platform for your project

  3 platform :ios, '8.0'

  4 # Uncomment this line if you're using Swift

  5 # use_frameworks!

  6

  7 target 'ShowTracker' do

  8 pod 'AFNetworking', '~> 2.5'

  9 #pod 'AFNetworking', '2.2.1'

 10 end


line10 那里是原来的版本号,line9是使用最新的版本号,至少高于2.5.

然后执行 pod install

liangchris@BluezdeMacBook-Pro:~/zw/ios_app/ShowTracker$ pod install

Updating local specs repositories

Analyzing dependencies

Downloading dependencies

Installing AFNetworking 2.6.1 (was 2.2.1)

Generating Pods project

Integrating client project

Pod installation complete! There is 1 dependency from the Podfile and 1 total pod installed.

liangchris@BluezdeMacBook-Pro:~/zw/ios_app/ShowTracker$

再重新编译一下就没有任何警告了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值