Hi, For making UITextField’s text selected programmatically you need to set the UITextField’s delegate linke below : txt.delegate = self; and then put following code in textFieldDidBeginEditing -(void)textFieldDidBeginEditing:(UITextField *)textField { [textField selectAll:self]; } And don’t forget to add delegate in .h @interface ViewController : UIViewController...
Memory Management in iPhone applications
Hi, Recently, I came to an issue of memory leakage while developing an application. And that was the frustrating experience. And it taught a big lesson. Every time I was running application on device, it was crashing the app after some memory warning. It was the indication that my application was utilizing lot of memory. In my code, I had allocated lot of arrays but had not released them after...
How to resize image programmatically in iPhone
Hello friends, many times we need to resize the UIImage runtime according to the need of application. Here is the function which changes the size of the image and returns a new resized image – (UIImage *)reSizeTheImage:(UIImage *)image convertToSize:(CGSize)size { UIGraphicsBeginImageContext(size); [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; UIImage *destImage =...