1
我使用UIPageViewController时遇到大内存泄漏问题。我有一个看法,我滚动它。我发现记忆增长非常快。内存泄漏iPhone和UIPageViewController
我认为这就是问题所在:
- (ViewControllerEvent *)viewControllerAtIndex:(NSUInteger)index {
ViewControllerEvent *childViewController = [[UIStoryboard storyboardWithName:[self isIPad][email protected]"Main_iPad":@"Main_iPhone" bundle:nil] instantiateViewControllerWithIdentifier:@"ViewControllerEvent2"];
childViewController.index = index;
childViewController.event = [self.events objectAtIndex:index];
return childViewController;
}
我的类:
@interface ViewControllerEvent : UIViewController
@property (assign, nonatomic) NSDictionary *event;
@property (assign, nonatomic) NSInteger index;
@property (weak, nonatomic) IBOutlet UIImageView *header;
@property (weak, nonatomic) IBOutlet UIScrollView *_scrollViewDesc;
@property (retain, nonatomic) IBOutlet UITextView *descLabel;
@property (retain, nonatomic) IBOutlet UIView *whiteBackground;
@property (weak, nonatomic) IBOutlet UIImageView *bootomMapImage;
@end
我用我的传呼机约100意见。
这真的是一个实例方法吗?它不应该是一个类方法吗? – bilobatum
我编辑了我的问题。 – Unmerciful
您可以通过使用类方法来减少内存使用量。请参阅下面的答案。一个实例方法需要您试图为页面视图控制器进行销售的视图控制器实例。 – bilobatum