Found a much easier way to do this:
You first need to create the delegate:
mydelegate.h:
#import <Foundation/Foundation.h>
@interface mydelegate : NSObject <UITextFieldDelegate>{}
- (void)textFieldDidEndEditing

UITextField *)textField;
@end
mydelegate.m:
#import "mydelegate.h"
@implementation mydelegate
- (void)textFieldDidEndEditing

UITextField *)textField
{
//do your stuff...
}
@end
Then, you need to create the class that extend the UITextField:
myTextField.h:
#import <UIKit/UIKit.h>
#import "mydelegate.h"
@interface myTextField : UITextField{}
@end
myTextField.m:
#import "myTextField.h"
@implementation myTextField
- (id)initWithFrame

CGRect)frame
{
self = [super initWithFrame:frame];
if (self)
{
//Set the delegates to catch events
self.delegate = [[mydelegate alloc] init];
}
return self;
}
@end
And this is how is done!!