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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T04:29:22+00:00 2026-06-10T04:29:22+00:00

-(IBAction)showDate:(id)sender { datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 220, 325, 300)]; datePicker.datePickerMode = UIDatePickerModeDate; datePicker.hidden

  • 0
-(IBAction)showDate:(id)sender
{
datePicker = [[UIDatePicker alloc] initWithFrame:CGRectMake(0, 220, 325, 300)];
datePicker.datePickerMode = UIDatePickerModeDate;
datePicker.hidden = NO;
datePicker.date = [NSDate date];
[datePicker setDate:datePicker.date animated:YES];
[self.view addSubview:datePicker];
}



- (void)setDate:(NSDate *)date animated:(BOOL)animated
{
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"dd/MM/yyyy"];
NSString *str = [df stringFromDate:date];
NSLog(@"String is------:%@",str);
[dateBtn setTitle:str forState:UIControlStateNormal];
}

i have gone through UIDatePicker Class reference in Apple’s Doc.Based on that i have implemented the code as above.there i am getting only current date on button when external method code is written in button action and not changing date if i am change in DatePicker.

if i write code like mention above, i dint get even any title on button.
i think, am made blunder mistake, can anyone tell me where the mistake is and explain me in detail.

Thanks alot for help 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-06-10T04:29:23+00:00Added an answer on June 10, 2026 at 4:29 am

    I think you are getting confused with subclassing, which is something you are not doing here (and don’t need to). You need to setup the date picker to call a method of your choosing when the date is changed; something like this:

    [datePicker addTarget:self
                   action:@selector(dateChanged:)
         forControlEvents:UIControlEventValueChanged];
    

    (See reference).

    And then implement the method:

    - (void)dateChanged:(UIDatePicker*)datePicker {
        NSLog("Date changed: %@", datePicker.date);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

-(IBAction)registerUpdate:(id)sender { HTTPRequest* request = [[HTTPRequest alloc] initWithUrl:@http://www.yahoo.com delegate:self]; [request doRequest]; } The HTTPRequest
- (IBAction)EnterButtonPressed:(id)sender { Sqlite *sqlite = [[Sqlite alloc] init]; NSArray *paths =NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask, YES); NSString
-(IBAction)flipView:(id)sender { MapController *nextVC = [[MapController alloc] initWithNibName:@MapController bundle:nil]; nextVC.title = @Map; nextVC.longi =
-(IBAction)printDisplay:(id)sender{ CGRect rect = CGRectMake(0.0,44.0,self.view.frame.size.width,self.view.frame.size.height); NSValue *rectObj = [NSValue valueWithCGRect:rect]; CGRect rectRestored = [rectObj
-(IBAction)buttonPressed1:(id)sender { SignView *tempVC = [[SignView alloc] initWithNibName:@SignView bundle:Nil]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationTransition:
- (IBAction)SetupButtonPressed:(id)sender { Sqlite *sqlite = [[Sqlite alloc] init]; NSString *writableDBPath = [[NSBundle mainBundle]pathForResource:@MoneyofType:@sqlite];
-(ibaction)sometouched:(id)sender { [UIView beginAnimations:@first one context:nil]; [UIView setAnimationDuration:1.0]; [myview setFrame:CGRectMake(0,y,width.height.); [UIView commitAnimations]; [UIView beginAnimations:@second
- (IBAction) charlieImputText:(id)sender { NSAppleScript *keystrokeReturn = [[NSAppleScript alloc] initWithSource:@tell application \System Events\ to
-(IBAction)startClick:(id)sender{ stick.highlighted = YES; } -(void)viewDidLoad{ [super viewDidLoad]; stick = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@ball1.png]]; stick.userInteractionEnabled=
-(IBAction) btnReturn:(id) sender{ firstView * firstview =[[firstView alloc]initWithNibName:@firstView bundle:nil]; [self.view pushViewController:firstview animated:NO]; } with

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.