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

  • Home
  • SEARCH
  • 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 411635
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T18:00:22+00:00 2026-05-12T18:00:22+00:00

I have a simple UITableViewController in a UINavigationController that displays a list of strings

  • 0

I have a simple UITableViewController in a UINavigationController that displays a list of strings from an array with the default Edit/Done button on the right-hand side of the navigation bar.

When pressing the Edit button, the UITableView animates correctly and shows the red minus icons to delete. Pressing the delete button removes the row from the table view and the array (implemented in the tableView:commitEditingStyle:forRowAtIndexPath: method of the UITableViewController).

I would now like to allow the user to add a row to the view (and add the string to the underlying array), but I’m not sure how to go about doing so. The commitEditingStyle method has else if (editingStyle == UITableViewCellEditingStyleInsert), but I don’t know how I can get the user to input the string.

I’ve read the Table View Programming Guide (more specifically the example of adding a table-view row), but this seems to require a whole new UIViewController subclass just to get a string from the user.

Is there no easier way?

  • 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-05-12T18:00:23+00:00Added an answer on May 12, 2026 at 6:00 pm

    Creating another view controller is probably going to be the easiest way in the long run. You can present it modally by calling

    SomeViewController* theViewController = [[SomeViewController alloc] init];
    [self presentModalViewController: theViewController animated: YES];
    [theViewController release];
    

    When the theViewController is ready to go away it can call

    [[self parentViewController] dismissModalViewControllerAnimated: YES];
    

    OR
    you can setup a protocol for your new view controller so it can notify your original view controller of completion and send a value back, if you wanted an NSString back you might use

    @protocol MyViewControllerDelegate
    - (void)myViewControllerDelegate: (MyViewController*)myViewController didFinishWithValue: (NSString*)theString;
    @end
    

    MyViewController would then have a delegate property

    @interface MyViewController
    {
        id<MyViewControllerDelegate> delegate;
    }
    @property(nonatomic,assign) id<MyViewControllerDelegate> delegate;
    @end
    

    If you use the protocol method your original view controller will adopt that protocol and will dismiss the modal view itself when it receives this message.

    I hope that helps out, it may seem a little complicated at first, but it makes gathering data very easy.

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

Sidebar

Ask A Question

Stats

  • Questions 210k
  • Answers 210k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Probably a more elegant approach would be to define them… May 12, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer See this answer on how to obtain the instance of… May 12, 2026 at 9:55 pm
  • Editorial Team
    Editorial Team added an answer I think you can put it into the %JAVA_HOME%\jre\lib\security\cacerts, or… May 12, 2026 at 9:55 pm

Related Questions

Ahoy hoy everyone :) Here is a list of links. You will need it
I've inserted a UITableViewController and it's corresponding UITableView into a simple IB document. The
This is my first try into iPhone development and I have some UITableViewController s
I'm trying to keep my code clean and keep the number of files down.
I'm developing an iPhone application that makes heavy use of Core Data, primarily for

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.