Tuesday, 20 November 2012

UIDeviceID (uniqueIdentifier) DEPRECATED Ulternative

In iOS 5 – method UIDevice currentDevice uniqueIdentifier as __OSX_AVAILABLE_BUT_DEPRECATED.

So i have found another solution

Try https://github.com/hiren443/UIDevice-with-UniqueIdentifier-for-iOS-5. It provides two methods, one which is a global UDID that uses the MAC address of the device, and hashes it. The other is an app specific id which uses the MAC address + bundle identifier of the app to generate a hashed UID for the app. I have tried both and they work like a charm. Try-
[[UIDevice currentDevice] uniqueGlobalDeviceIdentifier] //for the global identifier
OR
[[UIDevice currentDevice] uniqueDeviceIdentifier]

AFNetworking alternative fro ASIHTTPRequest for iOS 5 or above



https://github.com/AFNetworking/AFNetworking



http://stackoverflow.com/questions/7623275/afnetworking-post-request


 

Programmatically Request Access to Contacts in iOS 6


Reference: http://stackoverflow.com/questions/12570774/cant-access-contacts-sources-on-device-in-ios-6


+ (BOOL)contactsServicesEnabled
{
   
   
    if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusNotDetermined) {
        return YES;
    }
    else if (ABAddressBookGetAuthorizationStatus() == kABAuthorizationStatusAuthorized) {
        return YES;
    }
    else {
        return NO;
    }

}

Monday, 19 November 2012

TSAlert View with TextField


Reference:  http://stackoverflow.com/questions/6735968/ios-uitextfield-in-uialertview



The only proper solution I found (ie coding from scratch from a UIView) is here: https://github.com/TomSwift/TSAlertView
This is all it takes:

- (IBAction) importTap
{
    TSAlertView* av = [[[TSAlertView alloc] init] autorelease];
    av.title = @"Enter URL";
    av.message = @"";

    [av addButtonWithTitle: @"Ok"];
    [av addButtonWithTitle: @"Cancel"];


    av.style = TSAlertViewStyleInput;
    av.buttonLayout = TSAlertViewButtonLayoutNormal;
    av.delegate = self;

    av.inputTextField.text = @"http://";

    [av show];
}

// after animation
- (void) alertView: (TSAlertView *) alertView 
didDismissWithButtonIndex: (NSInteger) buttonIndex
{
    // cancel
    if( buttonIndex == 1 )
        return;

    LOG( @"Got: %@", alertView.inputTextField.text );
}








enter image description here

Saturday, 17 November 2012

Sunday, 14 October 2012

Default (Launch) Image Sizes for iPhone & iPad


Default (Launch) Image Sizes for iPhone & iPad 

 

Apple iPhone/iPad UI Interface GuideLines: (Important)

https://developer.apple.com/library/ios/documentation/UserExperience/Conceptual/MobileHIG/index.html#//apple_ref/doc/uid/TP40006556

 

Other Help full Links:

http://ivomynttinen.com/blog/the-ios-7-design-cheat-sheet/

http://www.idev101.com/code/User_Interface/sizes.html

http://www.idev101.com/code/User_Interface/launchImages.html

 

 

  http://www.idev101.com/code/User_Interface/launchImages.html

 

The launch image (or default image) is displayed while your app launches. (If no default image is provided, then a black screen is displayed.)
To include a launch image in your app images of the appropriate size for the device, and name them as follows:
Screen sizes (in pixels) of the iPhone 4S and iPhone 5
                        iPhone 4S
3.5" display
iPhone 5
4" display
Non-retina
320 x 480 pixels         
Default.png
N/A
Retina 640 x 960 pixels
Default@2x.png


640 x 1136 pixels
Default-568h@2x.png


Note that the Default-568h@2x.png image is required for an app to display in full-screen mode on the iPhone 5.
Launch images for the iPhone are only accepted in portrait mode. If you want to provide a landscape launch image, create the image and rotate it 90 degrees in an image editor, then save as named above.


Screen sizes (in pixels) iPad
                    iPad - Portrait            iPad - Landscape
Non-retin 768 x 1004 pixels
Default-Portrait.png
 1024 x 748 pixels
Default-Landscape.png
Retina 1536 x 2008 pixels
Default-Portrait@2x.png

2048 x 1496 pixels
Default-Landscape@2x.png



iPad launch images do not include the status bar area. You can provide different launch images for each orientation (Portrait, PortraitUpsideDown, LandscapeLeft, and LandscapeRight); consult the Apple documentation for details.


 Additional References

 

Monday, 10 September 2012

UIPopover on iPhone



UIPopover on iPhone:

http://www.youtube.com/watch?v=1iykxemuxbk

http://www.cocoacontrols.com/controls/wepopover