• 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: PICT control problems [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: PICT control problems [SOLVED]


  • Subject: Re: PICT control problems [SOLVED]
  • From: Bill Bumgarner <email@hidden>
  • Date: Sat, 24 Jun 2006 10:45:38 -0500

On Jun 24, 2006, at 10:36 AM, Marshall Clow wrote:
At 10:28 AM -0500 6/24/06, Bill Bumgarner wrote:
Objective-C is trivial to learn for a C programmer. And you can use C++ in Objective-C apps just fine.

I just flat out disagree with this.

Mixing Objective-C and C++ "looks like it should work", and frequently does.
Then someone throws an exception, and you realize that you are standing on a tall bridge with no guard rails, and the wind is blowing hard.


[ For the non-metaphorically minded - Objective C and C++ have different exception models, and they don't play well together at all ]

Cocoa does not use Exceptions for anything but programmer error. NSExceptions should never be thrown in a Cocoa application as a normal part of execution. If your own code throws NSExceptions as a part of execution to indicate user error, then your architecture is fighting against the grain of Cocoa and I would suggest that -- regardless of any personal affection for Exceptions to indicate other than programmer error -- you reconsider the architecture of your app.


Given bindings, KVO, KVC and other Cocoa centric mechanisms, the most effective integration of C++ in Cocoa that I have encountered generally involves wrapping the C++ objects in Objective-C objects such that the full extent of the Cocoa framework(s) can be leveraged to build the UI. This naturally leads to a well defined line across which exception handling can be divided.

Setting reply-to to cocoa-dev because this has now gone well beyond the charter of xcode-users.

b.bum
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Objective-C++ Exceptions (was: PICT control problems)
      • From: Steve Sisak <email@hidden>
References: 
 >PICT control problems (From: John Lunt <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: John Lunt <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: Scott Thompson <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: John Lunt <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: Markus Hitter <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: John Lunt <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: Bill Bumgarner <email@hidden>)
 >Re: PICT control problems [SOLVED] (From: Marshall Clow <email@hidden>)

  • Prev by Date: Re: PICT control problems [SOLVED]
  • Next by Date: Objective-C++ Exceptions (was: PICT control problems)
  • Previous by thread: Re: PICT control problems [SOLVED]
  • Next by thread: Objective-C++ Exceptions (was: PICT control problems)
  • Index(es):
    • Date
    • Thread