我知道这可能是一个重复的问题,但也有相互矛盾的答案!我对此有点困惑..我的问题是当我使用仪器检查泄漏来分析我的应用程序时..它在这种方法上一直显示泄漏loadNibNamed:
..与这些问题相关:
1.使用loadNibNamed:方法时需要释放IBOutlets吗?
我发现有些人说IBOutlets
即使你不实现访问器方法也必须释放!其他人说你不应该发布这些插座,因为 iOS 会处理它,所以我需要一个基于专业经验的正确答案,因为这需要我在我的项目上做很多工作。
编辑/例如:
如果这是我的 .h 类文件
@interface MenuViewEPub : UIViewController<ePubBrightnessDelegate,FontDelegate,PagesSlidePreviewerDelegate,ePubExpandSearchBarDelegate,EnviromentAudioChooserDelegate,UIPopoverControllerDelegate,WEPopoverControllerDelegate> {
IBOutlet UIView *upperMenu;
IBOutlet UIView *lowerMenu;
IBOutlet ePubBrightnessButton *brightnessButton;
IBOutlet FontButton *fontButton;
IBOutlet UIBarButtonItem *backButtonTitle;
IBOutlet UIBarButtonItem *indexButtonTitle;
IBOutlet UIBarButtonItem *annotationButtonTitle;
UIView *readerView;
IBOutlet ePubExpandSearchBar *searchBar;
id<MenuViewControllerDelegat>delegate;
IBOutlet PagesSlidePreviewer *pageSilder;
IBOutlet UIButton *arEnButton;
int pageNumber;
int chapterIndex;
int chtCount;
BOOL isLandscape;
UIPopoverController *lastPopover;
}
@property (nonatomic, assign) id<MenuViewControllerDelegat>delegate;
@property (nonatomic, retain) ePubExpandSearchBar *searchBar;
@property (nonatomic, assign) int chtCount;
@property (nonatomic, assign) int pageNumber;
@property (nonatomic, assign) int chapterIndex;
@property (nonatomic, assign) BOOL isRotate;
- (IBAction)tocButtonPressed:(id)sender;
- (IBAction)AnnotationsPressed:(id)sender;
- (IBAction)BackPressed:(id)sender;
- (IBAction)rtfPressed:(id)sender;
- (IBAction) audioPressed:(UIButton*)sender;
- (IBAction) tipsPressed:(UIButton*)sender;
- (void) showMenuInView :(UIView*) destview;
- (void) createViews;
- (void) hideMenu : (BOOL)animate;
- (void) changePageNumber:(int)pageNum;
@end
除了searchBar之外,我是否必须发布任何出口?