• 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
Memory mania
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: opening images q
  • Next by Date: Re: Interacting with an NSTask via pipes
  • Previous by thread: Re: opening images q
  • Next by thread: Disable the drag snap-back?
  • Index(es):
    • Date
    • Thread