[Mono-osx] NSTableView, monomac, monodevelop

JohnMoshakis john at moshakis.com
Wed Jun 9 16:28:56 EDT 2010


Hi,

I'm using the monodevelop build with the monomac addin. I have followed the
example here

http://mjhutchinson.com/journal/2010/06/09/monomac_in_monodevelop#comment-763

If I add a NSTableView in a similar manner to the other controls and hook
everything up, if you look at the bottom of MainWindow.Designer.xib.cs there
is this

	// Should subclass MonoMac.AppKit.NSControl
	[MonoMac.Foundation.Register("NSTableView")]
	public partial class NSTableView {
	}

Should that be there ?

I was creating my own class derived from NSTableViewDataSource and adding an
override for GetRowCount. This method has a single parameter of type
NSTableView and it until you add the namespace it thinks your wanting the
partial class.

namespace MonoMacHelloWorld
{
	public class MyDataSource : NSTableViewDataSource
	{
		public MyDataSource ():base()
		{
		}
		
		public override int GetRowCount (NSTableView tableView)
		{
			return base.GetRowCount (tableView);
		}
			
		
	}
}

This generates an error 

/Users/JohnMoshakis/Documents/develop/MonoMacHelloWorld/MonoMacHelloWorld/MyDataSource.cs(37,37):
Error CS0505:
`MonoMacHelloWorld.MyDataSource.GetRowCount(MonoMacHelloWorld.NSTableView)':
cannot override because
`MonoMac.AppKit.NSTableViewDataSource.GetRowCount(MonoMac.AppKit.NSTableView)'
is not a method (CS0505) (MonoMacHelloWorld)		

Cheers,
John
-- 
View this message in context: http://mono.1490590.n4.nabble.com/NSTableView-monomac-monodevelop-tp2249491p2249491.html
Sent from the Mono - OSX mailing list archive at Nabble.com.


More information about the Mono-osx mailing list