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

Issue in origin #245

Closed
Dubey-Quod opened this issue Jan 6, 2016 · 1 comment
Closed

Issue in origin #245

Dubey-Quod opened this issue Jan 6, 2016 · 1 comment

Comments

@Dubey-Quod
Copy link

Hi,

I am using ActionSheetDatePicker to get the time input in two of my text fields. Below is the code for that:

func textFieldDidBeginEditing(textField: UITextField) {        
            self.activeTextField = textField
            let datePicker = ActionSheetDatePicker(title: "Time:", datePickerMode: UIDatePickerMode.Time, selectedDate: NSDate(), target: self, action: "datePicked:", origin: self)            
            datePicker.minuteInterval = 20
            datePicker.showActionSheetPicker()
    }

However it throws below error when I click on the desired text field:

2016-01-06 10:46:06.512 Smartertime[6019:29888] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid origin provided to ActionSheetPicker ( <Smartertime.CollectionViewController: 0x7f8c5c0a8bf0> )'
*** First throw call stack:
(
    0   CoreFoundation                      0x0000000109004e65 __exceptionPreprocess + 165
    1   libobjc.A.dylib                     0x00000001060cfdeb objc_exception_throw + 48
    2   CoreFoundation                      0x0000000109004cca +[NSException raise:format:arguments:] + 106
    3   Foundation                          0x00000001097864de -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 198
    4   ActionSheetPicker_3_0               0x0000000106892189 -[AbstractActionSheetPicker initWithTarget:successAction:cancelAction:origin:] + 665
    5   ActionSheetPicker_3_0               0x000000010689b30a -[ActionSheetDatePicker initWithTitle:datePickerMode:selectedDate:target:action:origin:cancelAction:] + 266
    6   ActionSheetPicker_3_0               0x000000010689af15 -[ActionSheetDatePicker initWithTitle:datePickerMode:selectedDate:target:action:origin:] + 261
    7   Smartertime                         0x00000001045b967a 

Thanks in advance for the solution.

@Dubey-Quod
Copy link
Author

found the solution. Replaced the origin from "origin: self" to "origin: self.UItextfield".

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

No branches or pull requests

2 participants
@Dubey-Quod and others