Il est clair que quelque chose d'évident m'échappe ici et j'apprécierais vraiment que vous me donniez votre avis. J'ai essayé à plusieurs reprises de soumettre une application à Apple (iPad dans ce cas) qui se bloque de leur côté lors des tests, mais je ne peux pas reproduire la situation de mon côté (évidemment, je n'ai que ce satané simulateur pour travailler à ce stade).
Le journal du crash est le suivant :
Date/Time: 2010-04-01 05:39:47.226 -0700
OS Version: iPhone OS 3.2 (7B367)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x000790a0 __kill + 8
1 libSystem.B.dylib 0x00079090 kill + 4
2 libSystem.B.dylib 0x00079082 raise + 10
3 libSystem.B.dylib 0x0008d20a abort + 50
4 libstdc++.6.dylib 0x00044a1c __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x000057c4 _objc_terminate + 104
6 libstdc++.6.dylib 0x00042dee __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x00042e42 std::terminate() + 10
8 libstdc++.6.dylib 0x00042f12 __cxa_throw + 78
9 libobjc.A.dylib 0x000046a4 objc_exception_throw + 64
10 CoreFoundation 0x00090c6e +[NSException raise:format:arguments:] + 74
11 CoreFoundation 0x00090d38 +[NSException raise:format:] + 28
12 Foundation 0x00002600 -[NSCFDictionary setObject:forKey:] + 184
13 iPadMosaic 0x00003282 -[iPadMosaicViewController getAlbumThumbs] (iPadMosaicViewController.m:468)
14 Foundation 0x000728fe __NSFireDelayedPerform + 314
15 CoreFoundation 0x00022d1c CFRunLoopRunSpecific + 2092
16 CoreFoundation 0x000224da CFRunLoopRunInMode + 42
17 GraphicsServices 0x000030d4 GSEventRunModal + 108
18 GraphicsServices 0x00003180 GSEventRun + 56
19 UIKit 0x000034c2 -[UIApplication _run] + 374
20 UIKit 0x000019ec UIApplicationMain + 636
21 iPadMosaic 0x00002234 main (main.m:14)
22 iPadMosaic 0x00002204 start + 32
Je crois comprendre que je bâcle l'ajout du dictionnaire d'une manière ou d'une autre. Les lignes de code concernées sont les suivantes :
for (NSDictionary *album in self.albumList) {
// Get image for each album cover
UIImage *albumCover;
// Loop through photos to get URL of cover based on photo ID match
NSString *coverURL = @"";
for (NSDictionary *photo in self.photoList) {
if ([[photo objectForKey:@"pid"] isEqualToString:[album objectForKey:@"cover_pid"]]) {
coverURL = [photo objectForKey:@"src"];
}
}
NSURL *albumCoverURL = [NSURL URLWithString:coverURL];
NSData *albumCoverData = [NSData dataWithContentsOfURL:albumCoverURL];
albumCover = [UIImage imageWithData:albumCoverData];
if (albumCover == nil || albumCover == NULL) {
//NSLog(@"No album cover for some reason");
albumCover = [UIImage imageNamed:@"noImage.png"];
}
[[self.albumList objectAtIndex:albumCurrent] setObject:albumCover forKey:@"coverThumb"];
}
Il s'agit d'une partie d'une boucle qui passe en revue les dictionnaires existants stockés dans un tableau. Si la récupération de la pochette d'album échoue pour une raison quelconque, l'objet est rempli avec une image par défaut, puis ajouté. La dernière ligne du code est ce qui apparaît dans le journal d'erreur.
Il fonctionne bien dans le simulateur mais se plante à 100% lors des tests sur le dispositif apparemment. Quelqu'un peut-il me dire ce qui m'échappe ?