I have this class
loader.h
#import <Foundation/Foundation.h>
@class Reachability;
@interface loader : NSObject {
}
- (void)startLoading;
@end
loader.m
#import "loader.h"
#import "Reachability.h"
@implementation loader
- (void)startLoading{
NSLog(@"Check network");
}
@end
Is the code bellow the correct way to include the above class and use it
in my .h file I put
@class loader;
and in the .m file
#import "loader.h"
and I use this code
- (void)viewDidLoad {
loader *myLoader = [loader alloc];
[myLoader startLoading];
[super viewDidLoad];
}
is this the correct way? to use a class??
I want loader class to be in change and check for internet connectivity and I try to start from somewhere :) thanks in advance :)