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

Need to skip certain properties for iOS 8 #244

Closed
wants to merge 1 commit into from

Conversation

NarendraPunchh
Copy link

No description provided.

@NarendraPunchh
Copy link
Author

Issue discussed here as well

@Deanosaurus
Copy link

@NarendraPunchh Sorry to come in from off the street but I think I know why they are showing up in the first place.

Removing the properties makes sense if you are traversing up a model tree of subclasses to get ALL of the properties but in this case you are just unintentionally pulling them in.

In JSONModel.h you declare:

@protocol AbstractJSONModelProtocol <NSObject, NSCopying, NSCoding>

Since AbstractJSONModelProtocol adheres to NSObject it automatically adds those four properties to any object that adheres to it because they are declared in the NSObject protocol.

I have an answer on StackOverflow that explains it a little bit more in detail.

Either way if you just remove that NSObject from that line you won't have to remove the properties at all because they won't be muddying up your runtime property list. One side-effect from this is the fact that when you loop through it in your JSONModel.m file you have to make the assumption that the objects are NSObject<AbstractJSONModelProtocol> * in type but there is rarely a situation you would have a class that is NOT a subclass of NSObject.

@icanzilb
Copy link
Collaborator

I went ahead with @Deanosaurus's proposal - it solved the issue in a cleaner way I think

@icanzilb icanzilb closed this Jan 21, 2015
icanzilb added a commit that referenced this pull request Jan 21, 2015
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

Successfully merging this pull request may close these issues.

None yet

3 participants