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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to