Saturday, January 30, 2010

ipad development



Wednesday, January 27, 2010

Download iPhone SDK 3.2 beta today, start developing iPad Apps.


iPhone Developer Program members can download iPhone SDK 3.2 beta today, start developing the next generation of innovative applications for new Apple iPad.


iPhone SDK 3.2 beta
iPhone SDK 3.2 beta contains all the tools you need to start developing and optimizing iPhone OS applications for iPad.
iPad Simulator
The iPad Simulator lets you build and run your iPad application on your Mac, allowing you to lay out your user interface for the larger screen size, test your app’s memory usage, and shorten the debug cycle in the design process.
iPad Programming Guide
iPad provides new opportunities to create Multi-Touch iPhone OS applications on a larger display than ever. The iPad Programming Guide introduces new features available for iPad and how to implement those features in your applications.
iPad Human Interface Guidelines
Design an incredible user interface and user experience for your iPad application by following the iPad Human Interface Guidelines. Learn how to effectively use the new views and controls available to you to deliver unforgettable applications to your customers.
iPad Sample Code
Get started developing innovative universal applications for iPad, iPhone and iPod touch by downloading iPad sample code. Each sample code project is buildable and provides an example of how to accomplish a task for a specific technology.
Preparing Universal Applications
Developers can now start planning for universal applications, allowing them to take full advantage of the technologies found on iPad, iPhone, and iPod touch with a single binary.



Learn More...

Monday, January 11, 2010

AlertView

The creation and usage of Alert is very similar to Action Sheet.

Here, a AlertView will be shown if user click NO in the Action Sheet, to prompt user that the application is kept running.




- (void)actionSheet:(UIActionSheet *)actionSheet 
didDismissWithButtonIndex:(NSInteger)buttonIndex 
{ 
    if (buttonIndex == [actionSheet destructiveButtonIndex]) 
    { 
  exit(0);
    } 
 else
 {
  UIAlertView *alert =[[UIAlertView alloc]
        initWithTitle:@"No Exit"
        message:@"Application keep running"
        delegate:self
        cancelButtonTitle:@"OK"
        otherButtonTitles:nil];
  [alert show];
  [alert release];
 }
} 



Saturday, January 9, 2010

ActionSheet

In this exercise, we will implement a ActionSheet on the last exercise "Programmatically quit a iPhone OS application", to double confirm exiting after the button pressed, and before exit the application.



Action sheets are used to force the user to make a choice between two or more items. It comes up from the bottom of the screen and displays a series of buttons for
the user to select.

Modify the header file, iPhoneExitViewController.h.


#import <UIKit/UIKit.h>

@interface iPhoneExitViewController : UIViewController <UIActionSheetDelegate>{

}
- (IBAction)exitButtonPressed:(id)sender;
@end

Modify iPhoneExitViewController.m to implement the IBAction exitButtonPressed, and actionSheet.


@implementation iPhoneExitViewController
- (IBAction)exitButtonPressed:(id)sender{
 UIActionSheet *actionSheet = [[UIActionSheet alloc] 
                                  initWithTitle:@"Confirm to Exit?" 
                                  delegate:self 
                                  cancelButtonTitle:@"No!" 
                                  destructiveButtonTitle:@"Yes" 
                                  otherButtonTitles:nil]; 
    [actionSheet showInView:self.view]; 
    [actionSheet release]; 
}

- (void)actionSheet:(UIActionSheet *)actionSheet 
didDismissWithButtonIndex:(NSInteger)buttonIndex 
{ 
    if (buttonIndex == [actionSheet destructiveButtonIndex]) 
    { 
        exit(0);
    } 
} 

For sure, you have to create the UI to include a Exit button using Interface Builder, and connect the IBAction to the Exit button. Refer the article "General steps to implement and connect a IBAction".

Sunday, January 3, 2010

Programmatically quit a iPhone OS application


According to iPhone OS Reference Library Q&A, Q: How do I programmatically quit my iPhone OS application? There is no API provided for gracefully terminating an iPhone application.

Alternatively, we can use exit(0) to force the iPhone application to terminate.


@implementation iPhoneExitViewController
- (IBAction)exitButtonPressed:(id)sender{
exit(0);
}

iPhone OS Reference Library



iPhone OS Reference Library
The iPhone OS Reference Library is your bookshelf for detailed information essential to iPhone OS application development.