Adding self as Nib owner

  • I recently noticed that when I add an instance of my
    object as the owner of a Nib, that it's retain count
    jumps to two.

    - (id)init
    {
        if ( self = [super init] )
        {
            [NSBundle loadNibNamed:@"MyNib" owner:self];
        }

        return self;
    }

    I've Googled this and learned that when my instance
    finally is deallocated, that the Nib file it owns is
    not. Apparently, the top level objects on the Nib file
    (NSWindow, NSMenu, etc...) need to be manually released?!

          ____________________________________________________________________________________
    Be a better friend, newshound, and
    know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
  • on 1/10/08 1:05 PM, <howlewere...> purportedly said:

    > I've Googled this and learned that when my instance
    > finally is deallocated, that the Nib file it owns is
    > not. Apparently, the top level objects on the Nib file
    > (NSWindow, NSMenu, etc...) need to be manually released?!

    Yes:
    http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/
    C

    ocoaNibs/chapter_3_section_6.html#//apple_ref/doc/uid/10000051i-CH4-DontLink
    ElementID_12

    Best,

    Keary Suska
    Esoteritech, Inc.
    "Demystifying technology for your home or business"
previous month january 2008 next month
MTWTFSS
  1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31      
Go to today