Hacker News new | past | comments | ask | show | jobs | submit login

I'm grateful that Apple at least prefixed this. IIRC, between iOS 11 and 12, Apple added a Contact class somewhere within their standard set of frameworks. I was maintaining an app that used CoreData as a store and did not have prefixed Core Data entity names. And of course it had its own Contact class.

Long story short, I started building against the newer SDK and the app started crashing in the most oblique way possible. Prefixing the entity and class name solved the problem, but I only stumbled on that through a combination of luck, intuition, and half a day of banging my head against a wall.




Apple recommends to use at least a three character prefix in your objective-c classes to avoid collisions.


I am well-acquainted with Apple's recommendations. The codebase I inherited was not. Unfortunately, Apple's Core Data documentation is also not acquainted with Apple's recommendations: https://developer.apple.com/library/archive/documentation/Co...




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: