I am creating my own context using CGBitmapContextCreate call. The context is created successfully. I can draw an UIImage in this context using the call CGContextDrawImage successfully. But, when I try to use the call drawPatternInRect: of UIImage, it gives the error 'Context is nil'.
I am sure that context is not nil and it is created properly because, CGContextDrawImage is working fine in the same context. The drawPatternInRect: call works fine only when the context is of UIView OR if I create the context in drawRect method of UIView. But, I cannot use UIView's context since I need to generate UIImage out of this context.
Does anyone knows what is the problem here OR any other alternate simple method for drawPatternInRect?