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

Rename +entityName ? #196

Closed
rentzsch opened this issue Apr 12, 2014 · 11 comments
Closed

Rename +entityName ? #196

rentzsch opened this issue Apr 12, 2014 · 11 comments
Milestone

Comments

@rentzsch
Copy link
Owner

@tonyarnold mentions in #170:

there's a private method on NSManagedObject that's causing app store validation to throw warnings

Thoughts:

  • I just class-dump-ed CoreData.framework for both 10.9.2 and iOS 7.1 and couldn't find +[NSManagedObject entityName]. There's not even an -[NSManagedObject entityName]. I haven't seen this warning myself, does it actually point the finger at NSManagedObject?
  • I'm open to a renaming +entityName just to avoid this warning. We've performed these types of work-arounds in the past.

What's a good, non-conflicting name? I'd like to avoid simple prefixing like +mo_entityName since the other methods aren't currently prefixed like that.

Perhaps something like +entityNameString (ugh) or +modelEntityName (still ugh, but better to my eyes)?

@rentzsch
Copy link
Owner Author

see also #195

@tonyarnold
Copy link
Contributor

I'm not sure — entityName is perfect, but if you run the following in a vanilla app without anything but the CoreData and Foundation frameworks imported, you get a return of YES:

NSLog(@"Responds to entityName: %i", [NSManagedObject instancesRespondToSelector:NSSelectorFromString(@"entityName")]);
NSLog(@"Responds to entityName: %i", [NSManagedObject respondsToSelector:NSSelectorFromString(@"entityName")]);

It's definitely in there somewhere — I'm not sure where it's coming from though (a wayward category in the SDK?).

Perhaps +nameOfEntity? Nothing is going to be as succinct as the original, sadly.

@tonyarnold
Copy link
Contributor

We've also had reports of users getting warnings for entityInManagedObjectContext: and insertInManagedObjectContext:: magicalpanda/MagicalRecord#74 (although I couldn't reproduce either of these).

Seems awfully odd that the entityName method is not coming from NSManagedObject, though.

@rentzsch
Copy link
Owner Author

Ooo, I bet +entityName may be coming from when EOF support was pushed into Foundation in the Stone Ages.

Even a Foundation tool with NSObject passes the test:

NSLog(@"Responds to entityName: %i", [NSObject instancesRespondToSelector:NSSelectorFromString(@"entityName")]);

Nice detective work.

I like +nameOfEntity. Well, I dislike it least 😉 Sounds like you do too.

@tonyarnold
Copy link
Contributor

Perfect, I'll work up a PR!

@tonyarnold
Copy link
Contributor

And amend my snarky radar… 😒

@rentzsch
Copy link
Owner Author

For the record, NSObject doesn't respond to entityName on iOS 7.1 (hardware or simulator).

@tonyarnold
Copy link
Contributor

Odd — I could have sworn we had a few reports from iOS users. Oh well, it's good that it's not a problem there. So what's the plan? You mentioned on twitter that you have an idea for a workaround.

I assume given some of the eyeballs on our conversation and your post, the whitelist will probably be updated for the validator soonish.

@rentzsch
Copy link
Owner Author

I'm expecting to know more on Monday. So holding position until then.

@segiddins
Copy link

@rentzsch can't we close this issue out now?

@rentzsch
Copy link
Owner Author

Yeah, I think so. Closing.

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

No branches or pull requests

3 participants