voidasterisk.org
VoidAsterisk.org
http://www.voidasterisk.org/tagged/CGImage
How to show an CGImage into the screen. Here’s two of the ways to show an CGImage into the screen. The first is to use the proper UIImageView and UIImage objects:. CGImage cgImage = . / the CGImage to show. UIImageView *imageView = . / the UIView to show into. ImageView.image = [UIImage imageWithCGImage:cgImage];. The second one, faster it seems, is to load the image directly into the frame buffer:. CGImage cgImage = . / the CGImage to show. CALayer *layer = . / the CALayer to show into.
voidasterisk.org
How to enable HTTP GZip in NSURLConnection [VoidAsterisk.org]
http://www.voidasterisk.org/post/2871929495/how-to-enable-http-gzip-in-nsurlconnection
How to enable HTTP GZip in NSURLConnection. For reference, the Cocoa NSURLConnection library *does* support transparent GZIP response decompression by default. To enable it just set the corresponding HTTP header:. NSMutableURLRequest* req = [ NSMutableURLRequest alloc] init];. NSMutableDictionary* headers = [ NSMutableDictionary alloc] init];. Headers setObject:@"gzip, deflate" forKey:@"Accept-Encoding"];. Sun, July 31, 2011 0:00 UTC.
voidasterisk.org
VoidAsterisk.org
http://www.voidasterisk.org/tagged/iOS
How to register a custom URL scheme in iOS. Open the main plist file (project name-info.plist). Add a new row with key “URL types” (“CFBundleURLTypes”). Under “Item 0”, Add a new row “URL identifier” (“CFBundleURLName”) and add a unique identifier to it (e.g. domain appname like the row “Bundle identifier” (“CFBundleIdentifier”) “com.domain.${PRODUCT NAME:rfc1034identifier}”). Still under “Item 0”, add a new row “URL Schemes” (“CFBundleURLSchemes”). Sun, September 18, 2011 0:00 UTC. The first is to use t...
voidasterisk.org
How to measure time in nanoseconds [VoidAsterisk.org]
http://www.voidasterisk.org/post/4205886958/how-to-measure-time-in-nanoseconds
How to measure time in nanoseconds. For example, for simple profiling. Include mach/mach time.h. Mach timebase info data t timer;. Mach timebase info(&timer);. This returns the current time in nanos, but not in a perfectly human readable format - e.g. don't expect it to be number-of-nanos-since-1970 or something, like the unixtime. Uint64 t start time = mach absolute time();. Do something that takes time. Now calc the elapsed time. Uint64 t now = mach absolute time();. Int64 t elapsed = now - start time;.
voidasterisk.org
How to create a iOS static library and link via... [VoidAsterisk.org]
http://www.voidasterisk.org/post/4232502037/how-to-create-a-ios-static-library-and-link-via-xcode
How to create a iOS static library and link via XCode. Create a new project, select “Cocoa Touch Static Library”. Add your library code there, ensure it builds. Pick your public relevant .h files, right click on them and select “Set Role” - “Public”. On the real project, create a folder group called “Dependencies” (optional, just for organization purposes). On the XCode sidebar, open the “Targets”, “project name” so you can see the “Link Binary with Libraries” icon. On the “Header Search Path&rdquo...
voidasterisk.org
VoidAsterisk.org
http://www.voidasterisk.org/tagged/C
How to measure time in nanoseconds. For example, for simple profiling. Include mach/mach time.h. Mach timebase info data t timer;. Mach timebase info(&timer);. This returns the current time in nanos, but not in a perfectly human readable format - e.g. don't expect it to be number-of-nanos-since-1970 or something, like the unixtime. Uint64 t start time = mach absolute time();. Do something that takes time. Now calc the elapsed time. Uint64 t now = mach absolute time();. Int64 t elapsed = now - start time;.
voidasterisk.org
VoidAsterisk.org
http://www.voidasterisk.org/tagged/Note
How to enable HTTP GZip in NSURLConnection. For reference, the Cocoa NSURLConnection library *does* support transparent GZIP response decompression by default. To enable it just set the corresponding HTTP header:. NSMutableURLRequest* req = [ NSMutableURLRequest alloc] init];. NSMutableDictionary* headers = [ NSMutableDictionary alloc] init];. Headers setObject:@"gzip, deflate" forKey:@"Accept-Encoding"];. Sun, July 31, 2011 0:00 UTC. What is the screen size of each iThingy. Sun, July 3, 2011 12:00 UTC.
voidasterisk.org
How to show an CGImage into the screen [VoidAsterisk.org]
http://www.voidasterisk.org/post/4183028990/how-to-show-an-cgimage-into-the-screen
How to show an CGImage into the screen. Here’s two of the ways to show an CGImage into the screen. The first is to use the proper UIImageView and UIImage objects:. CGImage cgImage = . / the CGImage to show. UIImageView *imageView = . / the UIView to show into. ImageView.image = [UIImage imageWithCGImage:cgImage];. The second one, faster it seems, is to load the image directly into the frame buffer:. CGImage cgImage = . / the CGImage to show. CALayer *layer = . / the CALayer to show into.
voidasterisk.org
VoidAsterisk.org
http://www.voidasterisk.org/tagged/NSString
How to URLEncode a NSString. NSString *unencodedString = . / the string to encode. NSString *encodedString = (NSString *)CFURLCreateStringByAddingPercentEscapes(. Sun, August 21, 2011 0:00 UTC.
SOCIAL ENGAGEMENT