i have a problem with a UIDatePicker since it doesn't appear on the view in my app.
This is the code i have for the UIDatePicker:
self.datePicker = [[UIDatePicker alloc] init];
self.datePicker.frame = CGRectMake(10,170, self.view.window.frame.size.width, 200);`
NSDate *maxDate = [NSDate dateWithTimeInterval:94608000 sinceDate:[NSDate date]];`
self.datePicker.maximumDate = maxDate;
self.datePicker.minimumDate = [NSDate date];
self.datePicker.datePickerMode = UIDatePickerModeDate;
[self.view addSubview:self.datePicker];
I tested to see if the UIDatePicker was nil but turns out it wasn't, it's like the view is loaded but just invisible i even had it log a date in the console.
I have been trying to find a solution for a long time now, but without success. Does anyone know what i am doing wrong?
Extra Info:
I have deleted the Framework Search Paths in my MyAppTests targets in order to make a warning go away after an update in Xcode, this was before i noticed the UIDatePicker. I don't know if that could have affected it.
EDIT: I did also update to recommended settings on my app / project.
In CGRectMake
you have an error when you set the width of frame. self.view.window.frame.size.width
retun 0. You need to set self.view.frame.size.width
. I Hope it work for you!