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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:04:27+00:00 2026-05-25T16:04:27+00:00

I am trying to equal the string of an UITextView from anotherViewController to the

  • 0

I am trying to equal the string of an UITextView from anotherViewController to the MainViewController . I mean users write something in UITextView from anotherViewController and when touch the done button the string in UITextView should equal to another string in MainViewController . How can I access UITextView ???

I did something like this but did not get any result !

#import "AnotherViewController"

@class AnotherViewController;

@interface MainViewContoller : UIViewController {

    NSString *main_string;
    AnotherViewController *textEntered;

}

-(void)viewDidLoad {

textEntered.TEXT = main_string

}

***TEXT is the name my UITextView on AnotherViewController .

EDITED :

@interface AnotherViewController : UIViewController {

    UITextView *TEXT;
    id  delegate;
}


@property (nonatomic, retain) IBOutlet UITextView *TEXT;
@property (nonatomic ,retain) id delegate;

@end


@implementation AnotherViewController
@synthesize TEXT ,delegate;


- (IBAction)doneButton {

    //!!! problem with compare ! the compiler got me some warning 
   [self dismissModalViewControllerAnimated:YES];
}

MAIN VIEW CONTROLLER

#import "AnotherViewController.h"


@class Another...;

@interface MainViewControlelr : UIViewController {

NSString *main_string;

TextViewController *textEntered;

}


- (void)viewDidLoad
{

    textEntered.delegate = self;
    }


- (void) compareText {

    [textEntered.TEXT isEqual:main_string];

}
  • 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-25T16:04:28+00:00Added an answer on May 25, 2026 at 4:04 pm

    Set mainViewController object as the delegate of an object of anotherViewController type. And use that delegate from AnotherViewController to pass messages to MainViewController.

    Inside MainViewController, when you create your AnotherViewController object do:

    anotherVC.delegate = self;
    

    And in AnotherViewController, when your button action is done and you want to pass the text back, say store in a string. Then pass it to MainViewController as:

    [delegate compareText:textView.text];
    

    compareText with a NSString argument would be a method in your MainViewController class.

    EDIT:

    In your AnotherViewController.h interface, declare an ivar:

    id delegate;
    

    Then use @property (in .h) and @synthesize (in .m) for getter and setter.

    Then do the above.

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

Sidebar

Related Questions

According to this , !==! is the not-equal string operator. Trying it, I get:
I'm just trying to check if a string is equal to %2B, and if
I am trying to check if a value from database table is equal to
I'm trying to get a string in my call from an array. But have
I am trying to create an android MD5 hash string to equal the C#
I am trying to remove spaces from the end of a char array (string).
I am trying to select all nodes with attribute equal to something, I got
I am trying to remove elements from a Dictionary<string, List<string>> in C# when the
Trying to count how many elements within the array are not equal to 0,
I'm trying to assert that one object is equal to another object. The objects

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.