• 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: Invalid value of the string instance variables
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Invalid value of the string instance variables


  • Subject: Re: Invalid value of the string instance variables
  • From: Frederick Cheung <email@hidden>
  • Date: Mon, 31 Jan 2005 12:10:13 +0000


On 31 Jan 2005, at 08:57, Tan Dung Ho wrote:

I implemented the AppController classs in my project. It had a
instance variable which declared NSString (NSString* strValue,..) and
the method to set value:
	-(void)setStrValue: (NSString*)value
	{
		strValue = [NSString stringWithString:value];
	}

stringWithString retuns an autoreleased object, which you are not retaining, so at some point in the near future strValue will be released and you are left with a pointer pointing at garbage.


Fred

_______________________________________________
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


References: 
 >Invalid value of the string instance variables (From: Tan Dung Ho <email@hidden>)

  • Prev by Date: Re: newbie unicode problem
  • Next by Date: Re: CFPasteboardResolveAllPromisedData crash
  • Previous by thread: Re: Invalid value of the string instance variables
  • Next by thread: newbie unicode problem
  • Index(es):
    • Date
    • Thread