retaincount - Calling UIViews's subviews property increments subview retain count by 1? -
i have code:
uiview *superview = [[uiview alloc] init]; uiview *subview = [[uiview alloc] init]; [superview addsubview:subview]; [subview release]; nslog(@"retain before %i", [subview retaincount]);//prints 1 int = superview.subviews.count ; nslog(@"retain after %i", [subview retaincount]);//prints 2 = superview.subviews.count ; nslog(@"retain odd %i", [subview retaincount]);//keeps printing 2
is "expected" behavior ?. if so, underlying logic ?
Comments
Post a Comment