问题
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