Animation not working on iPad. same works on iphone
I've got a very simple project that tries to animate a UIView using block based iOS4.0 animation.
header
@interface animatepadViewController : UIViewController {
UIView *contentView;
}
@property(nonatomic, retain) IBOutlet UIView *contentView;
@end
implementation
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
[UIView animateWithDuration:1.0 animations:^{se开发者_运维百科lf.contentView.alpha = 0.0;}];
}
I've added a subview of type UIVIew in the interface builder with a background color of black.
these are the only change i've made from the default ipad "view" based project.
I get the following error
2010-12-28 17:59:05.689 animatepad[29835:207] *** +[UIView animateWithDuration:animations:]: unrecognized selector sent to class 0x217689c
this happens only on the ipad and NOT on the iPhone
thanks in advance
Have you updated your iPad to use iOS 4.2 yet? Blocks weren't available on the iPad's shipping version of iOS (3.2.)
To update the simulator, you will need to update Xcode to version 3.2.5.
精彩评论