2012年3月22日 星期四

[iOS] SMS/E-Mail

Message UI Framework Reference
System Message Programming Topics for iOS

Example:
MessageComposer
MailComposer

2012年3月20日 星期二

[iOS] Notification Center

Reference1
NSNotificationCenter Class Reference
Keyboard using NSNotificationCneter

2012年3月11日 星期日

[iOS] UIAlertView

UIAlert View with multiple options.

in .h: include UIAlertViewDelegate


@interface MyController : UIViewController <UIAlertViewDelegate> {
}

in .m: implement delegate for UIAlertViewDelegate


#pragma UIAlertView
- (void) alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
    NSLog(@"%d", buttonIndex);

[iOS] UIActionSheet

UIActionSheet Class Reference
Move Cancel Button from top to bottom

In .h: include UIAlertViewDelegate

@interface MyController : UIViewController <UIAlertViewDelegate> {
}


In .m: implement delegates

- (void) ShowActionSheet:(NSString *)title {
    UIActionSheet *actionSheet = [[UIActionSheet alloc
                                  initWithTitle:title
                                  delegate:self
                                  cancelButtonTitle:nil
                                  destructiveButtonTitle:nil 
                                  otherButtonTitles: nil];
    
    [actionSheet addButtonWithTitle:@"Option 1"];
    [actionSheet addButtonWithTitle:@"Option 2"];
    [actionSheet addButtonWithTitle:@"Option 3"];

    [actionSheet addButtonWithTitle:@"Cancel"];
    actionSheet.cancelButtonIndex = actionSheet.numberOfButtons;
    
    [actionSheet showInView:self.view];
    [actionSheet release];
}

- (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
    NSLog(@"title=%@, buttonIndex: %d, cancelButtonIndex: %d, firstOtherButtonIndex: %d",
          actionSheet.title,
          buttonIndex, 
          actionSheet.cancelButtonIndex
          actionSheet.firstOtherButtonIndex);
}


2012年3月9日 星期五

[iOS] Apple Certification Expired

When your Apple certification is expired, you have to remove it and request a new cert as well as provision profiles. Here is the solution for this issue.


Code Sign Errors: profile doesn’t match any valid certificate/private key pair in the default keychain