Hallo,
also ich bin gerade ratlos…
Ich füge iCal einen neuen Kalender hinzu und der Zeiger ist auf einen anderen Kalender gerichtet.
D.h. wenn ich Kalender A anlege, dann bekomme ich mal den Zeiger auf B, C etc. - total dubios.
Code, siehe unten…
Sieht da jemand einen Fehler?
Viele Grüße
Alles anzeigen
also ich bin gerade ratlos…
Ich füge iCal einen neuen Kalender hinzu und der Zeiger ist auf einen anderen Kalender gerichtet.
D.h. wenn ich Kalender A anlege, dann bekomme ich mal den Zeiger auf B, C etc. - total dubios.
Code, siehe unten…
Sieht da jemand einen Fehler?
Viele Grüße
C-Quellcode
- +(APCalendarCalendar*)wc_createCalendarWithName:(NSString*)name
- {
- // …
- if([name length] < 1)
- {
- return nil;
- }
- // …
- APCalendarApplication *application = [SBApplication applicationWithBundleIdentifier:@"com.apple.iCal"];
- if(application == nil)
- {
- return nil;
- }
- // …
- SBElementArray *array = [application calendars];
- if(array == nil)
- {
- return nil;
- }
- // …
- NSMutableDictionary *mutableDictionary = [NSMutableDictionary dictionary];
- if(mutableDictionary == nil)
- {
- return nil;
- }
- // …
- // tell application "Calendar" to delete (every calendar whose name begins with "tmpTEST")
- // …
- [mutableDictionary wc_setObject:@"tmpTEST" // TODO
- forKey:@"name"];
- // …
- Class class = [application classForScriptingClass:@"calendar"];
- if(class == NULL)
- {
- return nil;
- }
- APCalendarCalendar *calendar = [[[class alloc] initWithProperties:mutableDictionary] autorelease];
- if(calendar == nil)
- {
- return nil;
- }
- // …
- [array addObject:calendar];
- // …
- return calendar;
- // …
- }
Dieser Beitrag wurde bereits 2 mal editiert, zuletzt von little_pixel ()