• 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: Weird error with structs and @try/@catch
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird error with structs and @try/@catch


  • Subject: Re: Weird error with structs and @try/@catch
  • From: Derrick Bass <email@hidden>
  • Date: Wed, 10 May 2006 23:07:49 -0500
  • Resent-date: Wed, 10 May 2006 23:08:14 -0500
  • Resent-from: Derrick Bass <email@hidden>
  • Resent-message-id: <email@hidden>
  • Resent-to: Apple Cocoa List <email@hidden>


On May 10, 2006, at 8:47 PM, Glen Simmons wrote:


On May 10, 2006, at 8:32 PM, Shaun Wexler wrote:

On May 10, 2006, at 6:29 PM, Glen Simmons wrote:

This is a bug, for sure... but for a workaround, can't you just recast it?


[self foo:(NSRect)aRect];

Nope, that recast has no effect. Is there a way to cast away the volatile-ness?

Try this instead:

[self foo:*(NSRect *)&aRect];

Yep, that works. But boy is it ugly. :)

The C++ way would be
[self foo:const_cast<NSRect&>(aRect)]
(or const NSRect& depending on how aRect was declared). const_cast's are used to cast away constness, but also volatileness as well.


Derrick

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


  • Prev by Date: Re: ArrayController, CoreData & Bindings
  • Next by Date: Problem creating binding for deployment
  • Previous by thread: Re: Weird error with structs and @try/@catch
  • Next by thread: NSComboBox, observeValueForKeyPath:, and modal dialog
  • Index(es):
    • Date
    • Thread