mail-archives/mono-osx/2011-January/003759.html

103 строки
3.3 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE> [Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;
</TITLE>
<LINK REL="Index" HREF="index.html" >
<LINK REL="made" HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMonoMac%5D%20%22Apply%20Protocol%20to%20Class%22&In-Reply-To=AANLkTinSeTPpukbut8oiSRBZUXBcQL56%2B21LAQyEBjgz%40mail.gmail.com">
<META NAME="robots" CONTENT="index,nofollow">
<META http-equiv="Content-Type" content="text/html; charset=us-ascii">
<LINK REL="Previous" HREF="003748.html">
<LINK REL="Next" HREF="003761.html">
</HEAD>
<BODY BGCOLOR="#ffffff">
<H1>[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;</H1>
<B>Miguel de Icaza</B>
<A HREF="mailto:mono-osx%40lists.ximian.com?Subject=%5BMono-osx%5D%20%5BMonoMac%5D%20%22Apply%20Protocol%20to%20Class%22&In-Reply-To=AANLkTinSeTPpukbut8oiSRBZUXBcQL56%2B21LAQyEBjgz%40mail.gmail.com"
TITLE="[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;">miguel at novell.com
</A><BR>
<I>Fri Jan 21 10:55:13 EST 2011</I>
<P><UL>
<LI>Previous message: <A HREF="003748.html">[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;
</A></li>
<LI>Next message: <A HREF="003761.html">[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3759">[ date ]</a>
<a href="thread.html#3759">[ thread ]</a>
<a href="subject.html#3759">[ subject ]</a>
<a href="author.html#3759">[ author ]</a>
</LI>
</UL>
<HR>
<!--beginarticle-->
<PRE>Hello,
&gt;<i> I ran into a usage pattern that seems common. &#160;In Interface Builder define
</I>&gt;<i> an NSTableView and an NSArrayController. &#160;Set the NSArrayController as the
</I>&gt;<i> outlet for the NSTableView's dataSource and delegate. &#160;Then specify the
</I>&gt;<i> NSArrayController to be a custom class.
</I>
So I was looking into this, and the recommended use case for the
NSArrayController is not to set it as the delegate/data source as you
described, but instead to use Bindings (KVO/KVC) to hook up the data,
and this would require no intervention on your end for this, nor
implementing the protocols like that.
<A HREF="http://www.cocoadev.com/index.pl?NSArrayController">http://www.cocoadev.com/index.pl?NSArrayController</A>
And:
<A HREF="http://www.cocoabuilder.com/archive/cocoa/196362-beyond-mv-and-one.html#196372">http://www.cocoabuilder.com/archive/cocoa/196362-beyond-mv-and-one.html#196372</A>
Miguel
</PRE>
<!--endarticle-->
<HR>
<P><UL>
<!--threads-->
<LI>Previous message: <A HREF="003748.html">[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;
</A></li>
<LI>Next message: <A HREF="003761.html">[Mono-osx] [MonoMac] &quot;Apply Protocol to Class&quot;
</A></li>
<LI> <B>Messages sorted by:</B>
<a href="date.html#3759">[ date ]</a>
<a href="thread.html#3759">[ thread ]</a>
<a href="subject.html#3759">[ subject ]</a>
<a href="author.html#3759">[ author ]</a>
</LI>
</UL>
<hr>
<a href="http://lists.ximian.com/mailman/listinfo/mono-osx">More information about the Mono-osx
mailing list</a><br>
</body></html>