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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T02:39:45+00:00 2026-05-31T02:39:45+00:00

Here is my .h file When I run this code and select a text

  • 0

Here is my .h file

When I run this code and select a text field, a pickerview pop’s with question marks in it
but when I select question mark I get correct values in text field

#import <UIKit/UIKit.h>

#import "ScrollableViewController.h"
#import "MIBackgroundTapDelegate.h"


//@interface Activapc1 : UIViewController {
@interface Activapc1 : ScrollableViewController <MIBackgroundTapDelegate, UIPickerViewDelegate, UIPickerViewDataSource>{   

UITextField *amplitude1;
UITextField *rate1;
UITextField *pulse_width1;
UITextField *impedance1;

IBOutlet UITextField *configuration;
NSArray *mode;

}

@property (nonatomic, retain) IBOutlet UITextField *amplitude1;
@property (nonatomic, retain) IBOutlet UITextField *rate1;
@property (nonatomic, retain) IBOutlet UITextField *pulse_width1;
@property (nonatomic, retain) IBOutlet UITextField *impedance1;

-(IBAction)next;
-(IBAction)skip;
-(IBAction)home;
-(IBAction)select;

-(IBAction)textFieldDoneEditing:(id) sender;

@end

Here is .m file

I am not able to understand why I am getting question mark please help me

#import "Activapc1.h"
#import "dbsViewController.h"
#import "Activapc2.h"
#import "APCoption.h"



@implementation Activapc1

@synthesize amplitude1;
@synthesize rate1;
@synthesize pulse_width1;
@synthesize impedance1;

const int MyModePicker = 3002;

-(void)viewDidLoad {
self.svScrollViewM.contentSize = CGSizeMake(320, 416);
[self registerForEditingEvents:amplitude1];
[self registerForEditingEvents:rate1];
[self registerForEditingEvents:pulse_width1];
[self registerForEditingEvents:impedance1];

UIPickerView *modePicker = [[UIPickerView alloc] initWithFrame:CGRectZero];
modePicker.tag = MyModePicker;
modePicker.delegate = self;
modePicker.dataSource = self;
[modePicker setShowsSelectionIndicator:YES];
configuration.inputView = modePicker;
[modePicker release];

[super viewDidLoad];

    //Prepare data for pickers
    mode = [NSArray arrayWithObjects:@"Voltage",@"Current",nil];



[mode retain];

//mode = [[NSMutableArray alloc] init];
//[mode addObject]
}

//********picker view code**************

#pragma mark -

#pragma mark UIPickerViewDelegate

-(NSString *)pickerView:(UIPickerView *)pickerView titileForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view
{
    if(pickerView.tag == MyModePicker)
    {
        return [mode objectAtIndex:row];
    }
    return @"Unknown title";

}

-(void) pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
        if(pickerView.tag == MyModePicker)
        {
            configuration.text = (NSString *)[mode objectAtIndex:row];
        }
}

#pragma mark -

#pragma mark UIPickerViewDataSource

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)pickerView    numberOfRowsInComponent:(NSInteger)component
{
    if(pickerView.tag == MyModePicker)
    {
        return mode.count;
}
return 1;
}

#pragma mark -

//**********picker view code end************

-(IBAction) backgroundTap:(id) sender{
[self.amplitude1 resignFirstResponder];
[self.rate1 resignFirstResponder];
[self.pulse_width1 resignFirstResponder];
[self.impedance1 resignFirstResponder];
}

-(IBAction) textFieldDoneEditing:(id)sender{
[sender resignFirstResponder];
}

-(IBAction)home {
dbsViewController *dbs = [[dbsViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:dbs animated:YES];
}

-(IBAction)skip {
Activapc2 *activapc2 = [[Activapc2 alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:activapc2 animated:YES];
}

-(IBAction)next {
Activapc2 *activapc2 = [[Activapc2 alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:activapc2 animated:YES];
}

-(IBAction)select {
APCoption *apcoption = [[APCoption alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:apcoption animated:YES];
}




- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];

// Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}


- (void)dealloc {
[mode release];
[super dealloc];
}



@end
  • 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-31T02:39:46+00:00Added an answer on May 31, 2026 at 2:39 am

    The pickerview needs a title not a titile. Also the delegate method that returns the string does not have a reusingView: parameter. Since you don’t properly implement the delegate method the picker simply displays question marks.

    -(NSString *)pickerView:(UIPickerView *)pickerView titileForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view;
    

    I believe it should be:

    -(NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've seen this one-liner perl -lane '$_{$F[0]}+=$F[1]}print$_ $_{$_}for keys%_;{' file here: How can I
I'm reading a js file at here , on the very top of this
Here goes a newbie question: Create a new project in Xcode: File > New
I've been trying to get this program to work, but when I try to
This is related to my previous question , but it seems I have another
Can any one help me how to run this code... If I compile this
Something's screwy here. I'm trying to parse this XSL file: <?xml version=1.0 encoding=utf-8?> <xsl:stylesheet
How can know, if select( Choice Or Browse... ) file in input:file run some
Sorry in advance everyone for this question as I know the cascading select boxes
I downloaded the swc file from here: http://developer.yahoo.com/maps/flash/flexGettingStarted.html And put it in my flex

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.