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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:05:43+00:00 2026-05-26T04:05:43+00:00

I have two view controllers. In one of them I have a UITextField within

  • 0

I have two view controllers. In one of them I have a UITextField within a UITableViewCell. What I want is to call a action in another view controller when the UITextField is being edited. In the - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

I use this code to call the action:

[TextFieldText addTarget:Viewcontroller1 action:@selector(ApplyAllObjectsSettings:) forControlEvents:UIControlEventEditingChanged];

The action is in Viewcontroller1 and it looks like this:

- (void)ApplyAllObjectsSettings {
    NSLog(@"Test");
    // Test
}

I have inserted the action in the .h file.

The weird thing is that I have used almost the same code earlier and it worked fine. I think the only difference is that the view controller the UITextfield is in is shown from Viewcontroller1 by presentmodalviewcontroller. and where the code that worked was presented it was by addsubview. Don’t know if this have anything to say.

Thanks in advance 🙂

  • 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-26T04:05:43+00:00Added an answer on May 26, 2026 at 4:05 am

    Your selector is wrong. With the trailing colon in @selector(ApplyAllObjectsSettings:) the method you want is not going to be called because it takes no arguments. @selector(ApplyAllObjectsSettings:) is very different from @selector(ApplyAllObjectsSettings). Either change your ApplyAllObjectsSettings method to this: - (void)ApplyAllObjectsSettings:(id)sender, or your selector to this: @selector(ApplyAllObjectsSettings).

    So, either do this:

    [TextFieldText addTarget:Viewcontroller1 action:@selector(ApplyAllObjectsSettings:) forControlEvents:UIControlEventEditingChanged];
    // ...
    - (void)ApplyAllObjectsSettings:(id)sender {
        NSLog(@"Test");
        // Test
    }
    

    Or this:

    [TextFieldText addTarget:Viewcontroller1 action:@selector(ApplyAllObjectsSettings) forControlEvents:UIControlEventEditingChanged];
    // ...
    - (void)ApplyAllObjectsSettings {
        NSLog(@"Test");
        // Test
    }
    

    From the capitalization of the syntax, it appears that your target is a class name. The addTarget: parameter needs to be an instance of an object, not the class name.

    Viewcontroller1 *vc1 = [[Viewcontroller1 alloc] initWithBlahBlah...];
    [TextFieldText addTarget:vc1 action:@selector(ApplyAllObjectsSettings:) forControlEvents:UIControlEventEditingChanged];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two view controllers, call them viewA and ViewB All the action happens
So I have two view controllers in my iphone project - one of them
I have two action methods. One of them submits the inserted data of a
In my iphone application I have two scenes, both of them are view controllers.
I have created two viewController classes such that one is superclass of another.i have
I have two view controllers in a tabbar which can both edit data. Therefore,
I have two view controllers that allow changes to the Address Book. The first
I have two view controllers name RootViewController and SecondViewController. In the FirstViewController I have
I have two view Controllers in my project ViewController , SettingsView . Here I
I have application where i have two view controllers my first view and second

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.