Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DatePicker callback freezes screen #42

Closed
zackhsuan opened this issue Sep 17, 2014 · 12 comments
Closed

DatePicker callback freezes screen #42

zackhsuan opened this issue Sep 17, 2014 · 12 comments

Comments

@zackhsuan
Copy link

The date time picker shows up when clicked on a button in a tableview cell. when selected a date, the picker disappeared and everything got frozen. touching and clicking did not work on the screen.

any ideas?

@skywinder
Copy link
Owner

Hi. I implement similar thing in my example project right now (commit 0a1cfdd). Can you check it and compare this example with your code?

@zackhsuan
Copy link
Author

Hi

my code looks like this:

- (IBAction)timeSelected:(id)sender {
    ActionSheetDatePicker *picker = [[ActionSheetDatePicker alloc] initWithTitle:@"" datePickerMode:UIDatePickerModeDateAndTime selectedDate:date target:self action:@selector(dateTimeSelected:onSender:) origin:sender];
    picker.minimumDate = [NSDate date];
    picker.hideCancel = YES;
    [picker showActionSheetPicker];
}
-(void) dateTimeSelected:(NSDate *) selected onSender:(id) sender{
    [self.timeSelector setTitle:[UIUtils dateToString:date format:@"MM.dd HH:mm"] forState:UIControlStateNormal];
}

I think it is the same as the example right? So wondering why that happened.

@skywinder
Copy link
Owner

Can you implement the same scenario in example project? Is it reproduced?

@DoctorG
Copy link

DoctorG commented Sep 17, 2014

I have the same problem.  The picker works and calls the appropriate action @selector but then the UI freezes and I can tap on nothing.  At odds to figure out why?  

-- 
Gregory P. Moore, MD

From: Zack Chung [email protected]
Reply: skywinder/ActionSheetPicker-3.0 [email protected]>
Date: September 17, 2014 at 2:26:48 AM
To: skywinder/ActionSheetPicker-3.0 [email protected]>
Subject:  [ActionSheetPicker-3.0] DatePicker callback freezes screen (#42)

The date time picker shows up when clicked on a button in a tableview cell. when selected a date, the picker disappeared and everything got frozen. touching and clicking did not work on the screen.

any ideas?


Reply to this email directly or view it on GitHub.

@skywinder skywinder added the bug label Sep 17, 2014
@skywinder
Copy link
Owner

@DoctorG very strange. I can't reproduce it yet.
Please, put more information about bug: iOS version? iphone/iPad? simulator/device? Swift/Obj-C?

@DoctorG
Copy link

DoctorG commented Sep 17, 2014

I'm Using:

  • Xcode6 GM/iOS8 SDK
  • Compiling for iOS 7.0 Target for iPhone
  • Objective-C
  • v1.1.11 via Cocoapods

Code:

-(IBAction)lmpButtonClicked:(id)sender {
    NSDate *pickerDate = self.patient.lmp;
    if (!self.patient.lmp) {
        pickerDate = [OBPatientTrackerAppDelegate stripTimeFromDate:[NSDate date]];
    }
    lmpActionSheetPicker = [[ActionSheetDatePicker alloc] initWithTitle:@"LMP" datePickerMode:UIDatePickerModeDate /*minInterval:15*/ selectedDate:pickerDate target:self action:@selector(lmpDateWasSelected:element:) origin:self.view];
    lmpActionSheetPicker.hideCancel = NO;
    [lmpActionSheetPicker addCustomButtonWithTitle:@"Delete" value:[OBPatientTrackerAppDelegate dateFromSqlDateFormat:@"2001-01-01"]];
    [lmpActionSheetPicker showActionSheetPicker];
}

#pragma mark - Actionsheet selectors

-(void)lmpDateWasSelected:(NSDate *)selectedDate element:(id)element {
    selectedDate = [OBPatientTrackerAppDelegate stripTimeFromDate:selectedDate];
    self.patient.lmp = selectedDate;
    self.patient.lmpIsUnknown = NO;
    [self updateLabels];
    [self updateSaveButton];
}

@DoctorG
Copy link

DoctorG commented Sep 18, 2014

I have confirmed the freezing happens both on the Simulator and on iPhone 5s running iOS8.

I would really appreciate help as iOS8 update broke the old version of ActionSheetPicker3.0 in my app for users and the new version is freezing.

I'm still looking for clues as to why this is freezing after calling the done selector (or cancel). Does this view look correct?

screen shot 2014-09-18 at 7 46 27 am

@DoctorG
Copy link

DoctorG commented Sep 19, 2014

Ok if you can help me figure out how to trap this error in the debugger I might be able to help figure out what is going on:

2014-09-18 23:07:20.096 OBPatientTracker[61100:2572510] unexpected nil window in _UIApplicationHandleEventFromQueueEvent, _windowServerHitTestWindow: (null)

@skywinder
Copy link
Owner

@DoctorG Yes, it looks correct. Is selector lifted after done button pressed?

@DoctorG
Copy link

DoctorG commented Sep 20, 2014

Yes the selector fires and runs the appropriate method if thats what you’re asking, but then the program is apparently in a run loop and the _windowServerHitTestWindow appears to to be NULL so I think that’s why touch events are not registering.  But I’m out of my league here I don’t know how to further debug the problem or why it is happening in the first place.  I sure would love it if we could solve this problem because I’ve been relying on the ActionSheetPicker Library and I’m stuck.  

Thank you so much for the all your (and other’s) hard work on this library!

-- 
From: Petr Korolev [email protected]
Reply: skywinder/ActionSheetPicker-3.0 [email protected]>
Date: September 19, 2014 at 6:24:06 AM
To: skywinder/ActionSheetPicker-3.0 [email protected]>
Cc: Gregory P. Moore, MD [email protected]>
Subject:  Re: [ActionSheetPicker-3.0] DatePicker callback freezes screen (#42)

@DoctorG Yes, it looks correct. Is selector lifted after done button pressed?


Reply to this email directly or view it on GitHub.

@skywinder
Copy link
Owner

It will be much easier to fix, if I will be able to reproduce it.
Can you try to modify example project in special brunch and reproduce this behaviour?

@skywinder
Copy link
Owner

Fixed in 1.1.14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants