2
我使用的一些代碼使用已棄用的方法dismissModalViewControllerAnimated
。該文檔說現在使用dismissViewControllerAnimated:completion:
。我不確定completion:
部分。在我的情況下應該完成nil
或NULL
還是什麼?使用dismissViewControllerAnimated:完成:
原始代碼如下。
- (void)didFinishWithCamera
{
[self dismissModalViewControllerAnimated:YES];
if ([self.capturedImages count] > 0)
{
if ([self.capturedImages count] == 1)
{
// we took a single shot
[self.imageView setImage:[self.capturedImages objectAtIndex:0]];
}
else
{
// we took multiple shots, use the list of images for animation
self.imageView.animationImages = self.capturedImages;
if (self.capturedImages.count > 0)
// we are done with the image list until next time
[self.capturedImages removeAllObjects];
self.imageView.animationDuration = 5.0; // show each captured photo for 5 seconds
self.imageView.animationRepeatCount = 0; // animate forever (show all photos)
[self.imageView startAnimating];
}
}
}
所以零不好嗎?我認爲沒有完成是好的。 – 2013-02-23 15:17:58
@WarrenP其實,'nil'看起來確定:http://stackoverflow.com/questions/12445190/dismissmodalviewcontrolleranimated-deprecated – trojanfoe 2013-02-23 15:20:33
在這種情況下,不發射空的完成將是可取的,並且零將永遠和無處不在更好。哦,少點標點符號。 – 2013-02-23 15:21:31