Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

List of already used objective-c Prefixes

I'm looking to choose a namespace for a library I'm writing and I'd like to avoid conflicts with other namespaces.

Does anyone know of a website that lists all of the class prefixes in use?

like image 788
Brian King Avatar asked Apr 29 '10 14:04

Brian King


3 Answers

https://cocoadev.github.io/ChooseYourOwnPrefix/ is probably your best bet. It's not "official", but it's a place a lot of devs would look.

In practice, as long as you don't use one that Apple uses, you'll probably be fine.

like image 88
bdrister Avatar answered Oct 29 '22 02:10

bdrister


According to the Apple "Programming in Objective C" document of 2012-12-13, Apple reserves all 2 character prefixes for use in their frameworks. Users are encouraged to employ 3 character prefixes when naming their classes to avoid conflicts with Apple. See the "Conventions" section for details.

like image 11
Bromo Avatar answered Oct 29 '22 02:10

Bromo


As an alternative to initial-letters prefixes:

  • If you're writing an application, use no prefix. You're unlikely to encounter another class named AppController in your app.
  • Otherwise, use the product name as the prefix. For example, if you've written a color picker named “Whizbang”, name its principal class “WhizbangColorPicker”.
like image 4
Peter Hosey Avatar answered Oct 29 '22 02:10

Peter Hosey