Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

项目引入后,报JSON异常 #1

Open
yorling opened this issue Aug 19, 2015 · 11 comments
Open

项目引入后,报JSON异常 #1

yorling opened this issue Aug 19, 2015 · 11 comments

Comments

@yorling
Copy link

yorling commented Aug 19, 2015

我项目有引入第三方项目SwiftyJSON的源码
在引入PhotoBrower项目后,SwiftyJSON报异常如下:
/Users/ap/Desktop/MyProjects/ap1983/ap1983/lib/SwiftyJSON/SwiftyJSON.swift:1007:32: 'JSON' is ambiguous for type lookup in this context

PhotoBrower项目中也有JSON类冲突了吗?
冯老师,这个要怎么搞?

@CharlinFeng
Copy link
Owner

有这种情况?你的意思是PhotoBrowser 和 SwiftyJSON不能共存是吗,即放一起,编译直接失败?

@CharlinFeng
Copy link
Owner

如果确实是,请发一个演示程序到1761904945@qq.com

@yorling
Copy link
Author

yorling commented Aug 19, 2015

已发送

@yorling
Copy link
Author

yorling commented Aug 19, 2015

确实不兼容。新建的测试项目,无其他代码,就只有这两个项目源码,编译报错

@CharlinFeng
Copy link
Owner

问题已找到,Haneke与SwiftJson确实冲突了。

Haneke中的Data.swift中也定义了一个Struct的JSON,
1.你可以查看两个定义是否一致,如果一致可手动删除删除定义即可
2.使用nameSpace解决
3.先在我的项目把Haneke的JSON修改名字,再引入即可

@CharlinFeng
Copy link
Owner

Haneke在使用上我遇到了若干bug,但目前在swift中没有比较好的图片下载框架,你也可以使用SDWebImage取代Haneke,不过需要oc混编

@yorling
Copy link
Author

yorling commented Aug 20, 2015

嗯,好的,我目前图片下载框架用的就是SDWebImage,谢谢!

@nnianhouss
Copy link

什么时候能更新到Swift2.0

@cherishloveyou
Copy link

kingfish 不行嘛

@CharlinFeng
Copy link
Owner

@cherishloveyou 你说的这个最低要求是iOS 8.0

@familysyan
Copy link

用Swifty.JSON可以解决编译错误

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants