Re: Creating Interface

2008-08-28 Thread Chris Hanson
On Aug 28, 2008, at 7:32 AM, Roland King wrote: I don't quite understand why protocols like NSKeyValueObserving aren't formalized and in a .h file somewhere so you could just use them in the same way you can the NSObject protocol. They're documented, why not just write the .h file. There's

Re: Creating Interface

2008-08-28 Thread Roland King
On Aug 28, 2008, at 10:15 PM, Sherm Pendley wrote: On Thu, Aug 28, 2008 at 9:56 AM, Roland King <[EMAIL PROTECTED]> wrote: I tried that before, making my protocol inherit from the NSObject Protocol and it sort of worked, but not quite. Protocols aren't inherited. You can inherit an implemen

Re: Creating Interface

2008-08-28 Thread Sherm Pendley
On Thu, Aug 28, 2008 at 9:56 AM, Roland King <[EMAIL PROTECTED]> wrote: > I tried that before, making my protocol inherit from the NSObject Protocol > and it sort of worked, but not quite. Protocols aren't inherited. You can inherit an implementation of the NSObject protocol, by writing a subcla

Re: Creating Interface

2008-08-28 Thread Roland King
I tried that before, making my protocol inherit from the NSObject Protocol and it sort of worked, but not quite. In my case I was using KVO and wanted to call addObserver:forKeyPath:options:context:, something I'm very used to NSObject just doing. However that's not part of the NSObject pr

Re: Creating Interface

2008-08-28 Thread Phil
On Fri, Aug 29, 2008 at 12:32 AM, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > When you use the id syntaxt, the compiler assume your object only > implements the method declared in your protocol. > If you want to use some other function, you have to use an object type that > declare thoses functi

Re: Creating Interface

2008-08-28 Thread Jean-Daniel Dupas
Le 28 août 08 à 13:24, Christian Giordano a écrit : Protocols seems definitely the way to go and seems to work, I'm only getting some warnings. Basically what I did, I pass the instance implementing the protocol with this syntax: - (void) addListener:(id *) listener and I get "invalid receive

Re: Creating Interface

2008-08-28 Thread Christian Giordano
Protocols seems definitely the way to go and seems to work, I'm only getting some warnings. Basically what I did, I pass the instance implementing the protocol with this syntax: - (void) addListener:(id *) listener and I get "invalid receiver type 'id *' Funny enough after I get another warning

Re: Creating Interface

2008-08-28 Thread Matthias Schonder
You may read this: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_6.html#/ /apple_ref/doc/uid/TP30001163-CH15-TPXREF148 On 28.08.2008, at 12:14, Christian Giordano wrote: Hi guys, I would like to create an Interface which will be eventually i

Creating Interface

2008-08-28 Thread Christian Giordano
Hi guys, I would like to create an Interface which will be eventually implemented by some classes. I am a bit confused here, in objective-c the .h files are basically already interfaces. Ok, but how could a .m file implements more than one? I couldn't find any document explaining how to implements