<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Miguel's OSX and iOS blog</title><link>http://tirania.org/monomac//index.html</link><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MiguelsOsxAndIosBlog" /><description>Miguel's OSX and iOS blog</description><language>en</language><copyright>Miguel de Icaza</copyright><managingEditor>miguel@gnome.org</managingEditor><generator>lb#</generator><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/MiguelsOsxAndIosBlog" /><feedburner:info uri="miguelsosxandiosblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item><title>Key-Value-Observing on MonoTouch and MonoMac</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/ARSd7Qz4OcI/Apr-19.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 19 Apr 2012 20:12:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2012/Apr-19.html</guid><description>&lt;p&gt;This morning Andres came by IRC asking questions about Key
	Value Observing, and I could not point him to a blog post that
	would discuss the details on how to use this on C#.

	&lt;p&gt; &lt;a href="https://developer.apple.com/library/mac/#documentation/cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html"&gt;Apple's
	Key-Value Observing&lt;/a&gt; document contains the basics on how to
	observe changes in properties done to objects.
	
	&lt;p&gt;To implement Key-Value-Observing using MonoTouch or
	MonoMac all you have to do is pick the object that you want to
	observe properties on, and invoke the "AddObserver" method.

	&lt;p&gt;This method takes a couple of parameters: an object that
	will be notified of the changes, the key-path to the property
	that you want to observe, the observing options and a context
	object (optional).

	&lt;p&gt;For example, to observe changes to the "bounds" property on
	a UIView, you can use this code:

	&lt;pre class="code-csharp"&gt;
view.AddObserver (
	observer: this, 
	keyPath:  new NSString ("bounds"), 
	options:  NSKeyValueObservingOptions.New, 
	context:  IntPtr.Zero);
&lt;/pre&gt;

	&lt;p&gt;In this example, I am using the C# syntax that uses the
	Objective-C style to highlight what we are doing, but you
	could just have written this as:

	&lt;pre class="code-csharp"&gt;
view.AddObserver (
	this, new NSString ("bounds"),
	NSKeyValueObservingOptions.New, IntPtr.Zero);
&lt;/pre&gt;

	&lt;p&gt;What the above code does is to add an observer on the
	"view" object, and instructs it to notify this object when the
	"bounds" property changes.

	&lt;p&gt;To receive notifications, you need to override the
	ObserveValue method in your class:

&lt;pre class="code-csharp"&gt;
public override
void ObserveValue (NSString keyPath, NSObject ofObject,
			NSDictionary change, IntPtr context)
{
    var str = String.Format (
	"The {0} property on {1}, the change is: {2}",
        keyPath, ofObject, change.Description);

    label.Text = str;
    label.Frame = ComputeLabelRect ();
}
&lt;/pre&gt;

	&lt;p&gt;This is what the app shows if you rotate your phone:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/5a85f5d0.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;The complete sample has been uploaded
	to &lt;a href="https://github.com/xamarin/monotouch-samples/tree/master/KeyValueObserving"&gt;GitHub&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/ARSd7Qz4OcI" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2012/Apr-19.html</feedburner:origLink></item><item><title>Call for Comments: Strongly Typed Notifications</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/MSNOspaEPuU/Apr-12.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 12 Apr 2012 19:06:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2012/Apr-12.html</guid><description>&lt;p&gt;I am adding support for strongly typed notifications to
	MonoTouch and MonoMac.   The idea behind this is to take
	guesswork, trips to the documentation and trial and error from
	using notifications on iOS and MacOS.

	&lt;p&gt;The process is usually: (a) find the right notification;
	(b) look up apple docs to see when the notification is posted;
	(c) look up each of the keys used to retrieve the data from
	the dictionary.   
	
	&lt;p&gt;Currently, listening to a notification for a
	keyboard-will-be-shown notification looks like this in
	MonoTouch:

&lt;pre&gt;
void DoSomething (
	UIViewAnimationCurve curve,
	double               duration,
	RectangleF           frame)
{
	// do something with the above
}

var center = NSNotificationCenter.DefaultCenter;
center.AddObserver (UIKeyboard.WillShowNotification, PlaceKeyboard);

[...]

void PlaceKeyboard (NSNotification notification)
{
    // Get the dictionary with the interesting values:
    var dict = notification.UserInfo;

    // Extract the individual values
    var animationCurve = (UIViewAnimationCurve)
	(dict [UIKeyboard.AnimationCurveUserInfoKey] as NSNumber).Int32Value;
    double duration =
	(dict [UIKeyboard.AnimationDurationUserInfoKey] as NSNumber).DoubleValue;
    RectangleF endFrame =
	(dict [UIKeyboard.FrameEndUserInfoKey] as NSValue).RectangleFValue;

    DoSomething (animationCurve, duration, endFrame)
}
&lt;/pre&gt;

	&lt;p&gt;Currently we map the Objective-C constant 
	"FooClassNameNotification" into the C# class "Foo" as the member
	"NameNotification" of type NSString.

	&lt;p&gt;What we want to do is to expose the notifications as
	strongly typed C# events.   This will provide auto-complete
	support in the IDE to produce the lambdas or helper methods,
	auto-complete for all the possible properties of the
	notification, strong types for the data provided and
	live documentation for the values in the notification.

	&lt;p&gt;This means that the above code would instead be written
	like this:

&lt;pre&gt;
var center = NSNotificationCenter.DefaultCenter;
center.Keyboard.WillShowNotification += PlaceKeyboard;

void PlaceKeyboard (object sender, KeyboardShownEventArgs args)
{
    DoSomething (args.AnimationCurve, args.Duration, args.EndFrame);
}
&lt;/pre&gt;
	&lt;p&gt;The question is where should these notifications be exposed
	in the API?   In the example above we do this by the event
	"WillShowNotification" on a class "Keyboard" inside the
	"NSNotificationCenter".   We have a few options for this.

	&lt;p&gt;We could host the notification in the class that defines
	the notification, but we would have to come up with a naming
	scheme to avoid the name clash with the existing NSString constant:

&lt;pre&gt;
class UIKeyboard {
    public NSString WillShowNotification { get; }

    // replace "Notification" with the class name:
    public event EventHandler&lt;KeyboardShowEventArgs&gt; WillShowKeyboard;

    // prefix the event:
    public event EventHandler&lt;KeyboardShowEventArgs&gt; KeyboardWillShow;

    // plain, does not work on all types though:
    public event EventHandler&lt;KeyboardShowEventArgs&gt; WillShow;
}

// Consumer code would be one of:

UIKeyboard.WillShowKeyboard += handler;
UIKeyboard.KeyboardWillShow += handler;
UIKeyboard.WillShow += handler;
&lt;/pre&gt;

	&lt;p&gt;Another option is to add everything into
	NSNotificationCenter:

&lt;pre&gt;
class NSNotificationCenter {
	// Existing implementation

    public event EventHandler&lt;KeyboardShowEventArgs&gt; UIKeyboardWillShow;

    // Another 141 events are inserted here.
}

// Consumer code would be:

NSNotificationCenter.DefaultCenter.UIKeyboardWillShow += handler;
&lt;/pre&gt;

	&lt;p&gt;Another option is to partition the notifications based on
	their natural host, this is my personal favorite, but could be
	harder to find with the IDE using code completion:

&lt;pre&gt;
class NSNotificationCenter {
    public static class Keyboard {
        public static event EventHandler&lt;KeyboardShowEventArgs&gt; WillShow;
    }
}

// Consumer code would be:
NSNotificationCenter.Keyboard.WillShow += handler;
&lt;/pre&gt;

	&lt;p&gt;All of these proposals have one potential problem: they
	would all assume that all of these interesting notifications
	are always posted into the NSNotificationCenter.DefaultCenter.

	&lt;p&gt;Apple's documentation does not seem to suggest that any of the
	iOS notifications are posted anywhere but the DefaultCenter.
	I could not find on GitHub any code that would use anything
	but the DefaultCenter.

	&lt;p&gt;On MacOS the InstantMessage framework posts notifications
	to its own notification center.   We could just bind those
	events to this specific NSNotificationCenter.   

	&lt;p&gt;Thoughts?&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/MSNOspaEPuU" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2012/Apr-12.html</feedburner:origLink></item><item><title>MonoMac Updates</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/Ab_AKOOLeTM/Mar-06.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Tue, 06 Mar 2012 18:34:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2012/Mar-06.html</guid><description>&lt;p&gt;We have been hard at work at improving the MonoMac API to
	allow .NET developers to create native Mac applications using
	C#, F#, IronPython or their favorite .NET language.

	&lt;p&gt;There are couple of goodies coming on our next release of
	MonoMac: our Lion support is shapping up and we have been
	dogfooding this ourselves with our own apps.

	&lt;p&gt;One of our sample apps, a simple front-end to the Mono
	Documentation backend is now complete enough that we are going
	to deprecate the Gtk+ version of it and replace it with the
	native version of it.

	&lt;p&gt;MacDoc now has several new features

	&lt;p&gt;&lt;b&gt;Apple documentation integration:&lt;/b&gt; MacDoc will now
	download the Apple docs if they are not available and
	blend its contents with our documentation and replace the
	Objective-C samples with C# samples.   Amazing!

	&lt;p&gt;&lt;b&gt;Full text indexing:&lt;/b&gt; the documentation browser is
	using Lucene to index all of the contents and allow you to
	quickly find the materials that you are looking for.

	
	&lt;center&gt;
	&lt;img src="http://tirania.org/s/69c08dbc.png"&gt;
	&lt;/center&gt;
	
	&lt;p&gt;&lt;b&gt;Conceptual Index:&lt;/b&gt; in addition to the full text
	search, we generate a curated version of the APIs that are
	useful for performing search-as-you-type in the documentation
	browser.  This is useful to find APIs by class, by method name
	and also by Objective-C selector.   This means that you can
	now search for Objetive-C selectors in our documentation, and
	you will get the actual mapping to the C# method.

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/1cb8b516.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;Supports Lion documents, saved state and
	bookmarks.

	&lt;p&gt;We extended the ECMA XML format so it now renders
	images for our docs:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/94a15a6a.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;The source code is available now
	in &lt;a href="https://github.com/mono/monomac/tree/master/samples/macdoc"&gt;GitHub&lt;/a&gt;
	and will be shipping in the upcoming MonoDevelop 2.8.8 release.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/Ab_AKOOLeTM" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2012/Mar-06.html</feedburner:origLink></item><item><title>Bubbles</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/-gLP-1zRNiw/Jan-30.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Mon, 30 Jan 2012 15:22:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2012/Jan-30.html</guid><description>&lt;p&gt;Recently one of our customers asked about how to implement
	a conversation display similar to the iOS SMS/Messages
	display.   You can find
	the &lt;a href="https://github.com/xamarin/monotouch-samples/tree/master/BubbleCell"&gt;BubbleCell
	sample&lt;/a&gt; in our Github repository.

	&lt;p&gt;This is what the conversation looks like:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/c38c418a.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;To implement this, I used iOS's UITableView as it already
	provides a lot of the functionality that we need for this.
	What I did was to write a custom UITableViewCell that can
	render bubbles with their text.

	&lt;p&gt;I wrote both a MonoTouch.Dialog Element that you can host
	in your DialogViewController as well as a custom
	UITableCellView which can be reused by those using
	UITableViews directly.

	&lt;p&gt;This is how you could populate the initial discussion
	inside MonoTouch.Dialog:

	&lt;pre class="code-csharp"&gt;
Section chat;
var root = new RootElement ("Chat Sample") {
  (chat = new Section () {
    new ChatBubble (true, "This is the text on the left, what I find fascinating about this is how many lines can fit!"),
    new ChatBubble (false, "This is some text on the right"),
    new ChatBubble (true, "Wow, you are very intense!"),
    new ChatBubble (false, "oops"),
    new ChatBubble (true, "yes"),
  })
};&lt;/pre&gt;

	&lt;p&gt;And this is how you would add a new element to the
	conversation:

	&lt;pre class="code-csharp"&gt;
chat.Section.Add (
  new ChatBubble (false, "I want more cat facts"));&lt;/pre&gt;

&lt;h2&gt;Implementation&lt;/h2&gt;

	&lt;p&gt;Bubble rendering is implemented in Bubble.cs and contains
	both the UITableViewCell as well as the element.   It follows
	the pattern for creating UITableViewCells that
	I &lt;a href="http://tirania.org/monomac/archive/2011/Jan-18.html"&gt;documented before&lt;/a&gt;.

	&lt;p&gt;Each cell is made up of two views: one contains a
	UIImageView that paints the bubble and the other one contains
	the text to render inside the bubble.

	&lt;p&gt;This is what the two bubbles images look like:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/dba416d6.png"&gt;
	&lt;/center&gt;
	
	&lt;p&gt;We load these using UIImage.FromFile and then use the iOS
	5.0 &lt;a href="http://iosapi.xamarin.com/?link=M%3aMonoTouch.UIKit.UIImage.CreateResizableImage(MonoTouch.UIKit.UIEdgeInsets)"&gt;UIImage.CreateResizableImage&lt;/a&gt;
	method to create a UIImage that can be stretched on demand.
	To create the resizable image we need to tell
	CreateResizableImage the region of the image that can be
	stretched.  Anything outside of the UIEdgeInset will be kept
	as-is:

	&lt;pre class="code-csharp"&gt;
left = bleft.CreateResizableImage (new UIEdgeInsets (10, 16, 18, 26));
right = bright.CreateResizableImage (new UIEdgeInsets (11, 11, 17, 18));&lt;/pre&gt;

	&lt;p&gt;This will stretch the region highlighted in red, while
	rendering the external border as-is:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/bstretch.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;With the above code, the image will be rendered in a
	variety ways depending on the Frame that is assigned to the
	UIImageView that hosts our resizable UIImage:

	&lt;center&gt;
	&lt;img src="http://tirania.org/s/ff8a3a6c.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;The only remaining interesting bit in the code is to
	configure our UILabel properly.   We want to set its
	BackgroundColor to UIColor.Clear to avoid painting the
	background in a solid color and we also specify that the text
	should be word-wrapped if it does not fit in a single line:

	&lt;pre class="code-csharp"&gt;
label = new UILabel (rect) {
  LineBreakMode = UILineBreakMode.WordWrap,
  Lines = 0,
  Font = font,
  BackgroundColor = UIColor.Clear
};
	&lt;/pre&gt;

	&lt;p&gt;Finally in our LayoutSubViews method we must compute the
	proper sizes for the bubbles and the text that goes in them.
	I made it so the bubbles did not take the entire space in a
	row.   Instead they take 70% of the row to give a similar
	effect to the rendering of the iOS messages UI.     The code
	is pretty straight-forward:

	&lt;pre class="code-csharp"&gt;
public override void LayoutSubviews ()
{
  base.LayoutSubviews ();
  var frame = ContentView.Frame;
  var size = GetSizeForText (this, label.Text) + BubblePadding;
  imageView.Frame = new RectangleF (new PointF (isLeft ? 10 : frame.Width-size.Width-10, frame.Y), size);
  view.SetNeedsDisplay ();
  frame = imageView.Frame;
  label.Frame = new RectangleF (new PointF (frame.X + (isLeft ? 12 : 8), frame.Y + 6), size-BubblePadding);
}
	&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/-gLP-1zRNiw" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2012/Jan-30.html</feedburner:origLink></item><item><title>Styling your controls in MonoTouch on iOS 5</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/b6i76zA9FBE/Oct-14.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Fri, 14 Oct 2011 20:38:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Oct-14.html</guid><description>&lt;p&gt;Starting with iOS 5 it is possible to more easily style
	your UIViews.   Apple did this by exposing a new set of
	properties on most views that can be tuned.   For example, to
	configure the TintColor of a UISlider, you would write:

&lt;pre&gt;

var mySlider = new UISlider (rect);
mySlider.ThumbTintColor = UIColor.Red;

&lt;/pre&gt;
	

	&lt;p&gt;You can also set the color globally for all instances of
	UISlider, you do this by assigning the styling attributes on
	the special property "Appearance" from the class you want to
	style. 
	
	&lt;p&gt;The following example shows how to set the Tint color for all
	UISliders:

&lt;pre&gt;

	UISlider.Appearance.ThumbTintColor = UIColor.Red;

&lt;/pre&gt;

	&lt;p&gt;It is of course possible to set this on a per-view way, 

	&lt;p&gt;The first time that you access the "Appearance" static
	property on a stylable class a UIAppearance proxy will be
	created to host the style changes that you have requested and
	will apply to your views.

	&lt;p&gt;In Objective-C the Appearance property is untyped.   With
	MonoTouch we took a different approach, we created a strongly
	typed UIXxxxAppearance class for each class that supports
	styling.    Our generated UIXxxxxAppearance class is strongly
	typed, which allows users to use intellisense to easily
	discover which properties are avaialble for styling.

	&lt;p&gt;We also created a hierarchy that reflects the inherited
	appearance properties, this is the class hierarchy for the
	&lt;a href="http://docs.go-mono.com/index.aspx?link=T%3aMonoTouch.UIKit.UISlider%2bUISliderAppearance"&gt;UISLider.UISliderAppearance&lt;/a&gt;
	class:

&lt;center&gt;
&lt;img src="http://tirania.org/s/87cf5019.png"&gt;
&lt;/center&gt;

	&lt;p&gt;The properties exposed by UISlider for example are:

&lt;pre&gt;
public class UISliderAppearance {
	public virtual UIColor BackgroundColor {
		get;
		set;
	}
	public virtual UIColor MaximumTrackTintColor {
		get;
		set;
	}
	public virtual UIColor MinimumTrackTintColor {
		get;
		set;
	}
	public virtual UIColor ThumbTintColor {
		get;
		set;
	}
}
&lt;/pre&gt;

	&lt;p&gt;MonoTouch also introduced support for styling your controls
	only when they are hosted in a particular part of the
	hierarchy.   You do this by calling the static method
	AppearanceWhenContainedIn which takes a variable list of
	types, it works like this:

&lt;pre&gt;
var style = UISlider.AppearanceWhenContainedIn (typeof (SalesPane), typeof (ProductDetail));
style.ThumbTintColor = UIColor.Red;
&lt;/pre&gt;

	&lt;p&gt;In the above sample the style for the ThumbTintColor will
	be red, but only for the UISliders contained in ProductDetail
	view controllers when those view controllers are being hosted
	by a SalesPane view controller.  Other UISliders will not be
	affected.

	&lt;p&gt;Both the Appearance static property and the
	AppearanceWhenContainedIn static method have been surfaced on
	every UIView that supports configuring its style.    Both of
	them return strongly typed classes that derive from
	UIAppearance and expose the exact set of properties that can
	be set.

	&lt;p&gt;This is different from the weakly typed Objective-C API
	which makes it hard to discover what can be styled.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/b6i76zA9FBE" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Oct-14.html</feedburner:origLink></item><item><title>MonoTouch 5.0 is out</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/2Ga5nBIfO-w/Oct-13.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 13 Oct 2011 14:28:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Oct-13.html</guid><description>&lt;p&gt;Yesterday &lt;a href="http://blog.xamarin.com/2011/10/12/monotouch-5-with-ios-5-support/"&gt;we
	released MonoTouch 5.0&lt;/a&gt;, the companion to Apple's iOS 5.0
	release.

	&lt;p&gt;Apple tends to ship Objective-C APIs that are configured
	through an NSDictionary instance containing configuration
	keys.  With MonoTouch 5.0, we continued our work
	to &lt;a href="http://tirania.org/monomac/archive/2010/Dec-01.html"&gt;improve
	over NSDictionary-based bindings&lt;/a&gt; by creating
	strongly-typed versions of those APIs.

	&lt;p&gt;In the next couple of days, I will be sharing some of the
	new features in iOS 5.0 and how to take advantage of those
	using C#.

	&lt;p&gt;Meanwhile, our documentation team has produced an amazing
	&lt;a href="http://docs.xamarin.com/ios/tutorials/Introduction_to_iOS_5"&gt;Introduction
	to iOS 5.0 for C# developers&lt;/a&gt; and put together some samples
	showing how to use some of the new features in iOS 5:

	&lt;ul&gt;
		&lt;li&gt;&lt;a href="http://docs.xamarin.com/@api/deki/files/323/=Storyboard.zip"&gt;Storyboard&lt;/a&gt;:
		shows how to use Storyboards from C# and showcases the
		integration between Xcode 4 and MonoDevelop 2.8

		&lt;li&gt;&lt;a href="http://docs.xamarin.com/@api/deki/files/320/=CoreImage.zip"&gt;CoreImage&lt;/a&gt;:
		shows our bubilicious strongly-typed API for
		CIFilters, it is in my opinion, a huge usability
		upgrade over the NSDictionary-based approach. 
		
		&lt;li&gt;&lt;a href="http://docs.xamarin.com/@api/deki/files/321/=iCloud.zip"&gt;iCloud&lt;/a&gt;:
		Basic iCloud use.

		&lt;li&gt;&lt;a href="http://docs.xamarin.com/@api/deki/files/324/=Twitter.zip"&gt;Twitter&lt;/a&gt;:
		Post new tweets and query twitter for data.

		&lt;li&gt;&lt;a href="http://docs.xamarin.com/@api/deki/files/322/=Newsstand.zip"&gt;Newsstand&lt;/a&gt;:
		A complete sample showing how you can integrate with
		the new Newsstand APIs to publish your own
		periodicals.    We wont be submitting this sample for
		the Apple Design Awards, but it shows how to use the framework.
	&lt;/ul&gt;&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/2Ga5nBIfO-w" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Oct-13.html</feedburner:origLink></item><item><title>TestFlight support in MonoDevelop</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/m6NrPhpCy-c/Sep-29.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 29 Sep 2011 12:12:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Sep-29.html</guid><description>&lt;p&gt;We have just released for &lt;a href="http://docs.xamarin.com/ios/tutorials/TestFlight_Support"&gt;TestFlight support&lt;/a&gt; in
	MonoDevelop.

	&lt;p&gt;This makes it simpler for developers to deploy their Ad-Hoc
	builds directly to Testflight, we added a "Publish to
	TestFlight" option:

	&lt;center&gt;
	&lt;img src="http://docs.xamarin.com/@api/deki/files/271/=testflight-1.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;The first time you upload to TestFlight you must provide
	your authentication tokens:

	&lt;center&gt;
	&lt;img src="http://docs.xamarin.com/@api/deki/files/268/=testflight-4.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;And after that, the IDE takes care of the rest:

	&lt;center&gt;
	&lt;img src="http://docs.xamarin.com/@api/deki/files/266/=testflight-6.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;This is built on top of our
	enhanced &lt;a href="http://docs.xamarin.com/ios/tutorials/IPA_Support_-_Ad_Hoc_and_Enterprise_Deployment"&gt;IPA
	Packaging support&lt;/a&gt; in the same release.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/m6NrPhpCy-c" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Sep-29.html</feedburner:origLink></item><item><title>Sales Force app built with MonoTouch</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/9c9bfi4555s/Aug-12.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Fri, 12 Aug 2011 18:28:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Aug-12.html</guid><description>&lt;p&gt;I do not blog very often about apps built with MonoTouch,
	but &lt;a href="http://www.justenough.com/NetSuite/MobileSFA/"&gt;this
	application&lt;/a&gt; is drop-dead gorgeous.

	&lt;p&gt;It is a tool designed to be used by the sales force of a
	company.

	&lt;p&gt;You can download the app from the Apple AppStore and try it
	on "demo" mode.   What I love about this application is how
	they took advantage of UIKit and CoreAnimation to create a
	beautiful enterprise app.   It does not stop there, they use
	everything iOS has to offer:

	&lt;center&gt;
	&lt;img src="http://a3.mzstatic.com/us/r1000/063/Purple/f5/ed/83/mzl.gtaqidjm.480x480-75.jpg"&gt;
	&lt;p&gt;
	&lt;img src="http://a2.mzstatic.com/us/r1000/061/Purple/37/da/11/mzl.wkykqmxl.480x480-75.jpg"&gt;
	&lt;/center&gt;

	&lt;p&gt;Enterprise software has a reputation for being hostile to
	end-users.  This shows that you can create great end-user
	software for users in the enterprise.  If you were looking for
	inspiration for your own enterprise apps, this is the app to
	look for.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/9c9bfi4555s" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Aug-12.html</feedburner:origLink></item><item><title>MonoMac add-in for MonoDevelop</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/FqwLvMnhIVY/Aug-03.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Wed, 03 Aug 2011 19:40:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Aug-03.html</guid><description>&lt;p&gt;After a small hiatus we are back.

	&lt;p&gt;If you have been using MonoMac to build MacOS applications,
	we have just released an update to the MonoDevelop.MonoMac
	add-in that should fix the problem with packaging your
	applications on Lion.

	&lt;p&gt;This update just contains a critical fix and delivers the
	add-in to all three MonoDevelop platforms in use today: our
	stable MonoDevelop 2.4, the 2.6beta3 and for the fearless
	among you MonoDevelop/master.

	&lt;p&gt;This was just the first step in maintaining the add-in.   I
	had to sort out the build setup for all three branches and the
	pipeline to deliver the updates.   Now that I got things in
	place, I will be able to fix some of the other problems that
	have been reported.

	&lt;p&gt;If you are running into problems with MonoMac, please file
	your bugs at the new home for the Mono bug reports
	at &lt;a href="http://bugzilla.xamarin.com"&gt;http://bugzilla.xamarin.com&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/FqwLvMnhIVY" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Aug-03.html</feedburner:origLink></item><item><title>Glass button for iPhone</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/by0B454JZ6E/Apr-08.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Fri, 08 Apr 2011 12:19:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Apr-08.html</guid><description>&lt;p&gt;Since iOS does not provide a default glossy button
	implementation I wrote my own, based mostly on looking at a
	screenshot of Apple's own.

	&lt;p&gt;Some folks have been using
	the &lt;a href="http://conceptdev.blogspot.com/2010/08/uiglassbutton-generator-in-monotouch.html"&gt;UIGlassButton
	generator&lt;/a&gt;, but I have wanted for a while to have this
	functionality avaialble at runtime, and not depend on
	pre-generated images, these are created at runtime, and behave
	just like a regular button:

	&lt;center&gt;
	&lt;img src="http://tirania.org/pictures/mt-glass-button.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;You can
	find &lt;a href="https://github.com/migueldeicaza/MonoTouch.Dialog/blob/master/MonoTouch.Dialog/Utilities/GlassButton.cs"&gt;my
	implementation&lt;/a&gt; as part
	of &lt;a href="https://github.com/migueldeicaza/MonoTouch.Dialog/blob/master/MonoTouch.Dialog"&gt;MonoTouch.Dialog&lt;/a&gt;
	on github.

	&lt;p&gt;This is how you would use it, and how you can customize
	some of its elements:

	&lt;pre class="code-csharp"&gt;
	var b = new GlassButton (bounds) {
		Font = UIFont.BoldSystemFontOfSize (22),
		NormalColor = UIColor.Green,
		HighlightedColor = UIColor.Red
	};
	b.SetTitle ("Dismiss", UIControlState.Normal);

	container.AddSubview (b);
	&lt;/pre&gt;&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/by0B454JZ6E" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Apr-08.html</feedburner:origLink></item><item><title>MonoTouch 4.0</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/smBTUhSoAYU/Apr-06.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Wed, 06 Apr 2011 14:20:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Apr-06.html</guid><description>&lt;p&gt;&lt;img src="http://tirania.org/pictures/vintage-monotouch-logo.png"
	align="right"&gt;We just released MonoTouch 4.0, a product to build iOS
	applications using C# and .NET.  We also released our new
	&lt;a href="http://tirania.org/blog/archive/2011/Apr-06.html"&gt;Mono
	for Android&lt;/a&gt; product.

&lt;h2&gt;New in MonoTouch 4.0&lt;/h2&gt;

	&lt;p&gt;MonoTouch 4.0 is a major upgrade to our product as it
	upgrades the Mono runtime engine from the old, trusted and
	friendly Mono 2.6 to the latest and greatest &lt;a href="http://www.mono-project.com/Release_Notes_Mono_2.10"&gt;Mono
	2.10&lt;/a&gt; core, these are some of the new features available as
	part of this upgrade:

	&lt;ul&gt;
		&lt;li&gt;Parallel Frameworks for C#: Great APIs for
		building multi-threaded software.  Not only this is
		great for iPad 2 users and developers, but it also
		simplifies just plain multi-threaded programming by
		exposing Futures, Tasks and Parallel LINQ to the
		developer.

		&lt;li&gt;LLVM Compiler Support: In addition to the fast
		Mono compilation engine, MonoTouch can now also use
		LLVM to create optimized builds.   When you build
		MonoTouch applications using LLVM your executables
		will run faster, they will be smaller, and you can
		optionally opt into generating the nimbler ARMv7 or
		Thumb code (fat binaries are also supported).

		&lt;p&gt;&lt;b&gt;Example:&lt;/b&gt; My
		own &lt;a href="http://tirania.org/tweetstation/"&gt;TweetStation
		distribution&lt;/a&gt; went from 8 megs to 6 megs using
		Thumb + ARMv7 support.  A very significant gain.

		&lt;li&gt;C# 4.0 and .NET 4.0: This release comes with the
		latest incarnation of the C# language as well as
		exposing the new .NET 4.0 APIs (many new functional
		constructs make for nicer looking code, like all the
		IEnumerable&lt;Foo&gt; enabled-methods in System.IO).

		&lt;p&gt;There is one important limitation: C# 4.0 dynamic
		support is not functional, since it requires dynamic
		code generation to work.

		&lt;li&gt;Upgraded WCF stack:   We still consider this a
		preview of the full WCF but has been expanded
		significantly.   

		&lt;li&gt;All new iOS 4.3 APIs have been exposed.

		&lt;li&gt;NSDecimal, NSDecimalNumber are now exposed (mostly
		for the sake of CorePlot :-)

		&lt;li&gt;Many new convenience APIs have been introduced.
	&lt;/ul&gt;

	&lt;p&gt;For a full detailed list of changes,
	see &lt;a href="http://monotouch.net/Releases/MonoTouch_4/MonoTouch_4.0.0"&gt;our
	MonoTouch 4.0 Release Notes&lt;/a&gt;.
	
&lt;h2&gt;Resources&lt;/h2&gt;

	&lt;p&gt;The best source of information on parallel programming with
	Parallel FX is the
	free &lt;a href="http://www.microsoft.com/downloads/en/details.aspx?FamilyID=86b3d32b-ad26-4bb8-a3ae-c1637026c3ee&amp;displaylang=en"&gt;Patterns
	for Parallel Programming: Understanding and Applying Parallel
	Patterns with the .NET Framework 4&lt;/a&gt;.

	&lt;p&gt;This is a brilliant document.   Whether you use .NET or
	not, this is a recommended reading for everyone.

	&lt;p&gt;In addition to
	the &lt;a href="http://www.amazon.com/dp/047063782X/ref=as_li_ss_til?tag=tiraniaorg-20&amp;camp=213381&amp;creative=390973&amp;linkCode=as4&amp;creativeASIN=047063782X&amp;adid=12Z07C36B4TXR7Y4QRM4&amp;"&gt;Programming
	iPhone with MonoTouch book&lt;/a&gt; there are two new books about
	to hit the
	shelves &lt;a href="http://www.amazon.com/gp/product/1430231742/ref=as_li_ss_tl?ie=UTF8&amp;tag=tiraniaorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=1430231742"&gt;Developing
	C# Apps for iPhone and iPad using MonoTouch: iOS Apps
	Development for .NET Developers&lt;/a&gt;: an incredibly in-depth
	book from Brian Costanich that I have had the privilege to
	read in advance.  This book will come out in only 3 weeks.

	&lt;p&gt;If you are more of a hands-on kind of guy, later in the
	year, Mike
	Bluestein's &lt;a href="http://www.amazon.com/gp/product/0321719921/ref=as_li_ss_tl?ie=UTF8&amp;tag=tiraniaorg-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0321719921"&gt;Learning
	MonoTouch: A Hands-On Guide to Building iPhone and iPad
	Applications with C# and .NET&lt;/a&gt; is coming out.

&lt;h2&gt;Next Steps&lt;/h2&gt;

	&lt;p&gt;We are currently hard at work to add support to MonoDevelop
	to work with the new XCode 4.

	&lt;p&gt;With XCode 4, Apple removed Interface Builder as a
	standalone tool.   We should have a beta in a couple of weeks
	of the solution we came up with.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/smBTUhSoAYU" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Apr-06.html</feedburner:origLink></item><item><title>MonoMac 1.0 is out</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/2VO-jWfbh10/Mar-17.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 17 Mar 2011 17:16:00 PDT</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Mar-17.html</guid><description>&lt;p&gt;&lt;a href="http://tirania.org/blog/archive/2010/Apr-19.html"&gt;Almost
	a year ago&lt;/a&gt; we started building a set of Mono bindings for
	building native MacOS X applications.

	&lt;p&gt;Our original goals were modest: bind enough of AppKit that
	you could build native desktop applications for OSX using C#
	or your favorite .NET language.  We leveraged a lot of the
	code that we built for MonoTouch our binding to the CocoaTouch
	APIs.

	&lt;p&gt;During the year, the project picked up steam, we got plenty
	of contributions to MonoMac and grew beyond the original
	conservative goals.

	&lt;p&gt;In a year we:

	&lt;ul&gt;
		&lt;li&gt;Created a beautiful library
		that &lt;a href="http://www.mono-project.com/MonoMac#Background"&gt;blends
		the worlds of C# and MacOS X&lt;/a&gt; APIs.

		&lt;li&gt;&lt;a href="http://mjhutchinson.com/journal/2010/06/09/monomac_in_monodevelop"&gt;Created
		a MonoDevelop add-in&lt;/a&gt; that helps developers get
		started with Mac development in minutes.

		&lt;li&gt;Integrated the MonoDoc system into MonoDevelop, to
		provide developers with documentation on the flight as
		they type their code.  Detailed method information,
		parameter use and type information is available as you
		type your code in unobtrusive windows. 

		&lt;li&gt;&lt;a href="http://www.mono-project.com/MonoMacPackager"&gt;Created
		a packager&lt;/a&gt; that turns your programs into
		self-contained OSX Packages with no external
		dependencies on Mono and can be deployed to the Apple
		App Store.

		&lt;li&gt;Created a linker that lets you strip out any
		functionality your application might not need to
		reduce your executable size.
		
		&lt;li&gt;Created
		a &lt;a href="http://lists.ximian.com/pipermail/mono-osx/"&gt;great
		community of developers&lt;/a&gt; that love C#, .NET and
		MacOS.  For some of us, this is a step closer to
		heaven.

		&lt;li&gt;Created
		a &lt;a href="https://github.com/mono/monomac/tree/master/samples"&gt;big
		pool of samples&lt;/a&gt; for developers to learn from, and
		for us to exercise the API and ensure that the
		resulting library was a delight to use.

		&lt;li&gt;Created
		various &lt;a href="http://www.mono-project.com/MonoMac#Tutorials"&gt;tutorials&lt;/a&gt;
		on how to build applications with C# on the Mac.

		&lt;li&gt;Built
		an &lt;a href="http://mono.ximian.com/monomac-docs/"&gt;online
		documentation mash-up&lt;/a&gt; between our API and Apple's
		web documentation
	&lt;/ul&gt;
	
	&lt;p&gt;Some statistics about the MonoMac binding:

	&lt;ul&gt;
		&lt;li&gt;1,155 C# classes and 31 C# structures

		&lt;li&gt;376 enumerations

		&lt;li&gt;123 C# delegate data types

		&lt;li&gt;16,556 methods, properties and events exposed
	&lt;/ul&gt;

	&lt;p&gt;In addition to that,
	MonoMac &lt;a href="http://mono.ximian.com/monomac-docs/MonoMac.OpenGL"&gt;bundles
	a modified version&lt;/a&gt; of the
	amazing &lt;a href="http://www.opentk.com/"&gt;OpenTK 1.0&lt;/a&gt;.  We
	took the liberty (and by "we" I mean, the amazing Kenneth
	Pouncey) of fine-tuning the implementation for MonoMac use.
	
&lt;h2&gt;Getting MonoMac 1.0&lt;/h2&gt;

	&lt;p&gt;If you already have MonoDevelop installed, just update your
	MonoMac Add-In.   If you do not have MonoDevelop installed,
	follow
	our &lt;a href="http://www.mono-project.com/MonoMac#Obtaining_MonoMac"&gt;friendly
	instructions&lt;/a&gt;. 

&lt;h2&gt;Contributors&lt;/h2&gt;

	&lt;p&gt;MonoMac would not have been possible without the help of
	our great contributors, this is the team:

	&lt;p&gt;Main bindings:
	&lt;ul&gt;
		&lt;li&gt;Geoff Norton
		&lt;li&gt;Miguel de Icaza
		&lt;li&gt;Jonathan Pryor
		&lt;li&gt;Michael Hutchinson
	&lt;/ul&gt;

	&lt;p&gt;Contributors:
	&lt;ul&gt;
		&lt;li&gt;Alexander Shulgin (WebKit DOM)
		&lt;li&gt;James Clancey (AppKit contributions)
		&lt;li&gt;Kenneth Pouncey (API, samples)
		&lt;li&gt;Maxi Combina (WebKit events, sample)
		&lt;li&gt;Regan Sarwas (PdfKit, ImageKit, NSColor, NSGradient, NSBezierPath, samples)	
		&lt;li&gt;Ashok Gelal (CoreWlan)
	&lt;/ul&gt;

&lt;h2&gt;Next Steps&lt;/h2&gt;

	&lt;p&gt;What is great about doing a 1.0 release is that you know
	that there will be a 1.1 release, and a 1.2 release and a 2.0
	release.

	&lt;p&gt;This is our way of saying "thank you for waiting" and
	giving our users a chance to start building applications,
	knowing that we have battle tested MonoMac and it is being
	used in our own products now &lt;a href="#note"&gt;[1]&lt;/a&gt;.

	&lt;p&gt;We obviously will continue improving the API, adding more
	frameworks as time goes by, but we will also be working with
	other communities to expand MonoDevelop's language support,
	create more templates for languages like F#, IronRuby,
	IronPython and UnityScript.

	&lt;p&gt;Although we have a great start for documentation, we hope
	that contributors will take advantage of a new web-based wiki
	and collaboration tool that we are building to improve the
	docs and help us make MonoMac's documentation the best.

	&lt;p&gt;Hopefully, we will also get more samples contributed to
	MonoMac and we will see a new wave of tutorials and we will
	see fascinating discussions on how to build better software
	while enjoying every second of it. 

	&lt;p&gt;&lt;a name="note"&gt;[1]&lt;/a&gt; (MonoDevelop 2.6 will be using
	MonoMac for its native dialog boxes).&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/2VO-jWfbh10" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Mar-17.html</feedburner:origLink></item><item><title>MonoMac hotfix</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/MnCkJNI9KaU/Feb-06.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Sun, 06 Feb 2011 13:38:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Feb-06.html</guid><description>&lt;p&gt;&lt;a href="https://github.com/hbons"&gt;Hylke Bons&lt;/a&gt; warned us
	of a limitation in our MonoMac packager so we are issuing a
	new MonoMac refresh that fixes various bugs:

	&lt;ul&gt;
	&lt;li&gt;Supports using Mono.Posix.dll in packaged bundles.
	&lt;li&gt;Supports using System.Drawing in packaged bundles.
	&lt;li&gt;Fixes various BCL P/Invokes problems (we forgot to ship
	the config file :-)
	&lt;li&gt;No longer requires Mono 2.8.1, works with any mono 2.8+
	&lt;/ul&gt;

	&lt;p&gt;Follow
	the &lt;a href="http://mono-project.com/MonoMac"&gt;standard
	instructions&lt;/a&gt; to update your MonoMac add-in.

	&lt;p&gt;Hylke then got
	his &lt;a href="https://github.com/hbons/SparkleShare/tree/master/SparkleShare/Mac/SparkleShare"&gt;native
	Mac client&lt;/a&gt;
	for &lt;a href="http://twitter.com/sparkleshare"&gt;SparkleShare&lt;/a&gt;
	(a DropBox-like system, but backed up by Git or any Git
	hosting sit) working as a bundle on OSX.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/MnCkJNI9KaU" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Feb-06.html</feedburner:origLink></item><item><title>MonoMac Refresh!</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/j_MO5GBKw90/Feb-02.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Wed, 02 Feb 2011 20:55:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Feb-02.html</guid><description>&lt;P&gt;We just pushed a new refresh
	of &lt;a href="http://www.mono-project.com/MonoMac"&gt;MonoMac&lt;/a&gt;.
	This release contains:

	&lt;ul&gt;
		&lt;li&gt;New complete bindings: QuartzComposer, CoreWlan,
		PdfKit, ImageKit and Addresbook.
		
		&lt;li&gt;AppKit: new classes: NSBezierPath, NSGradient;
		convenience methods for NSColor, NSTableView,
		NSMenuItem, and NSPasteboard.

		&lt;li&gt;CoreImage's CIVector and support in AppKit for
		CoreImage.

		&lt;li&gt;WebKit indexers and support for reporting user
		decisions. 
	&lt;/ul&gt;

	&lt;p&gt;In our shared core with MOnoTouch, these are the changes:
	
	&lt;ul&gt;
		&lt;li&gt;CoreGraphics: Support for transparency layers.

		&lt;li&gt;Foundation: API helpers to make NSIndexSet
		more pleasant to use; new methods to control the
		NSRunLoop; NSUrlProtocol and NSUrlProtocolClient
		classes. 

		&lt;li&gt;ObjCRuntime: Exposed the shared library loading
		code and convenience methods to pull constants from
		shared libraries.

		&lt;li&gt;KeyChain: expose new methods for common operations
		(managing internet passwords)

		&lt;li&gt;CoreAnimation: bound a few missing constants.

		&lt;li&gt;OpenGL: new CAOpenGLLayer type.

	&lt;/ul&gt;

	&lt;p&gt;Many new samples are now included with MonoTouch.  Kenneth
	has contributed various ported samples from the CoreAnimation
	book exercising the API, fixing it, and providing many samples
	for developers to get started.    We now ship 32 samples
	covering a wide range of Mac APIs.

	&lt;p&gt;Contributors to this release include: Geoff Norton,
	Alexander Shulgin, James Clancey, Maxi Combina, Regan Sarwas,
	Michael Hutchinson, Ashok Gelal and Miguel de Icaza.

	&lt;p&gt;Additionally, the first MonoMac app has hit the Mac
	AppStore!

	&lt;p&gt;Some small stats: MonoMac 0.4 was installed by 263
	developers, MonoMac 0.5 by 369 developers, and MonoMac 0.6
	(our last release) by 588.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/j_MO5GBKw90" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Feb-02.html</feedburner:origLink></item><item><title>First MonoMac App Hits the Apple AppStore</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/aZ5iFdadVoI/Jan-31.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Mon, 31 Jan 2011 19:05:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Jan-31.html</guid><description>&lt;p&gt;&lt;a href="http://site.yvansoftware.be/"&gt;Yvan Janssens&lt;/a&gt;
	(&lt;a href="http://twitter.com/yvanjanssens"&gt;@yvanjanssens&lt;/a&gt;)
	just wrote to let me know that
	&lt;a href="http://itunes.apple.com/us/app/iproxify-plus/id409373452?mt=12"&gt;iProxify
	Plush&lt;/a&gt;,
	his &lt;a href="http://www.mono-project.com/MonoMac"&gt;MonoMac-powered&lt;/a&gt;
	application, has been accepted for distribution on Apple's Mac
	AppStore.

	&lt;p&gt;This is an important development in the history of MonoMac,
	as someone has actually published a full executable based on
	the tools that we built (we have not tested this ourselves as
	we did not really have anything to publish).

	&lt;p&gt;It also means that we got all the details right to let
	people use C# to publish to the Mac AppStore: we do not take
	external dependencies, we bundle all of the Mono dependencies
	with the app and we follow all the relevant Apple rules for
	distribution. 

	&lt;p&gt;Congratulations to Yvan for his published app!&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/aZ5iFdadVoI" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Jan-31.html</feedburner:origLink></item><item><title>Patterns for Creating UITableViewCells</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/_Al2Un6wVuk/Jan-18.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Tue, 18 Jan 2011 16:32:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Jan-18.html</guid><description>&lt;p&gt;At one point or another, every UITableView programmer will
	outgrow the
	&lt;a href="http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/TableView_iPhone/TableViewCells/TableViewCells.html#//apple_ref/doc/uid/TP40007451-CH7"&gt;default
	set of UITableViewCells styles&lt;/a&gt; available to them, and they
	will be forced to customize the cells to provide a better user
	experience.

	&lt;p&gt;The initial temptation of every lazy programmer like myself
	is to do the bare minimum amount of work to obtain the desired
	effect.   This path typically starts by realizing that you can
	add a subview to your cell, like this:

	&lt;pre class="code-csharp"&gt;
static UIImage logo = UIImage.FromFile ("logo.png");
UITableViewCell CreateCell ()
{
	var cell = new UITableViewCell (UITableViewCellStyle.Default, "key");
	var imageView = new UIImageView (logo) {
		Frame = new RectangleF (10, 10, 20, 20);
	};
	cell.ContentView.Add (imageView);
	return cell;
}
	&lt;/pre&gt;

	&lt;p&gt;Although the above code works, and you can get away with it
	for simple tasks, it does not take into consideration cell
	reuse.  UITableViews like to recycle cells on the screen which
	is fine as long as you do not need to use a different image on
	each cell, as all of a sudden, you will need to keep track of
	the imageView value.

	&lt;p&gt;In other cases, your GetCell method will get bloated with a
	lot of inside information about all possible customizations
	that you might have done in a previous instance, and you will
	have to undo those.   Apple's UICatalog sample is packed with
	code like that, and so
	is &lt;a href="https://github.com/migueldeicaza/monotouch-samples/blob/master/monocatalog/textfield.cs#L62"&gt;my
	port&lt;/a&gt; of the same code.

	&lt;p&gt;And that is just not a decent way of living.

	&lt;p&gt;You are miserable, your users are miserable and everyone
	around you is miserable.

	&lt;p&gt;My preferred pattern, which has worked better for me is to
	create a derived cell class that tracks all of my properties,
	and centralizes the management of updating the properties of
	my cell.

	&lt;p&gt;Assuming that my cell will render the contents of an object
	called "MyData", this is what my pattern looks like for
	custom UITableViewCells:

&lt;pre class="code-csharp"&gt;
//
// I create a view that renders my data, as this allows me to reuse
// the data rendering outside of a UITableViewCell context as well
//
public class MyDataView : UIView {
	MyData myData;

	public MyDataView (MyData myData)
	{
		Update (myData);
	}

	// Public method, that allows the code to externally update
	// what we are rendering.   
	public void Update (MyData myData)
	{
		this.myData = myData;
		SetNeedsDisplay ();
	}
}

//
// This is the actual UITableViewCell class
//
public class MyDataCell : UITableViewCell {
	MyDataView myDataView;

	public MyDataCell (MyData myData, NSString identKey) : base (UITableViewCellStyle.Default, identKey)
	{
		// Configure your cell here: selection style, colors, properties
		myDataView = new MyDataView (myData);
		ContentView.Add (myDataView);
	}

	public override void LayoutSubviews ()
	{
		base.LayoutSubviews ();
		myDataView.Frame = ContentView.Bounds;
		myDataView.SetNeedsDisplay ();
	}

	// Called by our client code when we get new data.
	public void UpdateCell (MyData newData)
	{
		myDataView.Update (newData);
	}
}
&lt;/pre&gt;

	&lt;p&gt;With the above pattern implemented, I can now add all of my
	view specific gadgetry into the MyDataView class, images,
	helper labels, or other views.

	&lt;p&gt;Then, the Update method needs to make sure that all of
	those extra views are updated when this method is invoked.
	All of the configuration for your cell needs to take place in
	this method, and nowhere else.

	&lt;p&gt;The client code that uses these views then looks like this:

&lt;pre class="code-csharp"&gt;
class MyTableViewDataSource : UITableViewDataSource {
	public override UITableViewCell GetCell (UITableView tableView, NSIndexPath indexPath)
	{
		MyData myData = Lookup (indexPath);

		var cell = tableView.DequeueReusableCell (key);
		if (cell == null)
			cell = new MyDataCell (myData);
		else 
			cell.UpdateCell (myData);
		return cell;
	}
&lt;/pre&gt;	

&lt;h3&gt;The Extra UIView&lt;/h3&gt;

	&lt;p&gt;You might be thinking that creating the extra UIView is not
	really worth the effort, as you likely only need to apply a
	few customizations, and you got already most of your bang for
	the buck by creating your custom UITableViewCell.

	&lt;p&gt;You would be right.

	&lt;p&gt;The reason for creating a custom UIView, is that there
	might come a time when you want to do some custom drawing in
	your cell.  Perhaps add a nice gradient on the background, or
	perhaps draw some shadows, or mix large fonts with small
	fonts.

	&lt;p&gt;It might be just a couple of small touch-ups, nothing too
	complicated, but just a little extra polish.   By using a
	custom UIView, you can now spice up your view just a tiny bit,
	by overriding the Draw method:

&lt;pre class="code-csharp"&gt;
public override void Draw (RectangleF rect)
{
	var context = UIGraphics.GetCurrentContext ();
	UIColor.White.SetColor ();
	context.FillRect (Bounds);
	context.DrawLinearGradient (myGradient, start, end, 0);
}
&lt;/pre&gt;

&lt;h3&gt;Creating a MonoTouch.Dialog Element&lt;/h3&gt;


	&lt;p&gt;If you are like me, lazy, you would likely not be writing a
	lot of GetCell methods and large dispatch tables for your
	UITableViews, and instead you are
	using &lt;a href="https://github.com/migueldeicaza/MonoTouch.Dialog"&gt;MonoTouch.Dialog&lt;/a&gt;.

	&lt;p&gt;MonoTouch.Dialog is an API that takes away the
	administrivia out of building UITableViews and lets you focus
	on the content.
	I &lt;a href="http://tirania.org/blog/archive/2010/Feb-23.html"&gt;discussed
	MonoTouch.Dialog last year&lt;/a&gt; on my old blog.

	&lt;p&gt;Once you have your own UITableViewCell, it is trivial to
	turn that into a MonoTouch.Dialog Element.  You would do it
	like this:

&lt;pre class="code-csharp"&gt;
public class MyDataElement : Element {
	static NSString key = new NSString ("myDataElement");
	public MyData MyData;

	public MyDataElement (MyData myData) : base (null)
	{
		MyData = myData;
	}

	public override UITableViewCell GetCell (UITableView tv)
	{
		var cell = tv.DequeueReusableCell (key) as MyDataCell;
		if (cell == null)
			cell = new MyDataCell (MyData, key);
		else
			cell.UpdateCell (MyData);
		return cell;
	}
}
&lt;/pre&gt;

	&lt;p&gt;With the code above, you have everything you need to make
	your custom cell to be used with MonoTouch.Dialog.

	&lt;p&gt;You can see the entire pattern in action
	in &lt;a href="https://github.com/migueldeicaza/TweetStation/blob/master/TweetStation/UI/TweetCell.cs"&gt;TweetStation's
	source code&lt;/a&gt;.   The 300 or so lines of code in that file
	are responsible for rendering a tweet in TweetStation.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/_Al2Un6wVuk" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Jan-18.html</feedburner:origLink></item><item><title>Mono Packager and the Apple AppStore</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/hB-Lm-nOcSI/Jan-10.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Mon, 10 Jan 2011 14:23:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Jan-10.html</guid><description>&lt;p&gt;We are happy to announce
	the &lt;a href="http://www.mono-project.com/MonoMacPackager"&gt;Mono
	Packager for OSX&lt;/a&gt;.   

	&lt;center&gt;
	&lt;img src="http://mono-project.com/files/2/2a/Md-monomac-bundle.png"&gt;
	&lt;br&gt;
	MonoDevelop UI for Mac Packages and Installers.
	&lt;/center&gt;

	&lt;p&gt;The Mono Packager for OSX makes it possible to create
	self-contained Mono applications that will run on OSX without
	requiring the Mono.framework to be previously installed on the
	system.  In combination with
	the &lt;a href="http://www.mono-project.com/MonoMac"&gt;MonoMac
	project&lt;/a&gt; you can build fully native MacOS X applications
	using your favorite .NET technologies.   From your choice of
	Mono/.NET languages, to your choice of Mono/.NET library. 

	&lt;p&gt;The packager can create both signed applications for
	distribution on the Mac AppStore, as well as creating
	installers for your software.

&lt;h3&gt;Mono on the Mac: Some Background&lt;/h3&gt;

	&lt;p&gt;Mono on OSX has historically been distributed as an image
	that installed itself in /Library/Frameworks/Mono.framework.
	Once Mono was installed, users could write code in 
	C# or their favorite .NET/Mono language and run the resulting
	executable.

	&lt;p&gt;The problem is that Mono.framework contains an entire
	development stack: compilers, GUI tools, command line tools,
	libraries, documentation which is convenient for developers,
	but most of the time, not very useful for end-users.

	&lt;p&gt;This meant that developers would typically ask users to
	first install the Mono.framework (a big download) and then
	they could install their applications.    

	&lt;p&gt;To work around that problem, some developers have chosen to
	manually embed Mono in their applications.  This has always
	been possible, but it was error-prone as developers would have
	to manually assemble Mono into their application bundle,
	configure Mono properly, and initialize the Mono runtime
	themselves.   Doable, but not pleasant. 

	&lt;p&gt;With today's release, we have taken the burden of creating
	self-contained Mono applications out of developer's hands and
	added it as a standard feature for developers to use.

&lt;h3&gt;The Mac AppStore&lt;/h3&gt;

	&lt;p&gt;The Mac AppStore requires that applications submitted to it
	are completely self-contained and they do not depend on
	third-party frameworks to be installed on the system.   It
	also requires that your application and installer be signed.

	&lt;p&gt;Both of those features are supported in our MonoMac
	Packager.   Developers can now create Mac AppStore ready
	applications using MonoDevelop and MonoMac.   We have
	integrated the package creation, installer creation, and
	signing processes into our MonoDevelop IDE.

	&lt;p&gt;All that developers have to do is sign up for Apple's
	Mac developer program, get their distribution certificates,
	build a fabulous application and upload the application using
	the Application Loader to Apple.com.

&lt;h3&gt;Upcoming: Linking&lt;/h3&gt;

	&lt;p&gt;In this version of the Mac bundler, we include all of the
	dependencies that your program takes.   For example, if you use
	the System.Xml library, the entire System.Xml library will be
	bundled with the application.

	&lt;p&gt;In our next release, we will add support
	for &lt;a href="http://www.mono-project.com/Linker"&gt;Mono's
	linker&lt;/a&gt;, the same technology we used
	in &lt;a href="http://monotouch.net"&gt;MonoTouch&lt;/a&gt; to reduce the
	executable size.

	&lt;p&gt;When you choose to use use the linker, the granularity of
	distribute changes from the library-level to the type level.
	For example, if you only use one type from System.Xml, the
	linker will strip out all of the unused classes and generate a
	new System.Xml library that only contains the one type that
	you used.

	&lt;p&gt;We did not want to wait for the linker to be ready before
	shipping our packager, but we should have it ready soon.
	
&lt;h3&gt;MonoMac Refresh&lt;/h3&gt;

	&lt;p&gt;As part of this release we have also issued a refresh to
	the MonoMac library and templates.

	&lt;p&gt;From now on, MonoMac binaries will default to be 4.0
	profile, allowing users to leverage all of the new features in
	the C# 4.0 language (like &lt;tt&gt;dynamic&lt;/tt&gt;) as well as the new
	.NET 4.0 APIs that we introduced with Mono 2.8.

	&lt;p&gt;The updates to the MonoMac API are described
	in &lt;a href="http://tirania.org/monomac/archive/2011/Jan-10-1.html"&gt;my
	other blog post&lt;/a&gt;.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/hB-Lm-nOcSI" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Jan-10.html</feedburner:origLink></item><item><title>New MonoMac Refresh!</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/AwQD9GLvoPU/Jan-10-1.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Mon, 10 Jan 2011 13:01:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Jan-10-1.html</guid><description>&lt;p&gt;As part of today's release of
	the &lt;a href="http://tirania.org/monomac/archive/2011/Jan-10.html"&gt;Mono
	Packager for OSX&lt;/a&gt; we have issued a new MonoMac refresh.

	&lt;p&gt;As we create more sample code, and start to write real
	applications with MonoMac, we have updated the API to be
	simpler, cleaner and more comprehensive.   This release is all
	about small incremental improvements to the MonoMac API.

	&lt;p&gt;As usual, we have updated the
	our &lt;a href="http://mono.ximian.com/monomac-docs/"&gt;MonoMac API documentation
	MonoMac API documentation&lt;/a&gt;.   If you are thinking about
	getting started with MonoMac, we strongly recommend you read
	our &lt;a href="http://www.mono-project.com/MonoMac"&gt;MonoMac&lt;/a&gt;
	page for some useful links and tutorials.

&lt;h3&gt;Statistics&lt;/h3&gt;

	&lt;p&gt;MonoMac 0.4 was installed by 263 developers, MonoMac 0.5 by
	369 developers.   Interesting considering that the holidays
	are a slow season:

	&lt;center&gt;
	&lt;img src="http://tirania.org/shots/1101091106IHKGeOBC.png"&gt;
	&lt;/center&gt;

&lt;h3&gt;Apps!&lt;/h3&gt;

	&lt;p&gt;&lt;a href="http://twitter.com/#!/praeclarum"&gt;Frank
	Krueger&lt;/a&gt; the creator
	of &lt;a href="http://icircuitapp.com/"&gt;iCircuit&lt;/a&gt; a real-time
	circuit emulator and editor for the iPad/iPhone has started a
	port of iCircuit to MacOS X using MonoMac:

	&lt;center&gt;
	&lt;img src="http://tirania.org/shots/1101091942LfvK58IN.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;Pretty amazing, considering that Frank only learned to use
	MonoMac yesterday (although he does have extensive MonoTouch
	experience).    &lt;b&gt;Update:&lt;/b&gt; He posted
	and &lt;a href="http://yfrog.com/h8mx8p"&gt;updated screenshot&lt;/a&gt;
	"now in technicolor".
	
&lt;h3&gt;MacDoc Sample&lt;/h3&gt;

	&lt;p&gt;During the holidays,
	I &lt;a href="https://github.com/mono/monomac/tree/master/samples/macdoc"&gt;wrote
	MacDoc&lt;/a&gt; a native front-end for the
	&lt;a href="http://www.mono-project.com/Monodoc"&gt;MonoDoc
	documentation engine&lt;/a&gt;.   I also took Jonathan Pobst's
	&lt;a href="https://github.com/jpobst/Kipunji"&gt;fabulous style
	sheets from Kipunji&lt;/a&gt; to spice up the UI a little bit.

	&lt;p&gt;This is the result:

	&lt;center&gt;
	&lt;img src="http://tirania.org/images/monomac-macdoc.png"&gt;
	&lt;/center&gt;

	&lt;p&gt;I still have to integrate the index and search features of
	MonoDoc into the UI, and I am struggling as to how to
	surface them in the UI.

	&lt;p&gt;The Index is supposed to have an alphabetical listing of
	classes, method, properties, fields, similar to the index at
	the end of a book.   I always found this to be very useful
	when developing with .NET.     The search functionality on the
	other hand uses Lucene to search in the documentation body.

	&lt;p&gt;At this point, I believe that I should add a tabbed
	widgets, and let the user pick between the tree view on the
	left and the index (with a new text-entry to do the
	incremental search).   But if the users uses the search on the
	toolbar, I should replace the tree and the index with a list
	of results.

	&lt;p&gt;Does the above make sense, or you think it is a terrible UI
	idea and completely unacceptable for OSX users?

	&lt;p&gt;I thought about merging the index and the body search, but
	it would render the index search a bit useless.   Anyways, if
	you are a Mac expert, please send feedback my way.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/AwQD9GLvoPU" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Jan-10-1.html</feedburner:origLink></item><item><title>CorePlot Bindings for MonoMac and MonoTouch</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/S2wlkCn-Lrc/Jan-01.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Sat, 01 Jan 2011 21:39:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2011/Jan-01.html</guid><description>&lt;p&gt;Happy New Year!

	&lt;p&gt;Today I wrote the MonoMac and MonoTouch bindings for the
	open source &lt;a href="http://code.google.com/p/core-plot/"&gt;CorePlot&lt;/a&gt;
	library. 

	&lt;p&gt;The bindings are available from
	the &lt;a href="https://github.com/mono/monotouch-bindings"&gt;binding
	collection module&lt;/a&gt; on GitHub and binaries for both
	MonoTouch and MonoMac are available there.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/S2wlkCn-Lrc" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2011/Jan-01.html</feedburner:origLink></item><item><title>MonoMac Happy Holidays Edition is out!</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/SWh-s_ygh1w/Dec-15.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Wed, 15 Dec 2010 21:35:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-15.html</guid><description>&lt;p&gt;Just in time for your holidays, we have baked a new version
	of &lt;a href="http://mono-project.com/MonoMac"&gt;MonoMac&lt;/a&gt;.  As
	usual, installation is very easy,
	just &lt;a href="http://www.mono-project.com/MonoMac#Obtaining_MonoMac"&gt;follow
	these steps&lt;/a&gt;.
 
	&lt;p&gt;As for some stats: 224 developers downloaded the MonoMac
	0.4 add-in for MonoDevelop in the previous release, not bad at
	all!
 
	&lt;center&gt; 
	&lt;img src="http://tirania.org/shots/1012150251iPp5lcHM.png"&gt; 
	&lt;/center&gt; 
 
	&lt;p&gt;These are the changes since MonoMac 0.4
	
	&lt;ul&gt; 
		&lt;li&gt;&lt;a href="http://mono.ximian.com/monomac-docs/"&gt;API Documentation&lt;/a&gt;!
	&lt;ul&gt; 
		&lt;li&gt;Built on JPobst's &lt;a href="https://github.com/jpobst/Kipunji"&gt;new documentation engine&lt;/a&gt;&lt;/li&gt; 
		&lt;li&gt;There are mostly automatically generated stubs now&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;New in CoreAnimation:
	&lt;ul&gt; 
		&lt;li&gt;Layout managers&lt;/li&gt; 
		&lt;li&gt;Constrained layout manager&lt;/li&gt; 
		&lt;li&gt;CATextLayer can now set its font with the WeakFont property, or the SetFont () strong types.&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;CoreGraphics:
	&lt;ul&gt; 
		&lt;li&gt;CGAffineTransform.Invert () method to obtain the inverse of an affine transformation&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;Foundation
	&lt;ul&gt; 
		&lt;li&gt;NSObject.FromObject method automatically boxes .NET types into NSValue, NSString or NSNumber objects.&lt;/li&gt; 
		&lt;li&gt;Convenience function to create NSArrays from object [] arrays and using the new NSObject boxing functionality.&lt;/li&gt; 
		&lt;li&gt;New NSIndexSet convenience factory method and ToArray method&lt;/li&gt; 
		&lt;li&gt;NSDictionary and NSMutableDictionary have convenience methods that take object [] arrays, and do the boxing automatically (using the new NSArray functionality described above)&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;AppKit:
	&lt;ul&gt; 
		&lt;li&gt;DoubleClick event on views that have support for double click actions (instead of using the DoubleAction selector + Target)&lt;/li&gt; 
		&lt;li&gt;NSTableView has a new Source property that can be used to blend both Delegate and the table view data source into one (NSTableViewSource which combines NSTableViewDataSource and NSTableViewDelegate)&lt;/li&gt; 
		&lt;li&gt;New: NSPredicate family of classes&lt;/li&gt; 
		&lt;li&gt;New: NSRuleEditor&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;AddressBook library:
	&lt;ul&gt; 
		&lt;li&gt;We used to ship the source, but now it is included in the binary library.&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
		&lt;li&gt;CoreImage:
	&lt;ul&gt; 
		&lt;li&gt;New in this release.&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
	&lt;li&gt;WebKit:
	&lt;ul&gt; 
		&lt;li&gt;Many events that were previously only exposed as Objective-C style delegates are now proper C# events.&lt;/li&gt; 
	&lt;/ul&gt; 
	&lt;/li&gt; 
	&lt;li&gt;Engine:
	&lt;ul&gt; 
		&lt;li&gt;Improved methods with return structures
		&lt;li&gt;Improved string [] marshalling
		&lt;li&gt;Now with INativeObject marshalling
	&lt;/ul&gt; 
	&lt;/li&gt; 
	&lt;/ul&gt; 
 
	&lt;p&gt;We have also updated
	the &lt;a href="https://github.com/mono/monomac/tree/master/samples"&gt;samples&lt;/a&gt; 
	and added a few more.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/SWh-s_ygh1w" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-15.html</feedburner:origLink></item><item><title>The @" syntax in Objective-C vs C#</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/ZGqFHYM4cQQ/Dec-14.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Tue, 14 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-14.html</guid><description>&lt;p&gt;A common mistake that I see in some of the code from our
	customers, or from contributed samples to the MonoMac
	repository is the use of the @"string" syntax in C# programs.
	
	&lt;b&gt;Summary:&lt;/b&gt; do not use the @"..." when porting Objective-C
	samples to C#.
	
&lt;h3&gt;String Syntax in Objective-C and C#&lt;/h3&gt;

	&lt;p&gt;Objective-C supports two kinds of string literals in your
	source code, strings that are surrounded by double-quotes and
	strings that are prefixed with the at-sign and then double
	quotes.
	
	&lt;p&gt;The first kind are zero-terminated C-style strings.  For
	example the string "foo" is encoded by the compiler as the
	following four bytes: 'f', 'o', 'o' and zero plus the address
	of the string at the location where this is referenced.
	
	&lt;p&gt;The second kind, for example @"Hello World" is a
	CoreFoundation string, and the compiler has to encode by
	creating a static instance of a CoreFoundation CFString
	object: it has a class identifier, some object flags, a
	pointer to the data ('foo' in this case) and the length of the
	string.
	
	&lt;p&gt;In both the c-string style and the CFString style, escape
	sequences are processed by the compiler.  This means that if
	you use "1\n2" or @"1\n2" this will produce in both cases a
	string consisting of the '1' character followed by a newline
	(byte value 10) and the '2' character.
	
	&lt;p&gt;In C# the syntax @"string" does not mean "encode as a
	CFString" object.  Instead it is
	a&lt;a href="http://msdn.microsoft.com/en-us/library/362314fe(v=vs.71).aspx"&gt;
	quoted-string literal&lt;/a&gt;, and it instructs the compiler to
	avoid performing escape sequence processing.  In C# the
	strings "1\n2" and @"1\n2" have respectively lengths 3 and 4.
	The former one consists of the characters '1', newline (byte
	value 10) and character '2'.  While the latter consists of the
	characters '1', '\', 'n' and '2'.
	
&lt;h3&gt;System.String vs Foundation.NSString in MonoMac/MonoTouch&lt;/h3&gt;

	&lt;p&gt;In the MonoTouch/MonoMac binding strings are almost always
	exposed in the binding with the native C# string type
	(System.String).  Any conversions between the C# string and
	the Objective-C string type are done by the runtime.
	
	&lt;p&gt;There are a handful of places where we must expose NSString
	values instead of strings.  This is usually necessary when the
	underlying Objective-C code performs reference comparisons
	instead of content comparisons for strings.  Some Objective-C
	APIs for example use these strings as special "tokens" that
	you must pass verbatim in your application to a method.
	
	&lt;p&gt;We typically use those for notification names, keys in
	dictionaries and a handful of other places.  You will notice
	in those handful of cases that Mono's API's expose an NSString
	parameter or return value instead of a string parameter or
	return value.
	
	&lt;p&gt;For example if you have a AddNotification (NSString key) API, you would typically use it like this:
	
&lt;pre class="code-csharp"&gt;
	// example class exposing a notificatin as an NSString:
	// class SomeClass {
	//        NSString WakeUpNotification { get; }
	// }
	
	AddNotification (SomeClass.WakeUpNotification);
&lt;/pre&gt;

&lt;h3&gt;Conversions&lt;/h3&gt;

	&lt;p&gt;Converting from a C# string to an NSString is easy, all you have to do is call new NSString ("mystring").
	
	&lt;p&gt;To go the other way around from an NSString to a string,
	you can either use an explicit cast (this is the recommended
	design pattern from
	the &lt;a href="http://www.amazon.com/gp/product/0321545613?ie=UTF8&amp;amp;tag=tiraniaorg-20&amp;amp;linkCode=as2&amp;amp;camp=1789&amp;amp;creative=390957&amp;amp;creativeASIN=0321545613"&gt;Framework
	Design Guidelines&lt;/a&gt;) or you can use the ToString () method
	on an NSString.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/ZGqFHYM4cQQ" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-14.html</feedburner:origLink></item><item><title>NSNumbers, NSValues, Dictionaries and Arrays</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/hHWpPRnMDHw/Dec-09.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 09 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-09.html</guid><description>&lt;p&gt;A couple of days
	ago, &lt;a href="http://jacksonh.tumblr.com/"&gt;Jackson&lt;/a&gt; pointed
	out that one of the samples in this blog could be further
	simplified if we took advantage of C#'s params arguments.  The
	sample in question was this code snippet from QTRecorder, used
	to return an NSSet:

	&lt;pre class="code-csharp"&gt;
[Export]
public static NSSet keyPathsForValuesAffectingHasRecordingDevice ()
{
    return new NSSet (new string [] {"SelectedVideoDevice", "SelectedAudioDevice"});
}
&lt;/pre&gt;

	&lt;p&gt;In the above example, we have to manually construct the
	string array, so that we can call the NSSet (string [] args)
	constructor.  Jackson correctly pointed out that the above
	could be simplified if we introduced an NSSet (params string
	[] args) constructor.  This lets the compiler do the work for
	us, so the sample above can be written like this instead:

&lt;pre class="code-csharp"&gt;
[Export]
public static NSSet keyPathsForValuesAffectingHasRecordingDevice ()
{
    return new NSSet ("SelectedVideoDevice", "SelectedAudioDevice");
}
&lt;/pre&gt;

	&lt;p&gt;This got me thinking about another possible improvement to
	the API.  In a number of places in the MonoMac/MonoTouch API
	it is necessary to pass numbers, strings, booleans, points,
	rectangles, affine transforms and 3D transforms in
	NSDictionary and NSArray objects.

	&lt;p&gt;Since Objective-C does not have language-assisted
	auto-boxing like C# does, programmers have to manually box
	those in either NSValue types or NSNumber types.  An NSNumber
	can contain booleans, 16, 32 and 64 bit integers and unsigned
	integers as well as floats and doubles.  NSValues are
	typically used to box points, rectangles, sizes and 2D and 3D
	affine transformations.

	&lt;p&gt;In a few of the current samples we have code like this:

&lt;pre class="code-csharp"&gt;
var objects = new NSObject [] {&amp;nbsp;
    new NSNumber (13),
    new NSNumber ((float) 0.5) };
var keys = new NSObject [] {
    new NSString ("speed"),
    new NSString ("volume") };
var dict = NSDictionary.FromObjectsAndKeys (objects, keys);
&lt;/pre&gt;

	&lt;p&gt;The above clearly is too verbose for no good reason.  We
	have now introduced methods that take general purpose object
	[] arrays, containing regular C# data types and will do the
	automatic boxing:

&lt;pre class="code-csharp"&gt;
var objects = new NSObject [] {&amp;nbsp;13, 0.5 };
var keys = new NSObject [] {&amp;nbsp;"speed", "volume" };
var dict = NSDictionary.FromObjectsAndKeys (objects, keys);
&lt;/pre&gt;

	&lt;p&gt;The method that does the object to NSObject conversion is a
	convenience static method in the NSObject class, with the
	following signature:

&lt;pre class="code-csharp"&gt;
public static NSObject FromObject (object obj);
&lt;/pre&gt;

	&lt;p&gt;The function can be used to convert nulls, booleans,
	numbers, strings, IntPtrs, SizeF, RectangleF, PointF on both
	MonoMac and MonoTouch and in MonoTouch it additionally
	supports CGAffineTransform, CATransform3D and UIEdgeInsets.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/hHWpPRnMDHw" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-09.html</feedburner:origLink></item><item><title>Using Key-Value Coding with MonoMac</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/X0uKiVe_czc/Dec-07.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Tue, 07 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-07.html</guid><description>&lt;p&gt;&lt;a href="http://monomac.files.wordpress.com/2010/12/db-12.png"&gt;&lt;img class="alignright
	size-full wp-image-32" title="db-1"
	src="http://monomac.files.wordpress.com/2010/12/db-12.png"
	alt="" width="192" height="381"
	/&gt;&lt;/a&gt;&lt;a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Overview.html"&gt;Key-Value
	Coding&lt;/a&gt; is a set of practices that allow applications to
	access object properties using strings.  This is similar
	to &lt;a href="http://msdn.microsoft.com/en-us/library/cc189022(VS.95).aspx"&gt;Binding
	Expressions&lt;/a&gt; in Silverlight.  In both cases the purpose is
	to allow tooling that does not directly have access to your
	native code to access properties from your program.

	&lt;p&gt;You would typically use this from a tool like Interface
	Builder, where you can use the Binding Inspector (⌘4 from
	Interface Builder) to explore the possible values of the
	component that you can data bind.  In Interface Builder you
	would use string to describe the name of the property that you
	want to access.  For example, consider the options available
	for the NSPopUpButton component show on the right.  All of
	those properties of the NSPopUpButton can be pulled directly
	from your code from Interface Builder without having to
	manually hook things up.

	&lt;p&gt;To use this with MonoMac, all you have to do is make sure
	that any property that you want to access from Interface
	Builder is flagged with the [Export] attribute.  If you apply
	the Export attribute without any parameters, it will expose
	the C# name of your property for Key-Value access.  You can
	change the name that is exposed by passing a parameter, for
	example: [Export ("myIndex")].

	&lt;p&gt;The &lt;a href="https://github.com/mono/monomac/tree/master/samples/QTRecorder"&gt;QTRecorder sample&lt;/a&gt; shows how various elements in the UI are connected to the code:

[caption id="attachment_38" align="alignnone" width="583" caption="MonoMac port of QTRecorder sample"]&lt;a href="http://monomac.files.wordpress.com/2010/12/qtrecorder2.png"&gt;&lt;img class="size-full wp-image-38" title="qtrecorder2" src="http://monomac.files.wordpress.com/2010/12/qtrecorder2.png" alt="" width="583" height="547" /&gt;&lt;/a&gt;[/caption]

	&lt;p&gt;&lt;a href="http://monomac.files.wordpress.com/2010/12/props.png"&gt;&lt;img class="alignleft
	size-medium wp-image-36" title="props"
	src="http://monomac.files.wordpress.com/2010/12/props.png?w=169"
	alt="" width="169" height="300" /&gt;&lt;/a&gt;In that sample, the
	class QTRecorder, a class derived from NSDocument exposes
	properties that are hooked up directly to the Enabled
	properties in various buttons in the UI and properties to
	populate and control the contents of the various popups in the
	application.  All of these bindings are configured by setting
	the target of the binding to be the "File's Owner", in this
	case the QTRecorder class, as it happens to load the
	QTRecorder.nib file.  You can see the complete list of
	bindings in the screenshot on the left.

	&lt;p&gt;Let us explore what happens in the application.  The Video
	Devices popup is controlled through three bindings: the
	Content, the Content Values and the Selected Object.  This is
	what the binding are configured to in Interface Builder for
	all three properties:

	&lt;p&gt;&lt;a href="http://monomac.files.wordpress.com/2010/12/binding2.png"&gt;&lt;img class="alignnone
	size-full wp-image-41" title="binding"
	src="http://monomac.files.wordpress.com/2010/12/binding2.png"
	alt="" width="640" height="105" /&gt;&lt;/a&gt;

	&lt;p&gt;The &lt;strong&gt;Content&lt;/strong&gt; is bound to the VideoDevices
	property in the source code, this is a property that merely
	returns the strongly typed QTCaptureDevice array of the
	available devices.  The &lt;strong&gt;Content Values &lt;/strong&gt;is
	bound to the VideoDevices.localizedDisplayName.  The first
	part of the key matches our VideDevices array, and the second
	part of the key happens to be the Objective-C name of a
	property exposed by the QTCaptureDevice that provides the name
	of the device to display.  The actual item selected on the
	screen is controlled by the &lt;strong&gt;Selected Object&lt;/strong&gt;
	binding.  In this case, a new property, the
	SelectedVideoDevice property.  At this point, the
	NSPopUpButton will populate its contents using these bindings.
	Additionally, when the user selects a different item, the
	property bound to the Selected Object will be invoked with the
	new value.  Our code responds by configuring the
	QTCaptureSession accordingly.

	&lt;p&gt;Another interesting binding takes place with the recording
	button.  The recording button hasits Enabled property bound to
	the HasRecordingDevice C# property and has its Value bound to
	the C# Recording property.  When we change the video source in
	the popup, the button responds by either getting grayed out or
	becoming active.  Although this could have been done
	programmatically in response to the new value set in the
	SelectedVideoDevice property, the code takes advantage of the
	built-in notification system and instead reacts to changes to
	the SelectedVideoDevice automatically.

	&lt;p&gt;This is done by using
	the &lt;a href="http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueObserving/Concepts/DependentKeys.html"&gt;dependency
	keys feature&lt;/a&gt; a feature of Key-Value Coding. It requires
	that the code exports a specially-named method which is
	prefixed with the string "keyPathsForValuesAffecting".  These
	methods are are meant to return an NSSet containing the names
	of the properties that depend on that particular property.  In
	our case this is:

&lt;pre class="code-csharp"&gt;[Export]
public static NSSet keyPathsForValuesAffectingHasRecordingDevice ()
{
    return new NSSet ("SelectedVideoDevice", "SelectedAudioDevice");
}&lt;/pre&gt;

	&lt;p&gt;Once that is done, the runtime knows that when either one
	of the SelectedVideoDevice or SelectedAudioDevice change, it
	has to query the value for HasRecordingDevice again.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/X0uKiVe_czc" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-07.html</feedburner:origLink></item><item><title>Error Reporting Pattern in MonoMac</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/hJotymnn60o/Dec-05.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Sun, 05 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-05.html</guid><description>&lt;p&gt;When writing code that reports errors to the user, usually
	when I get back an NSError result, I use the following code
	snippet to show it:
	
	&lt;pre class="code-csharp"&gt;if (err != null){
   NSAlert.WithError (err).BeginSheet (Window, delegate {
       // Any needed cleanup code can go here,
       // it is invoked when the Sheet goes away.
   });
   return;
}&lt;/pre&gt;

	&lt;p&gt;The above creates an NSAlert object using the WithError
	factory method, and then invokes the BeginSheet method to
	present this modally to the user.  Usually you can put any
	cleanup code in the body of the provided delegate.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/hJotymnn60o" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-05.html</feedburner:origLink></item><item><title>MonoMac 0.4 is out</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/3DNgtJMCiAU/Dec-03.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Fri, 03 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-03.html</guid><description>&lt;p&gt;We have just released MonoMac 0.4.  Installation is very
	easy, just &lt;a title="MonoMac web site"
	href="http://www.mono-project.com/MonoMac#Obtaining_MonoMac"&gt;follow
	the steps&lt;/a&gt; in our MonoMac site.

&lt;div class="alignright" style="width: 310px"&gt;
	&lt;a href="http://monomac.files.wordpress.com/2010/11/stillmotion.png"&gt;
	&lt;img class="size-medium wp-image-12" title="stillmotion"
	     src="http://monomac.files.wordpress.com/2010/11/stillmotion.png?w=300&amp;#038;h=172"
	     alt="Still Motion sample in C#" width="300"
	     height="172"/&gt;
	&lt;/a&gt;&lt;p class="wp-caption-text"&gt;StillMotion C# sample&lt;/p&gt;
&lt;/div&gt;

	&lt;p&gt;We are very happy with this release as this is the first
	time that MonoMac can be used to build real applications for
	OSX.  There are three major reasons for this:
	
	&lt;ul&gt;
		&lt;li&gt;Our API coverage for all core Mac APIs is in place.&lt;/li&gt;
		&lt;li&gt;We have completed many of the gaps in the MonoMac
		engine.&lt;/li&gt;
		&lt;li&gt;With our community, we have been &lt;a title="MonoMac sample
		source code"
		href="https://github.com/mono/monomac/tree/master/samples/"&gt;porting
		various samples&lt;/a&gt; that have helped us polish the API and
		make sure that it is natural and usable for C#
		programmers.&lt;/li&gt;
	&lt;/ul&gt;
	
	&lt;p&gt;In addition to those fundamental changes, MonoDevelop now
	also sports a new NSDocument-based template for new projects
	which will come in very handy for many
	developers.

	&lt;p&gt;The major changes in MonoMac 0.4 from version 0.2 released
	in early November are:
	&lt;ul&gt;
	    &lt;li&gt;MacCore (code shared with MonoTouch):
	    &lt;ul&gt;
	        &lt;li&gt;Support for Key Value Observing with C#&lt;/li&gt;
	        &lt;li&gt;Foundation extensions:
	        &lt;ul&gt;
	            &lt;li&gt;C# friendly NSNotificationCenter APIs&lt;/li&gt;
	            &lt;li&gt;NSPredicate support&lt;/li&gt;
	            &lt;li&gt;NSMetadata support&lt;/li&gt;
	            &lt;li&gt;Strongly typed NSRunLoop&lt;/li&gt;
	            &lt;li&gt;Extended NSError, NSMutableData,&lt;/li&gt;
	        &lt;/ul&gt;
	        &lt;/li&gt;
	        &lt;li&gt;CoreVideo framework bindings&lt;/li&gt;
	        &lt;li&gt;Security framework bindings&lt;/li&gt;
	        &lt;li&gt;CoreGraphics support for PDF files&lt;/li&gt;
	    &lt;/ul&gt;
	    &lt;/li&gt;
	    &lt;li&gt;MonoMac:
	    &lt;ul&gt;
	      &lt;li&gt;QTKit framework bindings&lt;/li&gt;
	      &lt;li&gt;NSDocument templates in MonoDevelop&lt;/li&gt;
	      &lt;li&gt;WebKit DOM APIs&lt;/li&gt;
	      &lt;li&gt;CoreImage APIs&lt;/li&gt;
	      &lt;li&gt;ECMA XML Documentation stubs are now in place&lt;/li&gt;
	      &lt;li&gt;Lots
	      of &lt;a href="https://github.com/mono/monomac/tree/master/samples/"&gt;samples&lt;/a&gt;!&lt;/li&gt;
	    &lt;/ul&gt;
	    &lt;/li&gt;
	&lt;/ul&gt;
	
	&lt;p&gt;Michael Hutchinson has
	a &lt;a href="http://mjhutchinson.com/journal/2010/06/09/monomac_in_monodevelop"&gt;walk
	through on using MonoMac with MonoDevelop&lt;/a&gt; that will get
	you up and running quickly.

	&lt;p&gt;We are still looking for contributors to help us bring more
	samples to MonoMac, create
	more &lt;a href="https://github.com/mono/monodevelop/tree/master/extras/MonoDevelop.MonoMac/MonoDevelop.MonoMac/templates/"&gt;MonoDevelop
	templates&lt;/a&gt; and help us add more of the system libraries to
	MonoMac.  If you want to join us, check out
	the &lt;a href="http://mono.1490590.n4.nabble.com/Mono-OSX-f1546893.html;cid=1291392004664-863"&gt;mono-osx
	mailing list&lt;/a&gt; and we are on the IRC channel #monomac on the
	server irc.gnome.org.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/3DNgtJMCiAU" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-03.html</feedburner:origLink></item><item><title>MonoTouch for iOS 4.2 is out.</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/zIJ2pMrWPa8/Dec-02.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Thu, 02 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-02.html</guid><description>&lt;p&gt;We have graduated
	our &lt;a href="http://monotouch.net/Releases/MonoTouch_3/MonoTouch_3.2.2"&gt;MonoTouch
	3.2&lt;/a&gt; into the stable channel and is now available for all
	of our MonoTouch users in the stable channel.  To update, just
	go to the Help menu on MonoDevelop, select the stable channel
	and check for updates.

	&lt;p&gt;In addition to adding support for the new APIs introduced
	in iOS 4.2 for the iPhone and the iPad in the core libraries,
	we have bound many more frameworks that our users have
	requested, in particular the horrifying Security framework API
	now has a nice C# binding that regular humans can consume.

	&lt;p&gt;Enjoy!&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/zIJ2pMrWPa8" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-02.html</feedburner:origLink></item><item><title>Improving upon dictionary bindings.</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/YWHPlPt8Qi8/Dec-01.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Wed, 01 Dec 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Dec-01.html</guid><description>&lt;p&gt;iOS and OSX expose many of their APIs as dictionaries.
	This means that instead of having properties or methods to
	configure a particular object, the configuration takes place
	by creating dictionaries that use some special keys with their
	associated values.  These APIs are not well suited for
	exploration from the IDE or from
	our &lt;a href="http://www.mono-project.com/CsharpRepl"&gt;REPL&lt;/a&gt;.
	The APIs typically look like this:

	&lt;pre class="code-csharp"&gt;
CFStringRef keys[] = {
    kCTFontAttributeName,
    kCTForegroundColorAttributeName
};
CFTypeRef  bval[] = {
    cfListLineCTFontRef,
    CGColorGetConstantColor(kCGColorBlack)
},

attr = CFDictionaryCreate (kCFAllocatorDefault,
        (const void **) &amp;amp;keys, (const void **) &amp;amp;bval,
        sizeof(keys) / sizeof(keys[0]), &amp;amp;kCFTypeDictionaryKeyCallBacks,
        &amp;amp;kCFTypeDictionaryValueCallBacks);

astr = CFAttributedStringCreate(kCFAllocatorDefault, CFSTR("FFFFFF"), attr);[/sourcecode]
&lt;/pre&gt;

	&lt;p&gt;To make the API more easy to discover through intellisense,
	and our assembly browser, we try to turn all of the
	Dictionary-based APIs into strongly typed classes that hide
	the dictionary, the names of the keys, and the types of the
	keys required.  The responsibility for getting the types
	right, to get the encoding working and to figure out which
	keys are valid or required in a dictionary are shifted from
	the programmer to the framework developers (in this case,
	MonoTouch and MonoMac developers).

	&lt;p&gt;What we typically do is we create a type that exposes all
	of the properties that might be supported by the dictionary,
	and we provide nullable version of them, for example, in the
	above case, Mono's implementation lives in the
	CFStringAttributes class, and the properties that we expose
	are these:

&lt;pre class="code-csharp"&gt;
public class CFStringAttributes ()
{
    public CTFont Font { get; set; }
    public CGColor ForegroundColor { get; set; }
    [...]
}&lt;/pre&gt;


	&lt;p&gt;Our users then instantiate configuration objects like this:

&lt;pre class="code-csharp"&gt;var attrs = new CFStringAttributes () {
    Font = listLineCTFont,
    ForegroundColor = UIColor.Black.CGColor
};
var astr = new NSAttributedString ("FFFFFF"), attrs);&lt;/pre&gt;


	&lt;p&gt;When you create your CFStringAttribute and start a new-line
	to enter properties, MonoDevelop knows the possible property
	values that you can initialize in the constructor, avoiding an
	entire trip to the documentation to figure out what is the key
	that you should use, the value and its encoding.  It is all
	kept on type-safe datatypes.

	&lt;p&gt;There is a second class of APIs, mostly in the Audio and
	Video APIs that exposes a whole set of properties behind
	fooGetProperty and fooSetProperty APIs.  Those APIs tend to be
	weakly typed, and take both a key, and depending on the key, a
	pointer to some value.  If you feed the wrong values to the
	program, your application could crash or corrupt its heap.  In
	these cases we have also walked away from exposing the
	low-level GetProperty/SetProperty methods, and instead exposed
	strongly-typed C# properties.

	&lt;p&gt;This is an example from the AudioFile API:

	&lt;pre class="code-csharp"&gt;
        AudioFileGetProperty (
                audioFileID,
                kAudioFilePropertyPacketSizeUpperBound,
                &amp;amp;propertySize,
                &amp;amp;maxPacketSize
        );&lt;/pre&gt;

	&lt;p&gt;In the above case, we are probing for the maximum packet
	size for the file.  The user has to find and pass the proper
	constant (kAudioFilePropertyPacketSizeUpperBound), the size of
	the object (this is a simple validation system to eliminate a
	certain class of memory corruption erors), the address of the
	variable that will get the result back, and then determine the
	proper type for the property (maxPacketSize).

	&lt;P&gt;What we have tried to do with MonoTouch/MonoMac is hide all
	of that complexity, and instead we expose strongly typed
	properties, in this case the equivalent code is:

&lt;pre class="code-csharp"&gt;
var maxPacketSize = audioFile.PacketSizeUpperBound;
&lt;/pre&gt;

	&lt;p&gt;The property is available as well for intellisense, so it
	is a lot simpler to see what is going on behind the scenes,
	shows up on the debugger window, on the interactive shell and
	means that scripting languages can access it without having to
	resort to reading C API documentation.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/YWHPlPt8Qi8" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Dec-01.html</feedburner:origLink></item><item><title>My own iOS and OSX centric blog</title><link>http://feedproxy.google.com/~r/MiguelsOsxAndIosBlog/~3/pIacQyu3y5M/Nov-30.html</link><author>miguel@gnome.org (Miguel de Icaza)</author><pubDate>Tue, 30 Nov 2010 21:33:00 PST</pubDate><guid isPermaLink="false">http://tirania.org/monomac/archive/2010/Nov-30.html</guid><description>&lt;p&gt;&lt;img class="alignright" title="MacOS Logo"
	src="http://primates.ximian.com/~miguel/pictures/smile.jpg"
	alt="MacOS Logo" width="96" height="90" /&gt;In the past 18
	months I started to spend a lot of time on OSX and iOS due to
	our MonoTouch project.  &lt;a title="MonoTouch"
	href="http://monotouch.net"&gt;MonoTouch&lt;/a&gt; was our effort to
	blend seamlessly the iOS Objective-C APIs with the C# and ECMA
	CLI APIs.  This is probably one of our nicest bindings that we
	have ever done for a native API, and it build on the
	experience from previous attempts like CocoaSharp, MonoObjc
	and other bindings that were created for the Mac in the past
	seven years.

	&lt;p&gt;The MonoTouch design and binding patterns proved to be very
	useful, and Geoff Norton and myself decided to bring the same
	design and patterns from iOS to OSX.  This is how the
	new &lt;a href="http://mono-project.com/MonoMac"&gt;MonoMac&lt;/a&gt;
	bindings were created.  While MonoTouch is a proprietary and
	commercial produce, MonoMac is open source and licensed under
	the MIT X11 license.

	&lt;p&gt;Building MonoMac has been a very fun experience, as the
	scope of the APIs is larger and also as it seems to have
	filled a void in the space.  As the binding bootstraps, we are
	starting to see both users and contributors that have helped
	us move MonoMac faster by providing help with the bindings,
	polishing the API or writing samples that show how to use
	MonoMac.

	&lt;p&gt;My &lt;a href="http://tirania.org/blog"&gt;personal blog&lt;/a&gt; did
	not feel like the right place to share tips and tricks on iOS
	and OSX development for two main reasons: (a) tips and tricks
	were bound to be fairly boring for people interested in other
	topics that I blog about, and (b) because both of these
	operating environments are proprietary and I feel that sites
	that have historically aggregated my blog did so for its open
	source content.&lt;img src="http://feeds.feedburner.com/~r/MiguelsOsxAndIosBlog/~4/pIacQyu3y5M" height="1" width="1"/&gt;</description><feedburner:origLink>http://tirania.org/monomac/archive/2010/Nov-30.html</feedburner:origLink></item></channel></rss>

