我正在开发日历应用程序.我正在尝试使用指定的EKCalender保存EKEvent.但是,当我尝试运行以下代码时,它给了我错误.请帮忙
-(BOOL)createEventWithTitle:(NSString *)paramTitle startDate:(NSDate *)paramStartDate endDate:(NSDate *)paramEndDate inCalendar:(EKCalendar *)paramCalendar inEventStore:(EKEventStore *)paramStore notes:(NSString *)paramNotes
{
BOOL result = NO;
//paramCalendar = [self.eventStoreiReportShifts defaultCalendarForNewEvents];
if (self.eventsAccessGranted) {
NSArray *caledars = [self.eventStore calendarsForEntityType:EKEntityTypeEvent];
self.selectedCalendarEventKitIdentifier = [[NSUserDefaults standardUserDefaults] objectForKey:@"eventkit_cal_identifiers_string"];
for(EKCalendar *aCal in caledars){
if([aCal.calendarIdentifier isEqualToString:self.selectedCalendarEventKitIdentifier]){
paramCalendar = [self.eventStore calendarWithIdentifier:[[NSUserDefaults standardUserDefaults] objectForKey:@"eventkit_cal_identifiers_string"]];
}
}
for (EKSource *source in self.eventStore.sources) {
if (source.sourceType == EKSourceTypeCalDAV) {
paramCalendar.source = source;
break;
} else if(source.sourceType == EKSourceTypeLocal){
paramCalendar.source = source;
break;
}
}
}else{
return NO;
}
/* …
Run Code Online (Sandbox Code Playgroud) 我有一个在iOS 7和Xcode 5中运行良好的应用程序.当我将其更新到iOS 8和Xcode 6时,当应用程序尝试在轻触textField时在视图中向上滑动UIDatePicker时,它会崩溃.我正在使用故事板.有谁知道为什么?
我已经阅读了这个,但它的Xib.
应用程序在IOS 6上崩溃 - UIViewControllerHierarchyInconsistency
请帮助谢谢
我的代码:
- (void)textFieldDidBeginEditing:(UITextField *)textField
{
//set picker color start
[self.myDatePicker setBackgroundColor:[UIColor greenColor]];
//set picker color finish
//calculate bounds start
CGRect textFieldRect = [self.view.window convertRect:textField.bounds fromView:textField];
CGRect viewRect = [self.view.window convertRect:self.view.bounds fromView:self.view];
//calculate bounds finish
//calculate the fraction between the top and bottom of the middle section for the text field's midline start
CGFloat midline = textFieldRect.origin.y + 0.5 * textFieldRect.size.height;
CGFloat numerator = midline - viewRect.origin.y
- MINIMUM_SCROLL_FRACTION * …
Run Code Online (Sandbox Code Playgroud) 我正在 CloudKit 上工作,但不断收到字符不允许错误。允许使用哪些字符?
ios ×2
xcode ×2
cloudkit ×1
ekeventkit ×1
ekeventstore ×1
iphone ×1
objective-c ×1
uidatepicker ×1
uitextfield ×1