2

I'm in the process of the building a simple iphone application and I had a few questions.

I need to parse through results from an API key search, and manipulate them in my program. The API is from rotten tomatoes, and I can't find a parser that works with ARC. I know the JSON kit works well for previous versions of XCode, but I really like ARC and have done my application to date using it.

1) Is there a solid parser for such results or is it something I'm going to have to do manually?

The basic structure of my app includes a search page and personal list of things, using a mutable array of objects to populate a table view.

2) whats the best way to design the classes and implementation? I know this is a vague questions so let me be more specific. I have one object with several attributes, and I want to both access a remote server and rotten tomatoes API, and store local data internally. So I have my storyboad with a controller for each tab view (there are two). Then I have my object class. Do i need to create a controller specifically for it or can I manipulate (create and delete) in other controllers?

I can give some more specifics about the application, I'm just feeling a little overwhelmed as it is my first time working with Xcode. Any help would be appreciated.

WhatsGoud
  • 41
  • 2

3 Answers3

0

You can set a compiler flag on the implementations that aren't going to be used in ARC.

Use: -fno-objc-arc

enter image description here

WrightsCS
  • 50,551
  • 22
  • 134
  • 186
0

May i suggest you the NSJSONSerialization Class., it should work well with ARC as it is compatible with iOS 5 and above.

Or you can set the ARC flag to no in .m files that you would like it to be switched off. For that purpose you can refer a great answer here.

Community
  • 1
  • 1
iNoob
  • 3,364
  • 2
  • 26
  • 33
0

About the first question, you can turn ARC off on specific files, this allows you to mix ARC enabled with non-ARC enabled classes in the same project, Please refer to the answer of this question How can I disable ARC for a single file in a project?

About the second question Do you have two different classes that access the same api services? If yes i suggest that you create a common remote-request class, this class will do the request for you.

For example: Let say we have class1 (for tab1) and class2 (for tab2) And we have classCommonRequest(for both the requests) App delegate will hold a reference to the classCommonRequest

class1 and class2 can both access this class by using

YourAppDelegate *delegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];
//get your refrence of request handler class
MyRequestHandler *request = [delegate myRequestHandler];
//then use functions in it
[request fetchSth];

If your question was more specific i could give you better answers :) I hope this helped anyway

Community
  • 1
  • 1
Omar Abdelhafith
  • 21,163
  • 5
  • 52
  • 56