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