I am trying to add a LOADING SPINNER animation in iOS.
I added SpinnerView.h
#import <UIKit/UIKit.h>
@interface SpinnerView : UIView {
}
+(SpinnerView *)loadSpinnerIntoView:(UIView *)superView;
-(void)removeSpinner;
@end
Then I added SpinnerView.m
#import "SpinnerView.h"
@implementation SpinnerView
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code.
}
return self;
}
- (void)dealloc
{
[super dealloc];
}
+(SpinnerView *)loadSpinnerIntoView:(UIView *)superView
{
SpinnerView *spinnerView = [[[SpinnerView alloc] initWithFrame:superView.bounds] autorelease];
if(!spinnerView){ return nil; }
spinnerView.backgroundColor = [UIColor blackColor];
[superView addSubview:spinnerView];
return spinnerView;
}
-(void)removeSpinner
{
[super removeFromSuperview];
}
@end
in Template.cpp I call the Spinner...
SpinnerView * spinner = [SpinnerView loadSpinnerIntoView:
self.view];
However self.view is not working. I think that I need to put the AppGameKit UIview there.
Any help or ideas?
Thanks