Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Saagar Jha
Yup, this declares ImportTool (a subclass of NSObject) with the lightweight generic parameters X, Y, and Z. Here are some examples and how they map to Swift, which

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Andy Lee
The compiler may accept it, but it doesn't interpret it the way you think. You can confirm by checking whether your class formally conforms to the protocols. Try this with your old code and your new code, and compare: NSLog(@"conforms to protocol? %d", [ImportTool

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
Very strange - the compiler is quite happy with my waywardness. Peter > On 28 Mar 2019, at 23:39, Quincey Morris > wrote: > >> On Mar 28, 2019, at 15:58 , Peter Hudson wrote: >> >> @interface ImportTool > NSEncoding> : NSObject > > You’re Doing It Wrong™. You mean: > >> @interface

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Rob Petrovec
Yes, this. —Rob > On Mar 28, 2019, at 5:39 PM, Quincey Morris > wrote: > > On Mar 28, 2019, at 15:58 , Peter Hudson wrote: >> >> @interface ImportTool > NSEncoding> : NSObject > > You’re Doing It Wrong™. You mean: > >> @interface ImportTool : NSObject > NSTableViewDelegate, NSEncoding>

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Quincey Morris
On Mar 28, 2019, at 15:58 , Peter Hudson wrote: > > @interface ImportTool NSEncoding> : NSObject You’re Doing It Wrong™. You mean: > @interface ImportTool : NSObject NSTableViewDelegate, NSEncoding> I don’t know what it means the way you wrote it. Something about lightweight generic

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
Hi Alex After some thought i cast the object in question to (id) and the compiler was happy, and the program runs. Guess i need to read up on this aspect of the language. Peter > On 28 Mar 2019, at 23:29, Alex Zavatone wrote: > > Not sure if this is a right answer, but what happens if you

Re: Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Alex Zavatone
Not sure if this is a right answer, but what happens if you weakify the instance? Also, I suspect this is for MacOS, not iOS? What happens if you try to recreate this in a simple case in a fresh project? Alex Zavatone Sent from my iPhone > On Mar 28, 2019, at 5:58 PM, Peter Hudson wrote: >

Trouble assigning datasource and delegate to an instance of NSTableView

2019-03-28 Thread Peter Hudson
Hi there The class I am trying to use as a datasource and delegate to an NSTableView adopts the required protocols and implements the required methods :- @interface ImportTool : NSObject etc … But when I try to assign an instance of ImportScript as datasource and delegate to the table