- (void) removeSlideshowImages:(id)sender;
{
NSMutableArray *xmlPhotoTitles = [[NSMutableArray alloc] initWithObjects:
@"000001.jpg", @"000002.jpg", @"000003.jpg", @"000004.jpg", @"000005.jpg", nil];
[iPhoto activate];
SBElementArray *albums = [iPhoto albums];
iPhotoAlbum *slideshowAlbum = [albums objectWithName:@"Jury66_Proj1 Slideshow"];
[slideshowAlbum select];
SBElementArray *albumPhotos = [slideshowAlbum photos];
for (NSString *photoTitle in xmlPhotoTitles) {
iPhotoPhoto *photo = (iPhotoPhoto *)[albumPhotos objectWithName:photoTitle];
[photo select];
[photo removeFrom:albumPhotos];
}
[xmlPhotoTitles release];
}
It almost looks like removing the image causes references to be shuffled around, causing the program to dereference a non-existent object.