Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory Management and NSView



Hi,

I am a newbiew and memory management and pointers are giving me headaches.

I have a custom view with an attached class. I declare a MutableArray in the header file and alloc and init it in initWithFrame.

Then is drawRect I access a member of the array. The first time drawRect is called this works fine, but the second time the program crashes. If I retain the array in the top of drawRect everything works fine, but the retain count just increases every time drawRect is called and this seems wrong. If I retain the array at the top and release it at the bottom the program goes back to crashing again when drawRect is called.

What am I missing?

-Chris


_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.