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

Add Relationship Support #5

Open
stevederico opened this issue Jan 2, 2013 · 1 comment
Open

Add Relationship Support #5

stevederico opened this issue Jan 2, 2013 · 1 comment

Comments

@stevederico
Copy link
Owner

Add Support for related objects in new views

@slessard
Copy link
Contributor

I'm hitting this problem. My app is crashing in this code in SDScaffoldAddViewController.m

    //Get Attribute Types from Entity
    for (NSPropertyDescription *property in _entityDescription) {
        [_attributeTypes addObject:[property valueForKey:@"attributeType"]];
    }

The issue is that property could point to NSAttributeDescription or NSRelationshipDescription. As long as property points to NSAttributeDescription everything works great. When property points to NSRelationshipDescription the app crashes due to the uncaught exception: NSUnknownKeyException as shown below.

2013-04-21 18:33:11.859 SCScaffoldSyncTest[1807:c07] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<NSRelationshipDescription 0x7caca50> valueForUndefinedKey:]: this class is not key value coding-compliant for the key attributeType.'

I could resolve this crash by first checking whether property points to NSAttributeDescription before calling valueForKey, but I doubt that would be the correct fix.

Could you explain what would be involved in implementing the correct fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants