Memory mania
Memory mania
- Subject: Memory mania
- From: email@hidden
- Date: Thu, 7 Feb 2002 10:45:45 -0800
Ok, This is long and maybe a bit vague, but I hope someone can help me...
I've got this program (my first 'major' on-my-own Cocoa app), and in my
controller class, I have two NSMutableArrays. One array contains various
instances of a custom class (I'll call it MyClass). The other array
holds NSMutableDictionarys that will make certain adjustments on the
MyClass instances in the other array. Both arrays start empty, and when
the user enters in some information, the first array is filled with
information contained in the instances of MyClass (This stuff is
tabulated in an NSTableView). Then, the user can proceed to make
alterations to the data manually, which in the code, adds an
NSMutableDictionary to the second array with all the changes made in
this dictionary. After every modification, the first array is
deallocated, then realloced with new MyClass's made from the adjustment
array. On the change, everything works fine. However, when it is done a
second time, it doesn't work right. I've gone through this with GBD and
it does something strange. During the first user action, before and
after the [firstArray release] "po secondArray" works fine. However,
when the second time comes, print-object shows the correct output before
firstArray is released, but directly afterwards, it gives me an
EXC_BAD_ACCESS error and halts the app. What's up with this? I didn't do
a thing to secondArray, but now it can't find the object?? I have yet to
read on good retain/release manners so my program is full of these kind
of errors...
Please help? Source code available if necessary...
-Kevin Perry
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.