嗨,我只想知道這是否正確,我們可以檢查零這種方式 - if(self.spinner==nil)
?是否檢查零值這種方式是正確的?
感謝
if (self.spinner == nil) {
self.spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
//.............needs work.............
CGRect center = [self.view bounds];
CGSize winCenter = center.size;
CGPoint pont = CGPointMake(winCenter.width/2,winCenter.height/2);
//CGPoint pont = CGPointMake(10,40);
[spinner setCenter:pont];
[self.view addSubview:spinner];
[self.spinner startAnimating];
} else {
[self.spinner startAnimating];
}