3 ms·
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 wa
by aaronbrethorst 7y ago
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.
- galad87 7y agoApple recommends to use at least a three character prefix in your objective-c classes to avoid collisions.
- aaronbrethorst 7y agoI 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/Cocoa/Conceptual/CoreData/KeyConcepts.html https://developer.apple.com/library/archive/documentation/Co...