Bug 2987 - MonoTouch.EventKit.EKCalendar.Title is r/o
Summary: MonoTouch.EventKit.EKCalendar.Title is r/o
Status: RESOLVED FIXED
Alias: None
Product: iOS
Classification: Xamarin
Component: Xamarin.iOS.dll ()
Version: 5.0
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Sebastien Pouliot
URL:
Depends on:
Blocks:
 
Reported: 2012-01-20 10:18 UTC by Olaf Bartelt
Modified: 2012-01-20 11:47 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Olaf Bartelt 2012-01-20 10:18:29 UTC
In MonoTouch, the property MonoTouch.EventKit.EKCalendar.Title is read only, which is wrong (in the iOS SDK, this property is writeable and needed in order to create a new calendar with a custom title). 

Any workaround/bugfix for this? Or another way to create a custom calendar with a title?
Comment 1 Sebastien Pouliot 2012-01-20 11:20:18 UTC
You're right, it should be read/write. I'll fix this and provide you with a workaround.
Comment 2 Sebastien Pouliot 2012-01-20 11:47:36 UTC
I reviewed the EKCalandar type [1] and also added a missing setter for the CGColor property and removed the (unusable) default constructor.

[1] http://developer.apple.com/library/ios/documentation/DataManagement/Reference/EKCalendarClassRef/Reference/Reference.html#//apple_ref/occ/instp/EKCalendar/title

This will be fixed in future releases. In the mean time you can use the following code as a workaround:

			EKEventStore store = new EKEventStore ();
			var c = EKCalendar.FromEventStore (store);
			
			Selector selSetTitle = new Selector ("setTitle:");
			using (var ns = new NSString ("my title")) {
				MonoTouch.ObjCRuntime.Messaging.void_objc_msgSend_IntPtr (c.Handle, selSetTitle.Handle, ns.Handle);
			}

Thanks for your report!