Skip to content

Instantly share code, notes, and snippets.

View adriantofan's full-sized avatar

Adrian Tofan adriantofan

View GitHub Profile
@adriantofan
adriantofan / outputStreamToFileAtPathDemo.m
Last active August 29, 2015 14:26 — forked from mingchen/outputStreamToFileAtPathDemo.m
How to use NSOutputStream's outputStreamToFileAtPath
- (void)outputStreamToFileAtPathDemo
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *file = [documentsDirectory stringByAppendingPathComponent:@"foo.dat"];
NSLog(@"file: %@", file);
NSOutputStream *output = [NSOutputStream outputStreamToFileAtPath:file append:NO];
[output open];
@adriantofan
adriantofan / version.sh
Last active August 29, 2015 14:23 — forked from osteslag/version.sh
#!/bin/sh
# Script for managing build and version numbers using git and agvtool.
# Change log:
# v1.0 18-Jul-11 First public release.
# v1.1 29-Sep-12 Launch git, agvtool via xcrun.
version() {