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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:44:44+00:00 2026-05-24T23:44:44+00:00

Say I have a class1 and it has a view with a UITextField and

  • 0

Say I have a class1 and it has a view with a UITextField and a save button that saves the text of the field in an array. Now I also have a class2. In this class2, I want to load the class1 view with the tap of a button. However, I went to set the value of the UITextField before I show this view, so that when class1 appears the UITextField already has a string in it and is editable with a tap. Is this possible?

Edit: Only class2 knows what the textfield value will be

Edit: I tried this

    [newInkView setInkTextField:[appDelegate.inks objectAtIndex:indexPath.row]];
    NSLog([appDelegate.inks objectAtIndex:indexPath.row]);
    [self.view addSubview:newInkView.view];
    [self presentModalViewController:newInkView animated:YES];

but this wasn’t able to set the text field value. The NSLog did display some value though

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

    To get the text sent from the class you can do something like this in class1:

    -(void)setTextString:(NSString*)value
    {
    yourField.text = value;
    }
    

    As long as you call it before you show the view it’ll be there when the view is loaded, granted you have an instance of class1 in class2.

    Edit:

    This was fixed by using NSUserDefaults to save the string before the view was loaded and load it when it was loaded.

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

Sidebar

Related Questions

Let's say I have a class that has a member called data which is
Let's say I have one class Foo that has a bunch of logic in
Let's say I have a class called Store that has many Employees. My RESTful
Say I have a tableview class that lists 100 Foo objects. It has: @property
lets say I have an NSWindow Class, that has several events for mouse and
Let's say I have a PHP Model-View-Controller framework that maps an address like http://example.com/admin/posts/edit/5
Let's say i have 2 files located in the same folder. /Test/View.cshtml <h1>File that
Lets say I have a site that has a Layout with navigation. This navigation
I have a view that has multiple views inside it, and an image presentation
Say I have a class Customer which has a property FirstName . Then I

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.