iOS 5 ics (iCalendar) reading/parsing from webURL - objective-c

since iOS5 there ist the possibility to set an EKEventSource to EKSourceTypeCalDAV. Does anybody know if it is possible to receive events from a webUrl?
The webURL (lets take the google calendar as an example) returns the data in an ics file (iCalendar format)
I do not want the iCal-App to read the ics data, but to use the Eventkit framework to receive events within my own app.
Thanks in advance.

It isn't possible to "set an EKEventSource to EKSourceTypeCalDAV". EKSourceTypeCalDAV just tells you that the particular EKSource is a CalDAV account, as opposed to one of the other types that can be configured in iOS. sourceType is a read-only property.
For clarity, an EKSource object is retrieved from an EKEventStore, which represents the iOS Calendar database. I'm not aware of an "EKEventSource".
EventKit isn't suitable for your purposes, it is for interacting with events contained within the iOS Calendar database (and app). But you can use this project to import external ics file,
Ical for Objective-c

Related

Adding licence field to WSO2 API in API manager

I have the need to add a licence field to the APIs published by the API manager.
It does not seems to be any extension point beyond the api.rxt file in the resource folder.
If I modify the file and run the application the carbon app correctly show the added field, but nor the publishe nor the store are able to get the field and there is no way to get it also with REST APIs since it calls a method of a class that (in later versions) outputted fields positionally.
Is it possible to add the field, without running the risk of crashing the API Manager?
Which is the correct way?
Thanks
This change cannot be done without modifying the code. When an API is created from the Publisher app, it gets stored in the registry. The api.txt you modified, only defines the structure of this stored artifact. It may add a new field to the artifact, but to correctly populate that field, you need to modify several methods in APIProviderHostObject and APIProviderImpl + several Jaggery scripts.

Alarm Clock Settings

I am building an alarm app using local notifications.
I want to add settings inside my app.
So for this I have created the whole view,now I am confused how to store data for multiple alarms?
Whether i should use NSUserDefaults or sqlite.
You have all the choices:
a) Use NSUserDefaults by doing some simple Key amendments like with keys like SettingAttr = Value, e.g. "MyAlarm0Start" = 10:23:12, "MyAlarm1Start" = ... and for instance the number "MyAlarmCount" = 2
or use
b) a complete data model by CoreDate or SqlLite.
I think this strongly depends on how much data you want to store.
Concerning iTunes library am do not understand what you wanted to know.
Edit: Picking things from your media library is handled via the "Media Player Framework", see Apple Doc IPod Library Access.

How to modify the default receiver list in system Mail app

I'm using Objective-C. I wonder is there any plug-ins or libraries that can allow me to modify the default receiver list in system Mail app?
For example, I have made an app which can scan a card and fetch the E-mail information on it.
Now, I'd like to put the E-mail data I've fetched into system Mail app's receiver list. That is, when I use the system Mail app and write a new mail, I can see the E-mail address I fetched when I type some letters in the receiver column.
Is that possible to achieve?
This list is stored as a Sqlite database and it should be possible to append to it from another process, even while Mail.app is running. I haven't tested it, though.
The following article should help. It describes how to delete entries but adding new ones would work in pretty much the same way: http://hints.macworld.com/article.php?story=20110516152604993

Where to store some information written in file in Cocoa?

I'm new in Cocoa. My app is getting information from server, and displaying UNC paths of shared folders. I want to be able to store information of my Absoulte paths for each folder, so later I can display them in my APP. With more details
UNC Path - //CompName/sharedFolder
Absoulte Path -/Users/user/desktop/SharedFolder
So I need to store somewhere all that ABsolute paths locally on computer, after I can browse UNC paths from server, and display their Absoule paths.
What is the best way to store information? I know it is possible to use Core DAta. But I haven't designed for that my App. Can I store infromation in hiden file, and read it from there? How can I do it?
Thanks a lot.
It looks like you are looking for the NSUserDefaults class. From the documentation:
The NSUserDefaults class provides a programmatic interface for interacting with the defaults system. The defaults system allows an application to customize its behavior to match a user’s preferences. For example, you can allow users to determine what units of measurement your application displays or how often documents are automatically saved. Applications record such preferences by assigning values to a set of parameters in a user’s defaults database. The parameters are referred to as defaults since they’re commonly used to determine an application’s default state at startup or the way it acts by default.
You just tell it what data you want to store.

Creating a webarchive from objective-c

We are updating our email signatures in the company I work for and since the last update a lot of our employees have swithes to Mac. Allthough they have switched, few are techincal experts.
Many of our users use the Mail app in OSX. To install a HTML signature in the Mail app it quite an hassle which I would like to improve for these users.
What I want to do is to create an OSX app that uses an build in template and filles that template with the users name, job title, phone number ect.
BUT, now the "hard" part comes... how can I make a webarchive from the HTML page that is the result of the template?
And also, can I programaticly add this to Mail?
Best regards,
Paul Peelen
Creating .webarchive is easy. Use the command line tool textutil, or use WebView's method [[[webView mainFrame] dataSource] webArchive] to get it.
You can change the signatures stored in Mail.app via Applescript. See its dictionary using AppleScript Editor.app. It accepts a rich text as an argument, so you might want not the webarchive but a rich text.
You can also look at my Applescripts on Mail signatures - hints.macworld.com that a wrote a while ago.
Which may be of some help. They use Textutil to import and export Mail signatures.
Also have a look at Preferences Utilities Reference which may help you to update the SignaturesByAccount.plist in Objective C.
And the value Types section of Accessibility Roles and Attributes Reference to get an idea of the the abstract value types, and their specific C and Objective-C types. I.e NSArray = CFArrayRef. You will need those for the plist.