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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T00:53:56+00:00 2026-05-26T00:53:56+00:00

I am creating a textField which when clicked UIPickerView comes up. When I run

  • 0

I am creating a textField which when clicked UIPickerView comes up.
When I run this code there is an error:
Thread 1:Profram received signal:"SIGABRT".

I am quite new on iPhone development, but the person in charge is away and I am taking on a project.

If you could let me know what’s wrong with this…

This is how the ViewController.h looks like:

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController {

IBOutlet UIPickerView *picker;
IBOutlet UITextField *text;

}


- (IBAction)showPicker:(id)sender;


@end

and ViewController.m:

#import "ViewController.h"
@implementation ViewController
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Release any cached data, images, etc that aren't in use.
}

#pragma mark - View lifecycle

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.
}

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

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
}

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
}

- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
}


- (void)viewDidDisappear:(BOOL)animated
{
[super viewDidDisappear:animated];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
} else {
    return YES;


}
}

- (void)showPicker {

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate:self];
picker.center = CGPointMake(160, 240);
[UIView commitAnimations];


if (!self.navigationItem.rightBarButtonItem) {
    UIBarButtonItem *doneButton = [[UIBarButtonItem alloc]     initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(done:)];
    [self.navigationItem setRightBarButtonItem:doneButton animated:YES];
  //  [doneButton release];
}   
}


- (void)hidePicker {

[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.4];
[UIView setAnimationDelegate:self];
picker.center = CGPointMake(160, 240);
[UIView commitAnimations];


[self.navigationItem setRightBarButtonItem:nil animated:YES];
}


- (void)done:(id)sender {

[self hidePicker];

[self.navigationItem setRightBarButtonItem:nil animated:YES];
}


- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField {

[self showPicker];

return NO;
}
  • 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-26T00:53:57+00:00Added an answer on May 26, 2026 at 12:53 am
    - (IBAction)showPicker:(id)sender;
    

    this function is not implemented in your .m file instead of -(void) showPicker use the above one…

    and what is the use of this…

    - (void)done:(id)sender
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a mixin which renders a javascript file when a textfield gains
I make a keyboard from UIButtons. On this keyboard there are 49 UIButtons, which
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
(creating a separate question after comments on this: Javascript redeclared global variable overrides old
I am creating a system which updates the user activity when something is done.
I am creating a jasper report.In that I want to write one method which
I have 4 UITextFields that I'm dynamically creating, in the viewDidLoad, which works good.
I am creating a DotNetNuke module which is a simple text field which the
I am creating a java app. I have one class q2a2 which is a
I am creating a music player which uses the spacebar to pause and play

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.