ios - CGBitmapContextCreate returns NULL -
under circumstances cgbitmapcontext fail allocate? have table view, , has multiple view options. user can see small table cell previews, 1 larger preview per line, or 2 side side previews per line. first 2 render fine, third 1 fails. there no error messages cgbitmapcontextcreate, errors after when try use (i.e. invalid context 0x0).
cgcolorspaceref colorspace = cgcolorspacecreatedevicergb(); //size passed parameter cgcontextref c = cgbitmapcontextcreate(null, size.width, size.height, 8, size.width*4, colorspace, kcgimagealphanoneskiplast); cgcolorspacerelease(colorspace); i targeting ios 5.0, building 5.1. difference between working , non-working version non-working version attempts twice (size small, less 100x100). only right side has problem (i.e. second attempt). first attempt still works.
this can happen if size.width and/or size.height 0. put nslog check sizes every time call method see if that's case.
Comments
Post a Comment