IPAD must-haves. And fun-to-haves.

Brighten your iPad with a colorful cover, stream to your TV, download pictures from your digital camera, and more. There’s already so much you can do with iPad and iPad mini

Apple Wireless Keyboard

The incredibly thin Apple Wireless Keyboard uses Bluetooth technology, which makes it compatible with iPad

Apple unveils iPad mini: ‘Thin as a pencil, light as paper’

iPad inspires creativity and hands-on learning with features you won’t find in any other educational tool

Lightning connector and FaceTime HD camera

Apple announces 4th generation iPad packing an A6X CPU

Pages

Showing posts with label calendar. Show all posts
Showing posts with label calendar. Show all posts

Saturday, January 26, 2013

Search Calendar using title property

Hi all!

I'm newbe to iOS programming.

Now i'm try to make an app that permits to the user to make events in one specified calendar.

The problem is that:

I cant find a solution to know if there's a calendar with the title that i want to use.

If the list is empty i write a code that create the calendar but if the list isn't empty i need to know if there's a calendar with the calendar.title that i need.

If there isn't i create the calendar if there i i add the event to this calendar.

 

I post the code below:

 

    EKEvent *myEvent;

    EKEventStore *store;

    EKSource* localSource;

    EKCalendar* newCal;

 

    store = [[EKEventStore alloc] init];

    myEvent = [EKEvent eventWithEventStore: store];

    NSString* title         = [arguments objectAtIndex:1];

    NSString* location      = [arguments objectAtIndex:2];

    NSString* message       = [arguments objectAtIndex:3];

    NSString* startDate     = [arguments objectAtIndex:4];

    NSString* endDate       = [arguments objectAtIndex:5];

    NSString* calendarTitle = [arguments objectAtIndex:6];

    //NSString* calID = nil;

    //int i = 0;

 

    EKCalendar* calendar = nil;

    if(calendarTitle == nil){

        calendar = store.defaultCalendarForNewEvents;

    } else {

        NSIndexSet* indexes = [store.calendars indexesOfObjectsPassingTest:^BOOL(id obj, NSUInteger idx, BOOL *stop) {

            *stop = false;

            EKCalendar* cal = (EKCalendar*)obj;

            if(cal.title == calendarTitle){

                *stop = true;

            }

            return *stop;

        }];

 

        if (indexes.count == 0) {

            //if list is empty i haven't calendars then i need to create it

            for (EKSource* source in store.sources)

            {

                if (source.sourceType == EKSourceTypeLocal)

                {

                    localSource = source;

                    break;

                }

            }

 

            if (!localSource) return;

 

            newCal = [EKCalendar calendarWithEventStore:store];

            calendar.source = localSource;

            calendar.title = calendarTitle;

 

            NSError* error;

            bool success = [store saveCalendar:newCal commit:YES error:&error];

 

            if (error != nil)

 

            {

                NSLog(error.description);

            }

            //calendar created

 

        } else {

 

            //!Empty List i need to search the calendar with the title = calendarTitle

            //And if there isn't i need to create it

 

 

 

            //calendar = [store.calendars objectAtIndex:[indexes firstIndex]];

        }

    }

 

 

Thanks for helping me and sorry for my poor english


View the original article here

Saturday, January 5, 2013

iCloud 'Home' calendar simply disappeared overnight while sleeping. Any ideas?

Not much to this. It was there went I went to sleep, gone when I woke up. Simply no idea.


View the original article here