Arpit Parekh Arpit Parekh - 2 months ago 16
Objective-C Question

want to convert NSDictionary to Model objects

In my iPhone App.

What I am trying to achieve is this?

I want to convert the NSdictionary Objects to Model objects.

I have less experience in creating Model objects.

Update:

I solved by using IAModelBase class on GitHub.IAModelBase

OR

Please suggest me some design patterns to solve it.

Answer

If it is subclass of NSMutableArray then you can add object like,

  [self addObject:newsArticle];

in your for loop and return self will return your final mutable array and you can use it as per desired need!

And refer Apple documentation for more detail. You have to implement some mandatory methods if you want to subclass the NSMutableArray.