Wednesday 26 June 2013

How to create iCloud entitlements file manually?

Creating entitlements file manually is very simple, open the text editor and just copy and paste the following lines of code: (save it as <yourappname>.entitlements)

<?xml version="1.0" encoding="UTF-8">
<!DOCTYPE plist PUBIC "-//Apple//DTD PLIST" 1.0//EN"
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>apple.developer.ubiquity-container-identifiers</key>

<array>
<string>$(TeamIdentifierPrefix).com.yourdomain.icloudapp</string>
</array>

<key>com.apple.developer.ubiquity-kvstore-identifier</key>
<string>$($(TeamIdentifierPrefix).com.yourdomain.icloudapp)</string>

</dict>
</plist>

After saving you file simply drag and drop it to your app on xcode.

written by: infinitywebseo 

Monday 24 June 2013

UIDocument does not allow you to write strings directly to disk

If you are using UIDocument in your app, always remember that UIDocument doesn't allow you to write strings directly to disk.

You need to package the string value in NSData then you can write it to disk. You can do it using the contentsForType:error method.

Below is a sample code, first check that the string is not NULL :

- (id)contentsForType:(NSString *)typeName error:(NSError **) myError{
    if (!self.stringDocument)
        self.stringDocument = @"";

    NSData *nsDataDocument = [self.stringDocument
                           dataUsingEncoding:NSUTF8StringEncoding];
    return nsDataDocument;
}

written by: infinitywebseo 

Wednesday 19 June 2013

How to Check iCloud is available in your app?

After enabling icloud on your app, just copy and paste the highlighted lines of code to your appdelegate.m to check that icloud is available for your app:

- (void)initializeiCloudAccess {
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        if ([[NSFileManager defaultManager]
             URLForUbiquityContainerIdentifier:nil] != nil)
            NSLog(@"iCloud is available\n");
        else
            NSLog(@"iCloud is not available.\n");
    });
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
   
    [self initializeiCloudAccess];

    return YES;
}

The executable was signed with invalid entitlements. (0xE8008016)


Summary: if you have this error --> Try creating your new provisional profile through xcode > organiser it may solve the problem. (Don't create it trough your developer account on-line)

I had this error when I tried to run an app that uses icloud on an ios device. For icloud application you must create an app id  and new provisional profile.

What I did was that I create my new provisional trough my apple developer account website. Even thought I refreshed my provisional profile on xcode > organiser, I couldn't get rid of the error,  never mind few hours of searching on the web trying to find out the answer which was unsuccessful.


At the end, I just deleted my app id, and provisional profile. Then I create  a new app id, and this time I create my provisional profile through xcode > organiser, run my app again and it just worked.

written by: infinitywebseo 

Wednesday 12 June 2013

iOS 7 --> Things that you need to change about your app

 
All the contents on this blog are derived from apple developer website, its just a quick short-list for my own personal use.  I hope you find it useful.


Things I must do:
  • Update app icon to 120 x 120 (iOS 7 - Higher Resolution).
  • Update the launch image to include the status bar area.
  • Support Retina display.


Things I should do:  
Prepare for borderless buttons by moving away from supplying button background images and by reassessing your layout.

Use translucent UI Element & Auto-layout.

View controllers should use full screen layout. Don't use "wantsFullScreenLayout", its deprecated in iOS 7. Instead use the following properties:
  • edgeForExtendedLayout
  • extendedLayoutIncludeOpaqueBars
  • automaticalAdjustScrollViewInsets

For custom animated transitions between views click on --> UIViewControllerInteractiveTransitioning Protocol Reference


Using tint color: In iOS 7 tint is a property of UIView. Specify a tint color for entire app using following line: window.tintColor = [UIColor purpleColor]; By default tint color is nil which means that it uses the parent tint color. 
Remember, its best to change tint color when the app is off screen.


Bars and Bar Buttons barPosition in iOS 7 is a property for identifying bar position. The UIBarPositionTopAttached -----> a bar is at the top of the screen and its background extends upward into the status bar area. 
UIBarPositionTop ------> a bar is at the top of its local context—for example, at the top of a popover—and that it doesn’t provide a background for the status bar. 


Status Bar iOS 7
In iOS 7 You can control the style of the status bar from an individual view controller and change it while the app runs. In order to do it, add the UIViewControllerBasedStatusAppearance key to an app's Info.plist file and give it the value YES.


Navigation Bar iOS 7
Bar Style: by default the translucent property is YES.
Appearance: A one-pixel hairline appears a the button edge.  
Tinting: Use tintColor to tint bar button items.
             Use barTintColor to tint the bar background.


Collection View iOS 7
Collection view supports animated transitions between layouts. Click to read the documentation ------> UICollectionViewTransitionLayout Class Reference

Image View iOS 7
UI Image contains tintColor property and when image uses UIImageRenderingModeAlwaysTemplate mode, tintColor is applied to the image.

Map View iOS 7
In iOS 7 there is a new class called MKOverlayRenderer which you can use to create overlay on the top of map view.


Page View Controller iOS 7
To specify orientation use the following methods:
  • pageViewControllerPreferredInterfaceOrientationForPresentation
  • pageViewControllerSupportedInterfaceOrientations 
Scrol View in iOS 7  
automaticallyAdjustsScrollViewInsets ----> to manage scroll view insets.

written by: infinitywebseo 

 

 


Debt Collection

Debt Collectors

iOS 7 Beta a Quick Overview

iOS 7 Beta has so many bugs but the idea is great, its basically amazing. Can't wait for the final version.




written by: infinitywebseo