我正在尝试选择一堆文件,使用:
Set fd = Application.FileDialog(msoFileDialogFilePicker)
然后我必须处理每个选定的文件(我允许多个选择)并将其写回目标目录。 我的问题是,当我使用时:
Set destFolder = Application.FileDialog(msoFileDialogFolderPicker)
选择目标文件夹,fd
被覆盖,因为Application对象只能实例化单个FileDialog
对象。然后我从SelectedItems
中删除了fd
列表。
我该怎么做才能保留列表进行迭代?
答案 0 :(得分:0)
只需保存fd。
返回的SelectedItems列表try below code...
eventStore = [[EKEventStore alloc] init];
// Create a new event object.
EKEvent *event = [EKEvent eventWithEventStore: eventStore];
// Set the event title.
event.title = eventMessage;
// Set its calendar.
NSString *identifier=[[NSUserDefaults standardUserDefaults]objectForKey:@"calenderId"];
// NSLog(@"cal identifier: %@",identifier);
event.calendar = [eventStore calendarWithIdentifier:identifier];
//set Alarm
NSTimeInterval secondsInOneHours = 1 * 60 * 60;
NSDate *dateOneHoursAhead = [eventDate dateByAddingTimeInterval:secondsInOneHours];
// Set the start and end dates to the event.
event.startDate = eventDate;
event.endDate = dateOneHoursAhead; //
NSError *error;
if ([eventStore saveEvent:event span:EKSpanFutureEvents commit:YES error:&error]) {
/ NSLog(@"Event Added");
}
else{
An error occurred, so log the error description.
NSLog(@"%@", [error localizedDescription]);
}