Friday, December 30, 2011

Generating iPhone app icon

http://www.iconj.com/iphone_style_icon_generator.php

iOS icon file resolution

Description

Size for iPhone and iPod touch (in pixels)

Size for iPad (in pixels)

Guidelines

Application icon (required for all apps)

57 x 57

114 x 114 (high resolution)

72 x 72

“Application Icons”

App Store icon (required for all apps)

512 x 512

512 x 512

“Application Icons”

Launch image (required for all apps)

320 x 480

640 x 960 (high resolution)

For portrait:

  • 768 x 1004

For landscape:

  • 1024 x 748

“Launch Images”

Small icon for Spotlight search results and Settings (recommended)

29 x 29

58 x 58 (high resolution)

50 x 50 for Spotlight search results

29 x 29 for Settings

“Small Icons”

Document icon (recommended for custom document types)

22 x 29

44 x 58 (high resolution)

64 x 64

320 x 320

“Document Icons”

Web clip icon (recommended for web apps and websites)

57 x 57

114 x 114 (high resolution)

72 x 72

“Web Clip Icons”

Toolbar and navigation bar icon (optional)

Approximately 20 x 20

Approximately 40 x 40 (high resolution)

Approximately 20 x 20

“Icons for Navigation Bars, Toolbars, and Tab Bars”

Tab bar icon (optional)

Approximately 30 x 30

Approximately 60 x 60 (high resolution)

Approximately 30 x 30

“Icons for Navigation Bars, Toolbars, and Tab Bars”

Newsstand icon for the App Store (required for Newsstand apps)

At least 512 pixels on the longest edge

At least 512 pixels on the longest edge

“Newsstand Icons”



http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/mobilehig/IconsImages/IconsImages.html

Thursday, December 29, 2011

iPhone data formatter

http://iphonedevelopertips.com/cocoa/date-formatter-examples.html

Wednesday, December 28, 2011

Add multiple column in UITableViewControl for iOS


#define MAINLABEL_TAG 1
#define SECONDLABEL_TAG 2
#define PHOTO_TAG 3
 
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
 
    static NSString *CellIdentifier = @"ImageOnRightCell";
 
    UILabel *mainLabel, *secondLabel;
    UIImageView *photo;
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
        cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;
 
        mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0.0, 0.0, 220.0, 15.0)] autorelease];
        mainLabel.tag = MAINLABEL_TAG;
        mainLabel.font = [UIFont systemFontOfSize:14.0];
        mainLabel.textAlignment = UITextAlignmentRight;
        mainLabel.textColor = [UIColor blackColor];
        mainLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
        [cell.contentView addSubview:mainLabel];
 
        secondLabel = [[[UILabel alloc] initWithFrame:CGRectMake(0.0, 20.0, 220.0, 25.0)] autorelease];
        secondLabel.tag = SECONDLABEL_TAG;
        secondLabel.font = [UIFont systemFontOfSize:12.0];
        secondLabel.textAlignment = UITextAlignmentRight;
        secondLabel.textColor = [UIColor darkGrayColor];
        secondLabel.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
        [cell.contentView addSubview:secondLabel];
 
        photo = [[[UIImageView alloc] initWithFrame:CGRectMake(225.0, 0.0, 80.0, 45.0)] autorelease];
        photo.tag = PHOTO_TAG;
        photo.autoresizingMask = UIViewAutoresizingFlexibleLeftMargin | UIViewAutoresizingFlexibleHeight;
        [cell.contentView addSubview:photo];
    } else {
        mainLabel = (UILabel *)[cell.contentView viewWithTag:MAINLABEL_TAG];
        secondLabel = (UILabel *)[cell.contentView viewWithTag:SECONDLABEL_TAG];
        photo = (UIImageView *)[cell.contentView viewWithTag:PHOTO_TAG];
    }
    NSDictionary *aDict = [self.list objectAtIndex:indexPath.row];
    mainLabel.text = [aDict objectForKey:@"mainTitleKey"];
    secondLabel.text = [aDict objectForKey:@"secondaryTitleKey"];
    NSString *imagePath = [[NSBundle mainBundle] pathForResource:[aDict objectForKey:@"imageKey"] ofType:@"png"];
    UIImage *theImage = [UIImage imageWithContentsOfFile:imagePath];
    photo.image = theImage;
 
    return cell;
}

Copy from: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html%23//apple_ref/doc/uid/TP40007451-CH7