• 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: Re Re: String variables in classes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re Re: String variables in classes


  • Subject: Re: Re Re: String variables in classes
  • From: Charles Srstka <email@hidden>
  • Date: Sun, 2 Jan 2011 17:38:43 -0600

On Jan 2, 2011, at 5:17 PM, Brian Durocher wrote:

> Thank you guys for your assistance. I come from a C++ background and
> have done embedded design in ASM. But this way of working and
> particularly the framework is very new to me. I understand what you are
> saying, but the literature I am reading is very disappointingly. I have
> solved the issue with the strings soon after I wrote the message but
> just for completeness and for the sake of a decent critique I will post
> the new code. I love the term you are flailing around here, thats
> exactly how I felt until I discovered where I was going wrong. Thanks
> Graham and Stephen for your replies and comments.
>
> Graham I believe you asked what does "//does not work" mean. I think the
> compiler was giving me a function returns void and should be handled as
> such. Basically, function returns nothing.
>
> This line of code seems to work for exactly what I was looking for:
>
>    temp = [[temp stringByAppendingFormat:@" %@ %@ \n", input1, input2]
> retain];
>
> although I have to admit I am unsure really what the "retain" will
> actually do here with respect to memory.  The the preceding [temp
> autorelease] create a memory leak or is this the correct way to handle
> memory management within the framework?

Also, your Calculator class seems to be missing a -dealloc method entirely now. That is going to cause leaks for sure.

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: 
 >Re Re: String variables in classes (From: Brian Durocher <email@hidden>)

  • Prev by Date: Re: Search within a UIWebView (iOS 4.2)
  • Next by Date: Re: Re Re: String variables in classes
  • Previous by thread: Re: Re Re: String variables in classes
  • Next by thread: Re: Re Re: String variables in classes
  • Index(es):
    • Date
    • Thread