error: 'retainCount' is unavailable: not available in automatic reference counting mode
后来发现是编译选项的问题:
1.点击工程名 打开编译选项
2.在编译选项中,选择Bulid Setting选项卡
3.在Apple LLVM compiler X.X - Language项目中,找到Ojective-C Automatic Reference couting 选项
(直接搜索这个项目 或者搜arc)
4.把默认的yes 修改成no。