On Feb 23, 2008, at 6:44 PM, Hamish Allan wrote:
On Sun, Feb 24, 2008 at 2:25 AM, Jack Repenning <[EMAIL PROTECTED]> wrote:

In my -(id)initWithContext:, I [NSBundle loadNibNamed:@"SCCommitUI"
owner:self].  Among other things, this retains me a few times inside
the bundle. When I'm done, I want "self" to go away, but it does not:
the retain count never goest to zero (my dealloc is never called),
because of those retains inside the bundle.  How do I make the
bundle / nib let me go?

A similar question came up recently on the list, and the short answer
is: if the bundle wants to retain you, let it do so; if you want the
resources you release in your dealloc method gone sooner, create an
API for that (c.f. [NSFileHandle closeFile]).

I must not be fully understanding this solution, and I can't seem to locate the thread. Can you hint me some keywords, or an URL or something?

I understand the part about providing a closeMe method, to do all the releasing new done in my unused -dealloc. But there's the "me" itself to release or leak, and there see still to be references to it that seem still to be used in some way or other (to judge from my BADACCESS crashes if I over-release myself). And I do want to create new instances of "me", bound once again to the same nib (or an identical one), to post the window yet again. Are you saying I should just let that stuff leak?

-==-
Jack Repenning
Chief Technology Officer
CollabNet, Inc.
8000 Marina Boulevard, Suite 600
Brisbane, California 94005
office: +1 650.228.2562
mobile: +1 408.835.8090
raindance: +1 877.326.2337, x844.7461
aim: jackrepenning
skype: jrepenning




_______________________________________________

Cocoa-dev mailing list ([email protected])

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 [EMAIL PROTECTED]

Reply via email to