I'm trying to make use of FlowCover -> http://www.chaosinmotion.com/flowcover.m but it is not working.
This is my interface class:
#import <UIKit/UIKit.h>
#import "FlowCoverView.h"
@interface TesterCoverFlowViewController : UIViewController <FlowCoverViewDelegate> {
}
- (IBAction)done:(id)sender;
@end
This is my implementation class:
#import "TesterCoverFlowViewController.h"
@implementation TesterCoverFlowViewController
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return ((interfaceOrientation == UIInterfaceOrientationLandscapeLeft) ||
(interfaceOrientation == UIInterfaceOrientationLandscapeRight));
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
}
- (void)dealloc
{
[super dealloc];
}
- (IBAction)done:(id)sender
{
[[self parentViewController] dismissModalViewControllerAnimated:YES];
}
/************************************************************************/
/* */
/* FlowCover Callbacks */
/* */
/************************************************************************/
- (int)flowCoverNumberImages:(FlowCoverView *)view
{
return 64;
}
- (UIImage *)flowCover:(FlowCoverView *)view cover:(int)image
{
switch (image % 6) {
case 0:
default:
return [UIImage imageNamed:@"a.png"];
case 1:
return [UIImage imageNamed:@"b.png"];
case 2:
return [UIImage imageNamed:@"c.png"];
case 3:
return [UIImage imageNamed:@"x.png"];
case 4:
return [UIImage imageNam开发者_JAVA技巧ed:@"y.png"];
case 5:
return [UIImage imageNamed:@"z.png"];
}
}
- (void)flowCover:(FlowCoverView *)view didSelect:(int)image
{
NSLog(@"Selected Index %d",image);
}
@end
Most of the code is taken from the site.
Do I need to do anything to the interface? Because nothing appears! no errors, I just don't see any coverflow (or flowcover).
Thanks
If you are not seeing any errors than it is more than likely a missing delegate or the view is not being presented.
Are you showing that UIViewController
with something like presentModalViewController
?
Did you assign the TesterCoverFlowViewController
class as the delegate of the FlowCoverView
?
精彩评论