Posts Tagged ‘development’

iPhoneOS iPad Development Resources

March 4th, 2010 iPhone SDK Tips

Code

General Cocoa Programming Resources


When in Trouble


My Favorite Libraries

  • Core Plot – Graphing Library
  • Three20 – The Famous Library with all the Facebook’y goodness
  • Tapku Library – An awesome set of tools – Nice Plot, Calendars, Loading HUD, EmptyView
  • Flurry – Awesome App Analytics
  • CKSparkLine – Basic Line Graph in a View
  • AppiRater – Add App Rating Reminder
  • Open Flow – Open Implementation of cover flow
  • InAppSettings – Include app settings inside the app easily
  • RegExKit – Objective-C Goodness


Address Book Integration


Email Integration


Useful Code


UI

UITableView Pretty Section Titles


Design


Sales

Application Sales Metrics

iPhone iPad Development – Quick – TableView Properties

February 12th, 2010 iPhone SDK Tips

I am currently working on supporting multi orientations of the iPhone (iPad) Screen, where on rotation some objects will be resized and others will be moved. For example I am wanting to move a tableView object and I want to ensure when I rotate back to Portrait that the tableview ends up in the exact same place before I moved it.

I came up with some quick debug code you can use in your iPhone App Development (or iPad App development).

The idea is you get the H,W,X,Y co-ordinates and can then later perfectly replace the initial properties.

Run this in viewDidAppear (for example)

int height = tableView.frame.size.height;
int width = tableView.frame.size.width;
int x = tableView.frame.origin.x;
int y = tableView.frame.origin.y;

NSLog(@”TableView Height:%d”,height);
NSLog(@”TableViewWidth:%d”,width);
NSLog(@”TableViewX:%d”,x);
NSLog(@”TableViewY:%d”,y);


Then later in willRotateToInterfaceOrientation you can use the code:

tableView.frame = CGRectMake(x, y, w, h);  //where x,y are the frame origin coordinates (x,y) and w,h are the width and height of the frame

iPhoneOS iPhone iPad Development (quick) Displaying an Image in UIImageView

February 10th, 2010 iPhone SDK Tips

A quick iPhoneOS Development tip today, loading an image resource into a UIImageView field.

I had created a UIImageView in Interface Builder, but I wanted the image to change every time the page appears.

In interface builder I have linked a UIImageView to the IBOutlet recipeImage

I use the following code to load up a new image:

//Load Image <br />
NSString *recipeImageFileName = [temperatureDictionary objectForKey:@"Image"];   //Get Image Name as String (no extension) <br />
UIImage *img = [UIImage imageWithContentsOfFile: [[NSBundle mainBundle] pathForResource:recipeImageFileName ofType:@"jpg"]]; //load the image into memory, adapt the parameters (filename, extension) as per needs <br />
[recipeImage setImage:img];  //show the image in the UIImageView


Super simple!

iPhone Development SDK – Working with the Address BookRight

January 26th, 2010 iPhone SDK Tips

Lately I’ve spent a bit of time learning the API for the iPhone Contacts Address Book. I’d like to share the process and help with some of the bits I found difficult.

Including the Frameworks

First the framework must be included in your Xcode project.

  1. Right Click on your project target and in the linked  libraries add AddressBook.framework, and AddressBookUI.framework
  2. To add these, click the + button at the bottom of the properties box. In my case, the AddressbookUI.framework was not in the list. To add it I clicked ‘Add Other’ and navigated to /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS2.2.1.sdk/System/Library/Frameworks. AddressBookUI.framework is in here. (if you don’t have folder 2.2.1, try any of the others).
  3. If done correctly, your project should look like the one below. (more…)

iPhone Development – Learning to use a date spinner (date picker)

January 21st, 2010 iPhone SDK Tips

The imfamous iPhone date reel/spinner/picker is easily implemented into your own custom iPhone app. The Class Reference for the UIDatePicker is available here.

I would like to share a simple project I made to help understand the UIDate Picker. This was based on the iPhone Developers Cookbook Example.

The project is a simple date spinner which once it sets on a date sends a UIAlert of the date. It outlines well the UIDate Picker and an UIAlert. The project is extremely simple, but hopefully someone will find it useful. (more…)

iPhone TabBar Custom Background Image

January 16th, 2010 iPhone SDK Tips

I have spent a bit of time implementing a background image behind my TabBar in an iPhone App. I used a combination of internet tutorials and so I have posted my own variant.

Step 1:

Create a new class named CustomUITabBarController.

(more…)

iPhone 3.0 SDK Splash Screen

January 11th, 2010 iPhone SDK Tips

This is a taste of what I’m working on at the moment, Objective-C and iPhone app development. This is some sample code I use to display a splash screen.

Step 1:

Put a Default.png file in your project resources, this will be displayed whilst the app is loading.

Step 2:

in your AppDelegate.h @interface put:
UIImageView *splashView;<br />

Step 3:

In your AppDelegate.m put the following code in applicationDidFinishLaunching and underneath

[window makeKeyAndVisible];
<br />
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)];<br />
splashView.image = [UIImage imageNamed:@"Default.png"];<br />
[window addSubview:splashView];<br />
[window bringSubviewToFront:splashView];<br />
[UIView beginAnimations:nil context:nil];<br />
[UIView setAnimationDuration:1.1];<br />
[UIView setAnimationTransition:UIViewAnimationTransitionNone forView:window cache:YES];<br />
[UIView setAnimationDelegate:self];<br />
[UIView setAnimationDidStopSelector:@selector(startupAnimationDone:finished:context:)];<br />
splashView.alpha = 0.0;<br />
splashView.frame = CGRectMake(-60, -60, 440, 600);<br />
[UIView commitAnimations];<br />

Thats it! Load it up and hope it all works.

via iphonedevsdk.com / stackoverflow.com