How correctly to use my class in main.m? Project - Cocoa Application.
Class:
I want that method InitForm was processed at start of the project(application).
Thanks...
Class:
Code:
// "InitFormApp.h"
#import <Cocoa/Cocoa.h>
@interface InitFormApp : NSObject {
IBOutlet NSTextField *textfield;
IBOutlet NSImageView *image;
}
-(id)InitForm;
@end
Code:
// "InitFormApp.m"
#import "InitFormApp.h"
@implementation InitFormApp
-(id)InitForm
{
[super init];
[image setImage:[NSImage imageNamed:@"apple_big.jpg"]];
[textfield setStringValue:[NSString stringWithFormat:@"User %@", NSUserName()]];
return self;
}
@end
Code:
// "main.m"
#import <Cocoa/Cocoa.h>
#import "InitFormApp.h"
int main(int argc, char *argv[])
{
InitFormApp *initus = [InitFormApp InitForm]; // [COLOR="Red"]How it is correct????[/COLOR]
return NSApplicationMain(argc, (const char **) argv);
}
I want that method InitForm was processed at start of the project(application).
Thanks...