1) Enable iCloud service in the project.
2)
If you are planning to publishing multiple apps from one project (for example, light version and premium version), this will be the article that can help you out.
1. Click Manage Scheme.
2. Untick the "autocreate schemes" option. By unchecking this option, you can assign a proper scheme name.
3. Click on the project Targets. Two finger click on the "taget item" that you want to duplicate.
4. A new plist file will be added to the project. Rename the plist file to whatever you want. In our case, we use "premium version". Do the same for the "Bundle display name" and also "Bundle identifier".
Note: you need two app ID. One for the light version and another for premium version.
5. Goto the project targets again. Rename the target to "premium". In Build Settings, search for "Product name" and update it as well.
6. Search "plist" in Build Settings and change it to the appropriate plist file name.
7. Click on the "scheme" and choose New Scheme.
8. Choose the "premium" from the target and then key in "premium" as the scheme name.
9. The final step will be setup the preprocessor macros. You need to edit both Debug and the Release.
10. In the coding, you have to do this:
#ifdef IS_PREMIUM_VERSION
lbl.text = @"this is premium Verison";
#else
lbl.text = @"this is Light version";
#endif
One day, I want to backup my Sqlite database created inside the Simulator to my MacBook data directory and I was wondering if this is possible. Yes, it is possible. The files that was created in Simulator is physically located in your MacBook.
You can find the physical directory with the codes below:
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);// Add to top of file #import <dispatch/dispatch.h>
if ([NSThread isMainThread]) { [self MyMethodName]; } else { dispatch_sync(dispatch_get_main_queue(), ^{ //Update UI in UI thread here [self MyMethodName]; }); }
Reference:
http://www.ios-developer.net/iphone-ipad-programmer/development/threads/updating-ui-controls-on-background-threads
http://www.raywenderlich.com/4295/multithreading-and-grand-central-dispatch-on-ios-for-beginners-tutorial
UIImage *overlayImage = [UIImage imageNamed:@"bookmark.png"];