I have this Alert:
There is no internet connection available, please try again.`
and I have to many code blocks that can produce this message and I want to put the UIAlertView
in one class that I would not create it everytime, is that possible?
h file for ActionGeneric class
#import <Foundation/Foundation.h>
@interface ActionGeneric : NSObject {
}
+(void)showAlert;
@end
m file
#import "ActionGeneric.h"
@implementation ActionGeneric
+(void)showAlert{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:NSLocalizedString(@"haveInternetConnection",@"")
message:@""
delegate:nil
cancelButtonTitle:NSLocalizedString(@"kOk",@"")
otherButtonTitles:nil];
[alert show];
[alert release];
}
@end
Then you just import action generic and call it
[ActionGeneric showAllert];
You should look at Learning Objective-C