Resizing the imageView in objective-c

 if (img) {

                NSLog(@”iPhone Standard Resolution”);

                CGSize size=CGSizeMake(250, 108);


                [img drawInRect:CGRectMake(0,0,size.width,size.height)];

                UIImage* newImage = UIGraphicsGetImageFromCurrentImageContext();


                // [backgroundImage removeFromSuperview];

                [detailImage setImage:newImage];



Singleton class in Objective c

The use of singleton class is used to reuse the stuff which is declared in the single ton class.with the help of a singleton class the object for a class created only one and can be used through out the project.

Here is the syntax for singleton class..

the string can be accessed by

labl.text=[[SingleTonClass singleTonMethodObj]singletonClassString];

static SingleTonClass *singleTonMethodObj=nil;
if (!singleTonMethodObj) {
singleTonMethodObj=[[super allocWithZone:nil]init];
return singleTonMethodObj;

+(id)allocWithZone:(NSZone *)zone

return [self singleTonMethodObj];

self= [super init];
singletonClassString=@”Hii am from singleTon Class”;

return self;





The string declared here is the singletonClassString   can be used in all other classes by using the following syntax

[[SingleTonClass singleTonMethodObj]singletonClassString];