Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8514645
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:55:36+00:00 2026-06-11T04:55:36+00:00

I have included UIActionSheet in my program.It contains 2 button say A and B.

  • 0

I have included UIActionSheet in my program.It contains 2 button say A and B. When a user clicks on the A button it goes to another view. In that view, it contains 3 text field.So in the mainviewcontroller, I am assigning the values to these textfield. I will paste the code below :-

In MainViewController.m

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex: (NSInteger)buttonIndex 
  {
         AnotherViewController *A = [[AnotherViewController alloc] init];

          if (buttonIndex == 1) 
          {

              A.newtask = name;
              A.newsubtask = sub1;
              A.newduedate = dateName;
              A.newtime = timeName;


     UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];                                                                    

     UpdateViewController   *viewController =[storyboard instantiateViewControllerWithIdentifier:@"update"];

     [self presentViewController:viewController animated:YES completion:NULL];


          }
   }

And in AnotherViewcontroller.m

 - (void)viewDidLoad
   {

              task_update.text = newtask;
              subtask_update.text =newsubtask;
              duedate_update.text = newduedate;
              time_update.text = newtime;

           NSLog(@"The task is :%@",newtask);
              [super viewDidLoad];
// Do any additional setup after loading the view.
    }

The problem is I am getting null value in the newtask. Can anyone please tell me the solution. 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T04:55:38+00:00Added an answer on June 11, 2026 at 4:55 am

    Take Global Variables in AppDelegate Class. Like
    AppDelegate .h

    NSString *newtask,*newsubtask,*newduedate,*newtime;
    
    @property(nonatomic,retain)NSString *newtask,*newsubtask,*newduedate,*newtime;
    

    AppDelegate. m

    @synthesize newtask,newsubtask,newduedate,newtime;
    

    MainViewController.h

    import "AppDelegate"

    {
    AppDelegate *appDelegate;
    }
    

    MainViewController.m

        (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex: (NSInteger)buttonIndex 
          {
    appDelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
                 AnotherViewController *A = [[AnotherViewController alloc] init];
        
                  if (buttonIndex == 1) 
                  {
        
                      appDelegate.newtask = name;
                      appDelegate.newsubtask = sub1;
                      appDelegate.newduedate = dateName;
                      appDelegate.newtime = timeName;
        
        
             UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];                                                                    
        
             UpdateViewController   *viewController =[storyboard instantiateViewControllerWithIdentifier:@"update"];
        
             [self presentViewController:viewController animated:YES completion:NULL];
        
        
                  }
           }
    

    AnotherViewcontroller.h

    import "AppDelegate"

    {
    AppDelegate *appDelegate;
    }
    

    AnotherViewcontroller.m

    - (void)viewDidLoad
       {
        appDelegate=(AppDelegate *)[[UIApplication sharedApplication]delegate];
    
                  task_update.text = appDelegate.newtask;
                  subtask_update.text =appDelegate.newsubtask;
                  duedate_update.text = appDelegate.newduedate;
                  time_update.text = appDelegate.newtime;
    
               NSLog(@"The task is :%@",newtask);
                  [super viewDidLoad];
    // Do any additional setup after loading the view.
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have created a facebook-app which contains a fb:comment field. We have included the
I have a master page and have included a search text box. User is
I have included css in view file as below <link rel=stylesheet type=text/css href=<?php echo
I have a rails module included for reference below that I have included using
I have inherited a DotNetNuke codebase and have come across areas that have included
I have a document that I have included in my VS 2010 solution. It
I have included reset.css which is pretty common for most websites that use, on
I am implementing an alert view after the user clicks on the 'destructButton' in
I have included a resource in my Visual Studio 2005 solution that was a
I have included my two code sources below. The problem that I am having

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.