Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which "Top-Level Objects" is Apple talking about in the Memory Management Programming Guide?

In the Memory Management Programming Guide for Cocoa Apple talks about Top-Level Objects. They say, that I need an Outlet for each of them.

If there are any top-level objects you do not store in outlets, however, you must retain either the array returned by the loadNibNamed:owner:options: method or the objects inside the array to prevent those objects from being released prematurely.

So what exactly do they mean with "top-level object"? I would say they talk about the root view and window. What else? And is this hint just for cases in which I would want to load their nib manually? Or does it apply for any nib and any case?

like image 760
Thanks Avatar asked Apr 29 '09 22:04

Thanks


2 Answers

Top-level objects are objects that appear in the main nib window in Interface Builder, other than File’s Owner and Application.

like image 134
Jens Ayton Avatar answered Sep 28 '22 03:09

Jens Ayton


Yes, this is about the cases where you load the Nib manually, else you wouldn't have called loadNibNamed:owner:options:.

like image 21
Hejazzman Avatar answered Sep 28 '22 01:09

Hejazzman