これは重複した質問である可能性があることを私は知っていますが、それについても矛盾する答えがあります!私はそれについて少し混乱しています..私の問題は、リークをチェックするために機器を使用してアプリをプロファイリングするときですloadNibNamed:
..このメソッドでリークを表示し続ける..これらの質問に関連しています:
1. loadNibNamed:メソッドを使用するときにIBOutletsを解放する必要がありますか?
2. loadNibNamedを使用すると、メモリリークが発生します
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以外のアウトレットをリリースする必要がありますか?