Skip to content

Instantly share code, notes, and snippets.

View vibrazy's full-sized avatar

Daniel Hollis Tavares vibrazy

View GitHub Profile
@vibrazy
vibrazy / NSPredicateWithBlock
Created February 8, 2012 09:29
NSPredicate With Block
BOOL proVersion = YES;
if (proVersion) {
return;
}
//create predicate and filter the results
NSPredicate *freePredicate = [NSPredicate predicateWithBlock:^BOOL(id evaluatedObject, NSDictionary *binding) {
InAppGame *game = (InAppGame *)evaluatedObject;
return game.isFree;
}];
@vibrazy
vibrazy / unusedImages.sh
Created January 23, 2012 10:50
How to find unused images in an XCode project?
#!/bin/sh
# -------
# Usage sh unusedImages.sh (jpg|png|gif)
# -------
# Caveat
# 1 -
# NSString *imageName = [NSString stringWithFormat:@"image_%d.png", 1];
# This script would incorrectly list these images as unreferenced. For example, you might have
# This script will incorrectly think image_1.png is unreferenced.
# 2 - If you have a method, or variable with the same name as the image it won't pick it up