April 18, 2011

TIL: const, NSError, NSApplicationsupportDirectory


  • const char *foo; is not the same as char * const foo; The former declares a pointer to constant char, while the latter declares a constant pointer to char.
  • - [NSError localizedDescription] returns the object for key NSLocalizedDescriptionKey in the error's userInfo dictionary. I always wondered how to set it since there is no setLocalizedDescription:.
  • On iOS the application's Application Support directory doesn't seem to exist by default, unlike the Documents directory. This has to be created programmatically.

Cheers,
Steve