• 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
NSString becoming invalid
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSString becoming invalid


  • Subject: NSString becoming invalid
  • From: "McLaughlin, Michael P." <email@hidden>
  • Date: Thu, 11 Jun 2009 09:53:29 -0400
  • Acceptlanguage: en-US
  • Thread-topic: NSString becoming invalid

In an Xcode (3.1.2) Cocoa document app targeting 10.5, I read an NSString
from an XML file and store it, eventually, in a C++ struct as

NSString *fname;

This works most of the time but, sporadically, I get a BAD_ACCESS crash with
an indication that fname has become invalid.  The only explanation I have
found for this is that fname was not sufficiently retained and has been
garbage-collected.

Note: All my C++ files have a .mm extension and garbage collection is
*required*.  Thus, I have no retain/release calls at all.

Is there something more I need to do or is there some other reason why this
might be happening?

TIA.

--
Mike McLaughlin

_______________________________________________

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: NSString becoming invalid
      • From: Michael Ash <email@hidden>
  • Prev by Date: Doc kind from extension
  • Next by Date: Re: Doc kind from extension
  • Previous by thread: Re: Doc kind from extension
  • Next by thread: Re: NSString becoming invalid
  • Index(es):
    • Date
    • Thread