3

I am making an iPhone application, and I want to use libical to parse .ics dat from an .ics file or from the URL location of the .ics file.

Firstly, how would I go about using libical in my project? How can I add it into my iPhone project, etc.? I’ve seen some guides, but they seem to be specific to OSX projects and not iPhone projects..

Secondly, how can I parse event names and their descriptions, so that I can store the event names/ descriptions as variables?

Is this possible using libical? If so, roughly how may I go about implementing this?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Ibz
  • 518
  • 1
  • 8
  • 26
  • Please post the links to the guides you've found. They should be easily adaptable to iOS development. – Dave DeLong Feb 20 '11 at 20:03
  • One thing to be aware of is that libical is available under the GPL, which basically means you can't use it in an app that's distributed via the App Store. – Dave DeLong Feb 20 '11 at 20:11
  • Its mainly for a project at university and i dont think itl get that far.. i think i should probably read up on whether it would be suitable.. Also the link for the guide i mentioned is: http://confuseddevelopment.blogspot.com/2007/01/shipping-libical-in-mac-application.html – Ibz Feb 20 '11 at 23:43
  • **i dont think itl get that far *i.e. to the appstore – Ibz Feb 21 '11 at 02:53

2 Answers2

2

I found an excellent library for parsing .ics files. There are a whole lot of functions too for other tasks, like managing calendar and calendar events.

MXLCalendarManager

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
7vikram7
  • 2,764
  • 1
  • 25
  • 43
2

.ics data files are relatively easily parsable. Open one in a text editor and take a look.

I've implemented an ics parser before for exactly what you're trying to do. It took me a couple of hours, and trying to get all sorts of libraries to compile used taken me more in a few occasions :)

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Zaky German
  • 14,324
  • 4
  • 25
  • 31
  • The fact that you replied at all means a lot!!! :) Could you by any chance maybe direct me to some source code examples? or would you be able to share some example code from when you did it? as the purpose is the same i feel the way you went about it may very well be better for me.. As ive spent the best part of a few months trying to make a breakthough with no luck :( Thank You for anything you can share :) – Ibz Feb 20 '11 at 23:45
  • I am trying to find how to create the ics file also but don't see how to did you have any luck??? – BDGapps Jun 02 '11 at 21:09
  • @brandon's design group open the file with a text editor. The way the events and their metadata are organized in the file are relatively simple to understand. use nsstring stringWithContentsOfFile to read the file. Use NSScanner to parse and extract the data in a loop. – Zaky German Jun 02 '11 at 21:41
  • @brandon's design group not sure what you mean – Zaky German Jun 02 '11 at 21:50
  • In my app I want it to sent an email with the ics attachment. So I have to create it.. How?? – BDGapps Jun 02 '11 at 21:54
  • @brandon's design group you might wanna look into mfmailcomposeviewcontroller http://www.google.co.il/url?sa=t&source=web&cd=2&ved=0CDMQFjAB&url=http%3A%2F%2Fdeveloper.apple.com%2Flibrary%2Fios%2Fdocumentation%2FMessageUI%2FReference%2FMFMailComposeViewController_class%2FReference%2FReference.html&ei=sAfoTeaiOYr1-gb4_43XDw&usg=AFQjCNEy0N4fIBDa7A5-BSDod2UOrUJqAw&sig2=0Aj8vM1RBnJEO8hxxNNZAg – Zaky German Jun 02 '11 at 21:59
  • It is incomprehensible near *"to compile used taken me more"*. – Peter Mortensen Jul 27 '23 at 12:50