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

Nullability & New Attribute Objects for Objective-C Templates #317

Merged
merged 3 commits into from
Mar 4, 2016

Conversation

justin
Copy link
Collaborator

@justin justin commented Mar 3, 2016

I'm working on getting our ObjC templates updates.

Here's what's new in this one:

  1. I replaced the old struct objects we were using for relationship and attribute names with first class NSObject instances. This lets us not annoy the Apple gods by putting NS objects inside structs, which is a no-no in ARC land. (__unsafe_unretained is cheating)
  2. Added nullability attributes where appropriate for attributes, relationships, and fetched properties.

I still want to add lightweight generic support, but that is going to require some internal surgery I think.

@rentzsch
Copy link
Owner

rentzsch commented Mar 4, 2016

instancetype: sure, awesome

nullable: sure, awesome

I was initially cold to replace the Mike-Ash-style structs with full-blown classes. I don't consider __unsafe_unretained in this very specific circumstance (static objects really existing to provide a missing language feature) cheating. But I've come around and this is Core Data code where Yet Another Message Send isn't going to even appear on the final bill of goods.

rentzsch added a commit that referenced this pull request Mar 4, 2016
…oh-my

Nullability & New Attribute Objects for Objective-C Templates
@rentzsch rentzsch merged commit 81b670f into develop Mar 4, 2016
@rentzsch rentzsch deleted the feature/objc-structs-and-nulls-oh-my branch March 22, 2016 18:48
@sixten
Copy link
Contributor

sixten commented Jul 21, 2016

Is there a specific reason why the primitive accessors don't get nullability annotations? It looks like optional properties still get primitives that don't allow nil values.

@rentzsch
Copy link
Owner

Hey @sixten I don't quite understand, does this fix what you are talking about? #343

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.

3 participants