how to do actionsheet in iphone?-RV

Ads
 

how to do actionsheet in iphone?-RV

-(IBAction)buttonClicked
{
    UIActionSheet *asheet = [[UIActionSheet alloc] initWithTitle:@"Share With" delegate:self cancelButtonTitle:@"Cancel" destructiveButtonTitle:nil otherButtonTitles:@"Facebook",@"Twitter",@"Mail",@"SMS", nil];
    asheet.actionSheetStyle=UIActionSheetStyleBlackTranslucent;
    [asheet showInView:[self.view superview]]; //note: in most cases this would be just self.view, but because I was doing this in a tabBar Application, I use the superview.
    [asheet setFrame:CGRectMake(0, 160, 320, 320)];
    [asheet release];

    subviews = [asheet subviews];
    [[subviews objectAtIndex:1] setFrame:CGRectMake(20, 40, 280, 46)]; 

    [[subviews objectAtIndex:2] setFrame:CGRectMake(20, 95, 280, 46)]; 

    [[subviews objectAtIndex:3] setFrame:CGRectMake(20, 150, 280, 46)]; 
    [[subviews objectAtIndex:4] setFrame:CGRectMake(20, 205, 280, 46)]; 

    }



- (void)actionSheet:(UIActionSheet *)actionSheet
clickedButtonAtIndex:(NSInteger)buttonIndex {
    if (buttonIndex == actionSheet.cancelButtonIndex) { return; }
    switch (buttonIndex) {
        case 0:
        {
            if(appDel.flagreach==1)
            {
                UIAlertView *myAlert = [[[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"This app require an internet connection via WiFi or cellular network to work." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil] autorelease];
                [myAlert show];
            }
            else {
                [self postGradesTapped:nil];
            }
            NSLog(@"Item A Selected");
            break;
        }
        case 1:
        {
            if(appDel.flagreach==1)
            {
                UIAlertView *myAlert = [[[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"This app require an internet connection via WiFi or cellular network to work." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil] autorelease];
                [myAlert show];
            }
            else {
                if(!_engine){  
                    _engine = [[SA_OAuthTwitterEngine alloc] initOAuthWithDelegate:self];  
                    _engine.consumerKey    = kOAuthConsumerKey;  
                    _engine.consumerSecret = kOAuthConsumerSecret;  
                }  

                if(![_engine isAuthorized]){  
                    UIViewController *controller = [SA_OAuthTwitterController controllerToEnterCredentialsWithTwitterEngine:_engine delegate:self];  

                    if (controller){  
                        [self presentModalViewController: controller animated: YES]; 
                    }
                }
                else {
                    NSString *name=[sharearray objectAtIndex:Position/320];
                    [_engine sendUpdate:name];
                    [_engine getFollowedTimelineSinceID:1 startingAtPage:1 count:100];
                }
            }

            NSLog(@"Item B Selected");
            break;
        }
        case 2:
        {
            if(appDel.flagreach==1)
            {
                UIAlertView *myAlert = [[[UIAlertView alloc] initWithTitle:@"No Internet Connection" message:@"This app require an internet connection via WiFi or cellular network to work." delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil] autorelease];
                [myAlert show];
            }
            else {
                MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];

                mailController.mailComposeDelegate = self;

                [mailController setSubject:@"Quotes Pro..."];
                NSString *name=[sharearray objectAtIndex:Position/320];
                //[mailController setMessageBody:@"This is the MailSend Application?." isHTML:NO];
                [mailController setMessageBody:name isHTML:NO];

                [self presentModalViewController:mailController animated:YES];

                [mailController release];
            }
            NSLog(@"Item C Selected");
            break;
        }
        case 3:
        {
            [self showSMSPicker];
View Answers

January 9, 2012 at 1:11 PM

??

Ads









Related Tutorials/Questions & Answers:
how to do actionsheet in iphone?-RV
how to do this?
Advertisements
How to do url rewritting?
How do you do data mining projects?
how to do gui
How do I upgrade mysql?
How can I do it? .click();
How do i do the coding for 'leaving a comment' in java
how do i solve this problem?
how do i solve this question?
how to do map in iphone?-RV
How do I initialize a byte array in Java?
How do I decompile Java class files?
How do I compare strings in Java?
How do we create session factory in hibernate?
How do I do this program? I'm new to Java programming...
How do I compile the registration form?
How do we create custom component
how to do abstraction for insurance policy being issued...
How to do Static Resources Configuration in Spring MVC?
How do you add a numerical value to a regex
How do SEL and @selector work in iphone sdk?
How do I get started with Bootstrap
How do I get started with Bootstrap
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO I CHANGE THE SWITCH TO IF ELSE OR DO WHILE OR WHILE DO FOR THIS CODING
HOW TO DO WEBSITE INTERFACE FOR JAVA MODULE
How do I generate random number?
How do I study big data?

Ads