//帮助页面
- (void)setupHelpview{
__block UIImageView *helpImageView = (UIImageView *)[self.view viewWithTag:kHelpViewTag];
if (!helpImageView) {
UIImage *helpImage = [UIImage imageNamed:@"detail_help.png"];
UIImageView *helpView = [[[UIImageView alloc]initWithImage:helpImage ] autorelease];
helpView.center = self.view.center;
helpView.center = CGPointMake(helpView.center.x *3, helpView.center.y);
helpView.tag = kHelpViewTag;
[self.view insertSubview:helpView belowSubview:self.headerView];
[UIView animateWithDuration:0.5 animations:^{
self.pageVC.view.center = CGPointMake(self.pageVC.view.center.x - self.pageVC.view.frame.size.width, self.pageVC.view.center.y);
helpView.center = CGPointMake(helpView.center.x/3, helpView.center.y);
} completion:^(BOOL finished){
}];
}else{
[UIView animateWithDuration:0.5 animations:^{
self.pageVC.view.center = CGPointMake( self.pageVC.view.center.x + self.pageVC.view.frame.size.width, self.pageVC.view.center.y);
helpImageView.center = CGPointMake(helpImageView.center.x *3, helpImageView.center.y);
} completion:^(BOOL finished){
[helpImageView removeFromSuperview];
helpImageView = nil;
}];
}
}
像这样定义
------解决方案--------------------
http://developer.apple.com/library/ios/#documentation/cocoa/Conceptual/Blocks/Articles/00_Introduction.html
文档说明很详细
------解决方案--------------------
记得是表示一段代码可以放进去的。