You can do one thing..
this is .h file------>
#import <UIKit/UIKit.h>
#define fontRegular @"Helvetica Neue"
#define fontBold @"HelveticaNeue-Bold"
@interface ABCViewController : UIViewController <UITextFieldDelegate>
{
NSString *strReturn;
}
@property(nonatomic,retain)NSString *strReturn;
@end
this is .m file--->
#import "ABCViewController.h"
@implementation ABCViewController
@synthesize strReturn;
-(void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
UITextField *txt_Fields= [[UITextField alloc]initWithFrame:CGRectMake(30, 0, 230, 44)];
txt_Fields.backgroundColor= [UIColor clearColor];
txt_Fields.delegate= self;
txt_Fields.clearButtonMode=YES;
txt_Fields.contentVerticalAlignment = UIControlContentVerticalAlignmentCenter;
[txt_Fields setFont:[UIFont fontWithName:fontRegular size:20.0]];
[txt_Fields setTextColor:[UIColor colorWithRed:105.0/255 green:105.0/255 blue:105.0/255 alpha:1.0]];
txt_Fields.borderStyle=UITextBorderStyleBezel;
txt_Fields.returnKeyType = UIReturnKeyDone;
txt_Fields.keyboardType=UIKeyboardTypeURL;
txt_Fields.autocapitalizationType = UITextAutocapitalizationTypeNone;
[self.view addSubview:txt_Fields];
[txt_Fields release];
}
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
{
self.strReturn=[NSString stringWithFormat:@"%@%@",strReturn,string];
textField.text=[NSString stringWithFormat:@"%@*",textField.text];
NSLog(@"str:- %@",self.strReturn);
return NO;
}
Note:-
But In this case you will have to maintain string manually, Means You will have to store the string in a string variable, you can not take textfield.text, because it will return - "****". And you will have to manage so many things manuaaly....