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 8796995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:45:11+00:00 2026-06-13T23:45:11+00:00

i am severely struggling with what seems like such a very simple thing: passing

  • 0

i am severely struggling with what seems like such a very simple thing: passing data from modal view to its parent. I have tried countless ways and to my surprise there is not much online and nothing seems to match what i’m trying to do. I’m using storyboards and most examples out there do not use seques/storyboards.

If anyone could possibly provide some sample code for me i would tremendously appreciate it!

I have a static table view controller with a custom cell. Within the cell I have a label. I want to tap on the cell the present the modal view with a textview in it. Type data into the text view, then hit a save/done button to dismiss the modal view and have that data appear on my UILabel in my cell.

I know it must sound very simple and there are many questions on here about it but nothing does this very thing. Some sample code would be so appreciated. I’m completely stuck on building my app and can’t go any further until i get this!

  • 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-13T23:45:13+00:00Added an answer on June 13, 2026 at 11:45 pm

    You can try NSUserDefaults to store your data from textview and then read them back for the label.

    EDIT: If you don’t want to use NSUserDefaults as it’s not the “right” way (but the easy one) you can try this:

    In your tableViewController.h create a NSString:

    #import <UIKit/UIKit.h>
    @interface TestTableViewController : UITableViewController
    @property (nonatomic, strong) NSString *string;
    @end
    

    In your viewController.h that contains the textView add these:

    - (IBAction)doneButton;
    @property (weak, nonatomic) IBOutlet UITextView *textView;
    

    In viewController.m:

    - (IBAction)doneButton {
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
    TestTableViewController *tvc = (TestTableViewController*)[storyboard instantiateViewControllerWithIdentifier:@"TestTableViewController"];
    tvc.string = _textView.text;
    [tvc setModalPresentationStyle:UIModalTransitionStyleFlipHorizontal];
    [self presentModalViewController:tvc animated:YES];
    // ios6 version:
    //[self presentViewController:tvc animated:YES completion:nil];}
    

    Then back in your tableViewController.m display the input data to your cell (you don’t need to use a label):

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
    {      
    static NSString *CellIdentifier = @"test";
    UITableViewCell *cell = [[UITableViewCell alloc] init]; 
    if (SYSTEM_VERSION_LESS_THAN(@"6.0")) { 
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; } 
    else { 
    cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath]; 
    } 
     // Configure the cell...
    cell.textLabel.text = _string;
    
    return cell;}
    

    DON’T forget to set the Storyboard ID to identity inspector on storyboard for your tableViewController!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a view which loops through @regions . For each region its countries
We launched a Large 64-bit instance and the performance was severely lacking. Commands like
I like StyleCop 's static code analysis and rules enforcement. However, it is severely
I need a view that’s something like Skype’s contact view. List of names, with
I'm kicking the tires on EclipseLink(2.3.0) and found something that seems severely wrong. The
The tutorials for creating blackberry applications seem to be severely limited. Even on the
I'm severely annoyed with many shared hosting providers not enabling SoapClient support on their
I could be missing something severely here, but this is just not adding up.
I have an expensive function that takes and returns a small amount of data
Considering the positive effect of caching and data locality when searching in primary memory,

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.