Difference between revisions of "Best Practices"

From iPhone Development Wiki
Jump to: navigation, search
(Created page with 'Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community…')
 
Line 1: Line 1:
 
Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community host.
 
Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community host.
 +
 +
== Applications and Tweaks ==
 
* Avoid referring to /var/mobile directly - use NSHomeDirectory() if your code is running as mobile!
 
* Avoid referring to /var/mobile directly - use NSHomeDirectory() if your code is running as mobile!
 +
* See [[MobileSubstrate Pitfalls]] for additional guidelines regarding tweaks.
 +
 +
== Packages ==
 
* Do not create mobile-owned files and/or directories in your package. Stay out of mobile's home directory!
 
* Do not create mobile-owned files and/or directories in your package. Stay out of mobile's home directory!
 
** All package files are installed as root, and hour app should create any required files or directories under mobile's home directory.
 
** All package files are installed as root, and hour app should create any required files or directories under mobile's home directory.

Revision as of 22:51, 19 November 2011

Use the following guidelines to avoid your package or app being fragile or breaking at the slightest gust of wind, and to increase the chances of it being accepted by a community host.

Applications and Tweaks

  • Avoid referring to /var/mobile directly - use NSHomeDirectory() if your code is running as mobile!
  • See MobileSubstrate Pitfalls for additional guidelines regarding tweaks.

Packages

  • Do not create mobile-owned files and/or directories in your package. Stay out of mobile's home directory!
    • All package files are installed as root, and hour app should create any required files or directories under mobile's home directory.
  • Do not use postinst/preinst/extrainst_ for file management purposes!
    • Do not store in the package directories that your app could make.
    • Do not enforce permissions that your package could (and arguably should) contain.