Memory leaks UIScrollView内存泄漏---编辑:iOS 5.1错误

Memory leaks UIScrollView内存泄漏---编辑:iOS 5.1错误,memory-leaks,Memory Leaks,原来这是一个iOS 5.1错误。如果搜索的措词正确,就会有很好的记录:-) 我正在将UIScrollView与分页子视图一起使用。不知何故,当我在仪器中测试我的应用程序时,这些都会产生泄漏。我已经将代码简化为这个简单的状态,在两个子视图之间切换时仍然会泄漏代码。在滚动视图上启用分页。我正在使用ARC CGRect frame; frame.origin.x = self.theScrollPart.frame.size.width * 0;

原来这是一个iOS 5.1错误。如果搜索的措词正确,就会有很好的记录:-)

我正在将UIScrollView与分页子视图一起使用。不知何故,当我在仪器中测试我的应用程序时,这些都会产生泄漏。我已经将代码简化为这个简单的状态,在两个子视图之间切换时仍然会泄漏代码。在滚动视图上启用分页。我正在使用ARC

CGRect frame;

    frame.origin.x = self.theScrollPart.frame.size.width * 0;                   
    frame.origin.y = 0;
    frame.size = self.theScrollPart.frame.size;

    self->subview = [[UIView alloc] initWithFrame:frame];
    [self.theScrollPart addSubview:subview];

    frame.origin.x = self.theScrollPart.frame.size.width * 1;
    frame.origin.y = 0;
    frame.size = self.theScrollPart.frame.size;

    self->subview2 = [[UIView alloc] initWithFrame:frame];
    [self.theScrollPart addSubview:subview2];

    self.theScrollPart.contentSize = CGSizeMake(self.theScrollPart.frame.size.width * 2, self.theScrollPart.frame.size.height);
.h文件是:

@property (weak, nonatomic) IBOutlet UIScrollView *theScrollPart;
@property (strong, nonatomic) IBOutlet UIView *subview;
@property (strong, nonatomic) IBOutlet UIView *subview2;
谢谢你的帮助,和往常一样,如果我忽略了一些显而易见的事情,我很抱歉