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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T03:52:42+00:00 2026-05-23T03:52:42+00:00

I am trying to pass a uitextfield string from a view controller over to

  • 0

I am trying to pass a uitextfield string from a view controller over to a method in a nsobject class… if you could please explain how I do this that would be great.

So far I have done the following however still getting lots of errors.

NSObject Class dbAccess.h
- (void)passCode:(NSString *)passedCode;

NSObject Class.m
- (void)passCode:(NSString *passedCode {
     myString = passedCodeVaraibel; //myString declared in .h
}

//… other code to initialize the database. with myString or something to that effect even though this is probably wrong this is why im asking the question

    viewController.m
    //pass myCode textfield string when uitableviewcell is selected.

[dbAccess.passCode myCode.text];

I know this is not right because its not working 🙂 but I hope it adds more detail as to what I am trying to do.

  • 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-23T03:52:43+00:00Added an answer on May 23, 2026 at 3:52 am

    Standard objective-c convention would request that you change the method name to setPassCode:, however passCode: works perfectly fine.

    i assume this code isn’t compiling,
    to correctly invoke a method, you use the following syntax (several examples):

    [target action:argument];
    [target action:arg1 anotherParameter:arg2];
    [target action]
    

    if you want to set a value, obviously you want to pass in that value as a parameter

    // DBAccess.m
    - (void)setPassCode:(NSString *)newPassCode {
       myString = newPassCode; // myString defined as ivar in .h
    }
    
    
    dbAccess = [[DBAccess alloc] init]; 
    // …
    [dbAccess setPassCode:textField.text];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying pass in a url as a paramter to my controller like this:
I am trying to pass a member function within a class to a function
I'm trying to pass in a Base64 string into a C#.Net web application via
I'm currently trying to pass a mono threaded program to multithread. This software do
I'm trying to pass one method to another in elisp, and then have that
I'm trying to pass an instance of a class between two separate classes, like
I am trying to pass an XML list to a view but I am
Trying to pass some values into an imagebutton click event, something like this: <asp:ImageButton
im trying to pass back from a user control a list of strings that
Im trying to pass multiple things from a webpage inside a UIWebView back to

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.