i am trying to get UIImage representation of UIView
it used to work in 3.0 in 4.0 i get a warning no renderInContext method found and the image is nil
why so ? what's the work around ?
but when i ctrl dblclick the function i go into CALayer.h
i have added coregraphics and fundation and quartzcore frameworks
regards
Code:
UIView *viewForImage = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 50, 50)];
[viewForImage setBackgroundColor:color];
UIGraphicsBeginImageContext(viewForImage.bounds.size);
[viewForImage.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[viewForImage release];
return viewImage;
it used to work in 3.0 in 4.0 i get a warning no renderInContext method found and the image is nil
why so ? what's the work around ?
but when i ctrl dblclick the function i go into CALayer.h
i have added coregraphics and fundation and quartzcore frameworks
regards