This is the most common way to get the path to the selected instance:
xcrun xcode-select --print-path| // | |
| // NSDate+Utilities.h | |
| // | |
| // Created by PEDRO MUÑOZ CABRERA on 15/03/13. | |
| // Copyright (c) 2013. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> | |
| @interface NSDate (Utilities) |
| - (UIImage *)negativeImage:(UIImage *)img | |
| { | |
| // get width and height as integers, since we'll be using them as | |
| // array subscripts, etc, and this'll save a whole lot of casting | |
| CGImageRef imageRef = [img CGImage]; | |
| int widthI = CGImageGetWidth(imageRef); | |
| int heightI = CGImageGetHeight(imageRef); | |
| // Create a suitable RGB+alpha bitmap context in BGRA colour space |
| - (UIImage *)convertToGrayscale:(UIImage*)img { | |
| CGImageRef imageRef = [img CGImage]; | |
| int widthI = CGImageGetWidth(imageRef); | |
| int heightI = CGImageGetHeight(imageRef); | |
| // the pixels will be painted to this array | |
| uint32_t *pixels = (uint32_t *) malloc(widthI * heightI * sizeof(uint32_t)); | |
| // clear the pixels so any transparency is preserved |
| #import <Foundation/Foundation.h> | |
| @interface NSObject (NSDictionaryRepresentation) | |
| /** | |
| Returns an NSDictionary containing the properties of an object that are not nil. | |
| */ | |
| - (NSDictionary *)dictionaryRepresentation; | |
| @end |