*A sandboxed app needs to read and write all of its preference data and so forth from...
"Library/Containers/com.yourcompany.YourApp/Data/Library/Application Support/Your App/"
If your app is sandboxed, GetHomeDirectory() doesn't return your usual directory. It returns "/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/", the sandboxed containers folder for the app.
But when your sandboxed app first launches, it automatically creates...
"/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/Library/Application Support/"
So you just need to create AppName (Sprite Monkey in my case) directory to store your preference files and so forth.
"/Users/jbaker/Library/Containers/com.posemotion.spritemonkey/Data/Library/Application Support/Sprite Monkey/"
1.) You have to purchase a Developers lincense which is $99 plus tax USD. Make sure to select Mac Developer and NOT iOS Developer. You'll need a bank account in order for Apple to pay you for your sales. So get your bank information ready when you're ready to purchase your license.
2.) You'll eventually get an email with an activation code to complete your license purchase. You'll need to click the link to activate the account.
3.) Sign in to your new account at https://developer.apple.com/.
4.) Click on "Mac Dev Center".
5.) Click on the "Learn More" under "Get Your Mac Apps Ready for the Mac App Store".
6.) Scroll down and click on "Register your App ID". This is the page where you will create your "App ID" and "Certificates". You create two certificates. One for the app and one for the installer.
7.) Download your certificates and double click on them to import them into "Keychain Access". You can close "Keychain Access" now but remember their names.
8.) Right click on your app and choose "Show Package Contents". Open "Contents" folder. Open your info.plist in "TextEdit". Make sure it matches the following and "LSApplicationCategoryType" stays at the top or your app could get rejected. Edit where needed.
9.) Save it and close "TextEdit".<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>LSApplicationCategoryType</key>
<string>public.app-category.developer-tools</string>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>Your App Name</string>
<key>CFBundleGetInfoString</key>
<string>Your App Name 1.0, Copyright © 2012 Company Name Inc. All rights reserved.</string>
<key>CFBundleIconFile</key>
<string>icon.icns</string>
<key>CFBundleIdentifier</key>
<string>com.company name.app name</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>Your App Name</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSignature</key>
<string>PURE</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>LSMinimumSystemVersion</key>
<string>10.6</string>
</dict>
</plist>
10.) Now you need to create an entitlements (Your App.entitlements) file. This can be done in TextEdit. Just make sure to change the extension to ".entitlements". This file has to be signed with your app and allows your app to function when sandboxed. But you need to have the correct entitlements in it. You can find more on entitlements here...
http://developer.apple.com/library/ios/ ... ments.html
The following sandboxes the app, allows open and save requesters and allows an app to read/write anywhere in or below a users home folder...
*Just a note. The last temporary entitlement allows my app to export files not noted in the SaveFileRequester(). If your app only exports a single file that is named in the SaveFileRequester(), you should be fine without it. Also, if you add an extension (*.png or whatever) in the SaveFileRequester(), make sure to do it there. Else if your app checks for it later and adds it, the sandboxed app will not export the file. As it only sees the original Result$ from the SaveFileRequester().<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
<key>com.apple.security.temporary-exception.files.home-relative-path.read-write</key>
<array>
<string>/</string>
</array>
</dict>
</plist>
11.) Icon Composer no longer seems to be in Xcode. So I use the following app to create my 1024x1024 icon (*.icns). New size is required for the new retina displays.
http://itunes.apple.com/us/app/icon-sla ... 7913?mt=12
You'll have to click on the "2X" button to make the 1024x1024 size. Make sure to create all the smaller sizes too, in the "1:1" area of the app.
12.) Runs these lines in the "Terminal" one at a time. Edit what's in bold to your own info.
sudo chmod -R a+xr "/Users/Your Name/Desktop/Your App.app"
codesign -f -s "3rd Party Mac Developer Application: Your Name" --entitlements "/Users/Your Name/Desktop/Your App.entitlements" "/Users/Your Name/Desktop/Your App.app"
*Just a note. If you want to build a 64-bit app for outside of the Mac App Store and keep compatibility with Snow Leopard and up, read the following post...productbuild --component "/Users/Your Name/Desktop/Your App.app" /Applications --sign "3rd Party Mac Developer Installer: Your Name" yourapp.pkg
http://www.purebasic.fr/english/viewtop ... 02#p468002
13.) Now you will need to test the installer you just made. Put your app temporarily in the trash or the installer will think it is already installed. Edit where needed.
14.) Go to https://itunesconnect.apple.com/ if you haven't already and set that up. Once that is all set up you will be ready to upload.sudo installer -store -pkg /Users/Your Name/installername.pkg -target /
15.) Open "Application Loader v2.7" or better. You can find it in Xcode. Or just "Show Package Contents" by right clicking on the Xcode app and view "Contents" then "Applications". This will allow you to select your installer package and upload it to iTunes Connect.
Xcode is in your "Applications" folder as of v4.4 for Lion and Mountain Lion.
If all went well, your app on iTunes Connect should be "Waiting for Review". I believe this is everything. Good luck!