Monday, August 10, 2009

iPhone App Icons 57x57



That's right fans, icons to be presented on the launch screen should be square and there is no need to add the Reflective Gloss.

iPhone OS will automatically round the corners and add reflective gloss.

See HERE.

iPhone User Guidelines




NIB files



The are files with .xib extension. They used to be .nib, but now they are written in XML so the extension was changed to .xib.

Manipulated with the Interface Builder application

Got V (view) think IB (interface builder)
  • Used to layout components on view
  • adds controller objects
  • Also connects the controller and the UI

Views built in Interface builder
Controllers can be in Interface Builder or in Xcode

Draw arrows from instance variables in controller to components in the UI
Also drag arrows from UI components to different methods in the Controller

After the NIB has been loaded by the application all elements that have a awakeFromNib() method are invoked. From here you can do any customization you want to do as part of initialization. NOTE: these are only those objects that were created from a NIB archive.

- (void)awakeFromNib {

[super awakeFromNib];

// do my customization here.

}


Remember:
  • OUTLETS are the members of the Controller that correspond to UI elements
  • UI Elements may be connected ot actions within the Controller

The NIB has serialized version of the objects it represents. So when it is loaded into the application, objects are not actually being created/instantiated they are, instead, being brought from a serialized state to a deserialized/live/in-memory state.

MVC - Model/View/Controller


  • Model = data + state (handles storage/persistence)
  • View = what you see
  • Controller = handles interaction between model and view
When model changes, the controller notifies the view to have it update accordingly.
Controller receives events from views and then updates data in the model.

  • Controller has outlets the point to the views
  • Actions point from view back to the controller


Info.plist

What's all this info.plist stuff all about?

plist ===> Property list...a key/value list.

Well it kind of describes some basic things about your iPhone/iPodTouch app:

  • application icon
  • capabilities used: networking
  • style of status bar
  • how the screen should be presented (portrait or landscape)
  • other system requirements
While it seems info.plist files are actually xml files you can use the XCode plist editor to modify as desired.
Here is an example from one of the sample modules

CFBundleDevelopmentRegion
en
CFBundleDisplayName
SimpleTableView
CFBundleExecutable
${EXECUTABLE_NAME}
CFBundleIconFile
CFBundleIdentifier
com.yourcompany.${PRODUCT_NAME:identifier}
CFBundleInfoDictionaryVersion
6.0
CFBundleName
${PRODUCT_NAME}
CFBundlePackageType
APPL
CFBundleSignature
????
CFBundleVersion
1.8
LSRequiresIPhoneOS
NSMainNibFile
MainWindow


iPhone Application Badge

These are the little numbers that show up on an iPhone Application's launch page icon. For example, to let you know how many calls you may have missed.

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:3];

How to get YOUR application?

Here's how:

UIApplication *myApp = [UIApplication sharedApplication];


Which way's up? ACCELEROMETER

Friday, August 7, 2009

iPhone/iPodTouch App Lifecycle


NOTE: iPhone/iPodTouch applications should link to UIKit/UIKit.h (not Cocoa/Cocoa.h)

Remember: Cocoa is the desktop/Mac Framework
UIKit used for iPhone and iPod touch

NIB it up

NIB files
- specify UI components and information about object relationships