小编Ms.*_*ann的帖子

NSIndexPath:发送到解除分配的实例的消息

您可以提供的任何帮助将不胜感激.

我有一个具有tableView,detailView,flipView和moreDetail View的应用程序.它很好地通过过渡直到第26个元素.当我点击导航到flip和moreDetailView的按钮时,应用程序崩溃了.

我收到错误消息:[NSIndexPath row] message sent to deallocated instance.

我想我可能会多次调用indexPath,但为什么一切都运行良好直到第25个元素然后停止工作?NSIndexPath是如何解除分配的?我从来没有解除分配.

如果您知道,请帮忙.谢谢!!!

Xcode说问题在这里:

@implementation produceView aka *detailView*

- (IBAction)showInfo {

        FlippedProduceView *fView = [[FlippedProduceView alloc]initWithIndexPath:index];
    fView.flipDelegate = self;


    fView.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
    [self presentModalViewController:fView animated:YES];
         [fView release]; 

}


 - (IBAction) buttonPushed:(id)sender

{

    picView *pictureView = [[picView alloc]initWithIndexPath:index];


    pictureView.picDelegate = self;
    pictureView.modalTransitionStyle = UIModalTransitionStyleCrossDissolve;     

    [self presentModalViewController:pictureView animated:YES];
        [pictureView release];
}

-(id)initWithIndexPath:(NSIndexPath *)myIndexPath {   
if (self == [super init]) {
            path = myIndexPath;

    }
    return self;

}

@implementation picView aka *moreDetailView* …
Run Code Online (Sandbox Code Playgroud)

iphone transitions nsindexpath

1
推荐指数
1
解决办法
2024
查看次数

标签 统计

iphone ×1

nsindexpath ×1

transitions ×1