• 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: immutable collection given to mutating function error
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: immutable collection given to mutating function error


  • Subject: Re: immutable collection given to mutating function error
  • From: Charles Srstka <email@hidden>
  • Date: Sun, 22 Feb 2009 18:55:13 -0600

Replace this line:

On Feb 22, 2009, at 11:17 AM, Michael Domino wrote:

prefMinorSectionCFMutableDictionaryRef = static_cast<CFMutableDictionaryRef>(const_cast<void*>(pVoid));

with this:

prefMinorSectionCFMutableDictionaryRef = CFDictionaryCreateMutableCopy(NULL, 0, static_cast<CFDictionaryRef>(const_cast<void*>(pVoid)));

This way, you'll be sure to always get a mutable dictionary, regardless of whether the original was mutable or not.

Charles
_______________________________________________

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


References: 
 >immutable collection given to mutating function error (From: Michael Domino <email@hidden>)

  • Prev by Date: Re: Name to PSN
  • Next by Date: Re: Name to PSN
  • Previous by thread: Re: immutable collection given to mutating function error
  • Next by thread: Small animation inside NSCell (progress bar)
  • Index(es):
    • Date
    • Thread