Integrating Yelp API v2 into iOS 7 app

谁都会走 提交于 2019-12-08 05:25:12

问题


I thought this would have been a bit of a more seamless process. I downloaded the yelp api example (https://github.com/Yelp/yelp-api/tree/master/v2/ios) and assumed I could just 'build and run' and see an example with a request sent out on a buttonPressed event.

I've been reading here: How to integrate Yelp APi in iPhone application? and other places online but am getting a ton of errors when trying to integrate a basic test. I've signed up for an account, have an API v2 set of keys.

A lot of the errors seem to be related to the ARC and the yelp api trying to explicitly autorelease some of their objects.


回答1:


Mostly when you download full projects from somewhere on the internet they or not fully compatible with your setup. Sometimes (read: most of the time), you will have to take care of some errors.

In your case, I'm not sure from what you say if their sample project is, or is not, using ARC, but either way you can change the project settings whether or not to use ARC.

1) In xCode, go to your project (where you have Summary, Info, etc. on top) and go to "Build Settings".

2) Make sure the predicate is set to "All" instead of "Basic".

3) Search for "Automatic Reference Counting"

4) If everything is ok you should have 2 results:

  • Objective-C Automatic Reference Counting
  • Objective-C++ Automatic Reference Counting

5) Set both of them to "Yes" if you want to use ARC, or to "No" if you don't want to use ARC.




回答2:


This seems to simplify the problem: https://github.com/AFNetworking/AFOAuth1Client

If I put together something clean, I'll try to come back and post a link to a working, example



来源:https://stackoverflow.com/questions/21517565/integrating-yelp-api-v2-into-ios-7-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!