我遇到了一个非常好的 API MBProgressHUD,但是当我阅读头文件MBProgressHUD.h中的文档时,我感到困惑,因为文档说这- (id)initWithWindow:(UIWindow *)window;
是一个方便的构造函数。
根据有关内存管理的 Apple 文档,便利构造函数不应以以下任何前缀为前缀:init、alloc、copy。
谁能澄清我是否在这里遗漏了什么?
/*** A convenience constructor that initializes the HUD with the window's bounds.
* Calls the designated constructor with
* window.bounds as the parameter.
* @param window The window instance that will provide the bounds for the HUD.
* Should probably be the same instance as
* the HUD's superview (i.e., the window that the HUD will be added to).
*/
- (id)initWithWindow:(UIWindow *)window;