Hi everyone! ...
First of all!: i'm a fu$%ing newbie!
I'm trying to use a Function called
"PrintingText" declared on a personal class called
MyMethods, inside my ViewController Method. Simple: Click a button and say "This is the text" in my TextField. But when I clicked the button, my TextField doesn't show anything! ... Please, help me:
This is the code:
MyMethods.h //#import <Foundation/Foundation.h>
#import "testViewController.h"
@interface MyMethods : testViewController {
}
-(void) PrintingText: (id)source;
@end
MyMethods.m //#import "MyMethods.h"
@implementation MyMethods
-(void) PrintingText: (id)source{
NSString * finalText = (NSString *) source;
[sourceText setText:finalText];
}
@end
testViewController.h //#import <UIKit/UIKit.h>
@interface testViewController : UIViewController {
IBOutlet UITextField * sourceText;
}
@property(nonatomic,retain) IBOutlet UITextField * sourceText;
-(IBAction) okDoIt;
@end
testViewController.m //#import "testViewController.h"
#import "MyMethods.h"
@implementation testViewController
@synthesize sourceText;
-(IBAction) okDoIt{
MyMethods * Method = [[MyMethods alloc] init];
NSString * origin = [[NSString alloc] initWithFormat:@"This is the text"];
[Method PrintingText:origin];
[Method release];
[origin release];
}
@end
All connections are well done and tested in IB.
That's all falks! ...
& sorry for my english!!
Please, help this newbie!!!
