Toute aide que vous pouvez offrir serait appréciée.NSIndexPath: message envoyé à l'instance désaffectée
J'ai une application qui a une tableView, detailView, flipView, et plusDetail View. C'est bien de passer à travers les transitions jusqu'au 26ème élément. L'application se bloque lorsque je clique sur les boutons qui naviguent vers le flip et plusDetailView.
Je reçois l'erreur Msg: [NSIndexPath row] message sent to deallocated instance
.
Je pense que j'appelle l'indexPath trop de fois, mais pourquoi tout fonctionne bien jusqu'au 25ème élément et puis arrête de fonctionner? Comment le NSIndexPath a-t-il été désalloué? Je ne l'ai jamais libéré.
Si vous le savez, aidez s'il vous plaît. Je vous remercie!!!
Xcode dit que le problème est ici:
@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*
- (void)viewDidLoad {
RipeGuideAppDelegate *AppDelegate = (RipeGuideAppDelegate *)[[UIApplication sharedApplication] delegate];
self.picViewArray = AppDelegate.arrayProduceInfo;
NSMutableDictionary *dictionary = [picViewArray objectAtIndex:path.row];
}
@implementation FlippedProduceView aka *flipView*
- (id)initWithIndexPath:(NSIndexPath *)myIndexPath {
if (self == [super init]) {
indexes = myIndexPath;
}
return self;
}
- (void)viewDidLoad {
RipeGuideAppDelegate *AppDelegate = (RipeGuideAppDelegate *)[[UIApplication sharedApplication] delegate];
self.flipViewArray = AppDelegate.arrayProduceInfo;
NSMutableDictionary *dictionary = [flipViewArray objectAtIndex:indexes.row];
}
Pouvez-vous s'il vous plaît mettre le code dans des blocs de code (Ctrl-K)? C'est * très * difficile à lire – Fred
Merci Alex! : D – Fred