[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: NSData help needed
From: |
Helge Hess |
Subject: |
Re: NSData help needed |
Date: |
Thu, 25 Dec 2003 22:09:44 +0100 |
On 24.12.2003, at 13:29, Dennis Leeuw wrote:
I am writing a tool that will parse the iCal data.
You might want to take a look into the sources of OpenGroupware.org. We
provide two different iCal SAX drivers as well as some higher level
objects for dealing with iCal (NGiCal).
I am at the point that I have all file I/O figured out.
The current Calendar (and .ics file) is stored like this:
currentCalendar = [NSFileHandle fileHandleForReadingAtPath:inCalendar];
calendarData = [currentCalendar readDataToEndOfFile];
Why don't you use [NSData dataWithContentsOfMappedFile:]?
But now I need to walk through the newCalendarData to figure out where
events start and finish. But I can't find any documentation that
describes this in a newbie way.
Can someone point me in the right direction?
Well, since iCal is a text based format, you probably should first
convert it to an NSString (initWithData:encoding:). Then you could use
NSScanner or just write an own iCal parser which steps through the
characters of the string.
Greets,
Helge
--
I'm describing in a paragraph what took 14 hours to figure out. You may
want to sniff glue for a while, then reread this when you get out of
rehab. [aLa]