• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: VC# vs. ObjC and partial abstract classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: VC# vs. ObjC and partial abstract classes
      • From: Luther Baker <email@hidden>
References: 
 >VC# vs. ObjC and partial abstract classes (From: William Squires <email@hidden>)

  • Prev by Date: VC# vs. ObjC and partial abstract classes
  • Next by Date: Re: VC# vs. ObjC and partial abstract classes
  • Previous by thread: VC# vs. ObjC and partial abstract classes
  • Next by thread: Re: VC# vs. ObjC and partial abstract classes
  • Index(es):
    • Date
    • Thread