Re: Problem with allocating memory

2009-10-28 Thread Jeremy Pereira
On 28 Oct 2009, at 09:27, Michael Abendroth wrote: Basically, I got a source list to witch the user can add entries via a button. The user can also edit the entries title by double clicking on it. The problem is that when you add 3 entries for example, and then edit them, all the items you rena

Re: Problem with allocating memory

2009-10-28 Thread Alexander Spohr
Am 28.10.2009 um 10:27 schrieb Michael Abendroth: Why is this happening? How should we know if you don’t provide the faulty code? atze ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Problem with allocating memory

2009-10-28 Thread Michael Abendroth
Thanks for the input! Using the %p printing, I found out that I might not actually have the problem I thought I had. I checked for the addresses in memory of the entries. They are all different so I guess the problem isn't that they all point to the same object. Basically, I got a source list to wi

Re: Problem with allocating memory

2009-10-27 Thread Rob Keniger
On 28/10/2009, at 1:31 PM, Stephen J. Butler wrote: > Because you're printing the address of the stack variable myString, > which is the same place on the stack every time. Not to mention the fact that you're leaking a string on each iteration through the loop. -- Rob Keniger _

Re: Problem with allocating memory

2009-10-27 Thread BJ Homer
> > > > NSLog(@"%d", &myString); > Change this line to: NSLog(@"%p", myString); that will print the value of the pointer, which you'll see changing. -BJ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or mode

Re: Problem with allocating memory

2009-10-27 Thread Stephen J. Butler
On Tue, Oct 27, 2009 at 12:36 PM, Michael Abendroth wrote: > #import > > int main (int argc, const char * argv[]) { > >     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; > > for (int i = 0; i < 3; i++) { > > NSMutableString* myString = [[NSMutableString alloc] > initWithString:[[NS

Problem with allocating memory

2009-10-27 Thread Michael Abendroth
Hi everybody, I wrote this extremely simple program: #import int main (int argc, const char * argv[]) {     NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; for (int i = 0; i < 3; i++) { NSMutableString* myString = [[NSMutableString alloc] initWithString:[[NSDate date] description