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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T18:45:19+00:00 2026-05-23T18:45:19+00:00

I keep getting this error when trying to access the textfield value of my

  • 0

I keep getting this error when trying to access the textfield value of my view:

error: request for member 'inputAnswer' in something not a structure or union

The UITextField is declared as follows:

@interface TextInputQuestionViewController : UIViewController {
    Question *question;
    IBOutlet UILabel *questionTitle;
    IBOutlet UILabel *inputLabel;
    IBOutlet UITextField *inputAnswer;
}

@property (nonatomic, retain) UILabel *questionTitle;
@property (nonatomic, retain) UILabel *inputLabel;
@property (nonatomic, retain) Question *question;
@property (nonatomic, retain) UITextField *inputAnswer;

I am trying to access the textfield as follows (as it is nested):

NSLog(@"%@", currQ.question.inputAnswer.text);

What am I doing wrong?

Update: @sergio you are right, I did mean that but it still throws this error. I’m sure its pointing at the right place too…

//pushes new view onto navigation controller stack
-(void) switchViews:(id)sender{ 
    if(currQNum < [questionArray count] - 1){
        if(currQNum > 0){
            Answer* ans = currQ.question.answer;
            ans.questionId = currQ.question.qId;
            ans.entryId = @"1";//temporary;
            //if else for different input types
            NSString* qt = currQ.question.qType;
            if([qt isEqualToString:@"Slider"]){
                ans.answer = currQ.sliderLabel.text;
            }else if([qt isEqualToString:@"Option"]){               

            }else if([qt isEqualToString:@"TextInput"]){
                NSLog(@"%@", currQ.inputAnswer.text); //PROBLEM
                //ans.answer = currQ.inputAnswer.text;
            }else if([qt isEqualToString:@"ImagePicker"]){

            }else{

            }                       
            [answerArray addObject: ans];
            [ans release];
        }
        [self startQuestion:currQNum isLast:FALSE];     
        currQNum++;
    }else{
        Answer* ans = currQ.question.answer;
        ans.questionId = currQ.question.qId;
        ans.answer = currQ.sliderLabel.text;
        ans.entryId = @"1";//temporary;
        [answerArray addObject: ans];
        [ans release];
        //store data temporarily - section finished     
        [self startQuestion:currQNum isLast:TRUE];              
        currQNum++;
    }
}
  • 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-23T18:45:20+00:00Added an answer on May 23, 2026 at 6:45 pm

    Possibly you meant:

    NSLog(@"%@", currQ.inputAnswer.text);
    

    The error message:

    error: request for member ‘inputAnswer’ in something not a structure or union

    means that the compiler cannot recognize currQ as a structure or a union (or an Objective-C object).

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

Sidebar

Related Questions

I keep getting this error when trying to view my channels controller. uninitialized constant
I keep getting this error while trying to modify some tables. Here's my code:
Keep getting this error after inserting a subdatasheet into a query and trying to
I am trying to do a terminal update and I keep getting this error,
I'm trying to use slime from CVS (2009-01-05) but keep getting this error: LOAD:
While trying to host the CLR, I keep getting this: error C2440: 'function' :
Im trying to use Date Formatters (NSDateFormatter), but I keep getting this error: Program
Trying to install pear package and keep getting this strange error. Can you shed
I am trying to grab a webpage with actionscript, but keep getting this error
I keep getting this error when trying to do a git pull or a

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.