Re: VC# vs. ObjC and partial abstract classes
Re: VC# vs. ObjC and partial abstract classes
- Subject: Re: VC# vs. ObjC and partial abstract classes
- From: Kyle Sluder <email@hidden>
- Date: Tue, 18 Mar 2014 18:11:34 -0700
On Tue, Mar 18, 2014, at 05:30 PM, William Squires wrote:
> Hi all!
> Some languages (like C++ and Visual C#) allow for partial abstract
> classes (i.e. some methods are implemented, while others are left to
> subclasses to implement - and, in fact, must implement since the
> partial abstract class does not). Is there a way to do this in ObjC?
There is no language support in Objective-C for any sort of abstract
classes.
> Is this why NSObject implements a protocol called NSObject (i.e. to
> make NSObject a partial abstract class)?
No, NSObject is not an abstract class. NSObject-the-protocol exists
because there are objects that conform to <NSObject> which are not
instances of subclasses of NSObject—the best example is subclasses of
NSProxy.
> Finally, does anyone know of a tool that'll convert VC# (dot net) code
> to ObjC (modern 2.0 syntax)?
There are far bigger differences between the two environments than just
the language you code in. Cocoa and the BCL are very different
frameworks.
> Can one forward declare an @protocol?
Yes. You could have easily tried this for yourself.
> Obviously (IIRC) a pure abstract class would map to a formal protocol
> in ObjC (or a class interface in languages such as REALbasic/Xojo, or
> VB 6). My best guess is to:
No, that's not what protocols are for. Any class can conform to any
protocol.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden