I think the solution is here .. I used this method in one of my applications here lbltext is the object of my shortcut. this method creates a new image with the given text and returns the object of the new image with text.
-(UIImage *) drawText:(NSString*) text inImage:(UIImage*)image atPoint:(CGPoint)point
{
UIFont *font = lblText.font;
UIGraphicsBeginImageContext(iv.frame.size);
[image drawInRect:CGRectMake(0,0,iv.frame.size.width,iv.frame.size.height)];
CGRect rect = CGRectMake(point.x,point.y,lblText.frame.size.width, lblText.frame.size.height);
[lblText.textColor set];
[text drawInRect:CGRectIntegral(rect) withFont:font];
UIImage *newImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return newImage;
}
iv.center .. ,
CGPoint point;
point.x=30;
point.y=40;
...
UIImage *img = [self drawText:@"Test String" inImage:originalImage atPoint:point];
, img - UIImage ... img imager .
...
[newimageviewObj setImage:img]
,