This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DOCUMENTATION_DIR="Documentation" | |
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${BUILD_ROOT}/${INFOPLIST_PATH}") | |
# DOCUMENTATION_FOLDER_PATH | |
if [ -e /usr/local/bin/appledoc ] ; then | |
/usr/local/bin/appledoc --project-name $PRODUCT_NAME --output $DOCUMENTATION_DIR --logformat xcode --exit-threshold 2 --docset-bundle-filename "$BUNDLE_ID.$PRODUCT_NAME.docset" . | |
else | |
echo "AppleDoc is not installed in /usr/local/bin , you can download it from https://github.com/tomaz/appledoc" | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This can be inserted as a Run Script build phase or a Build Rule in your Xcode project. | |
# You can set this to whatever you like. | |
DOCUMENTATION_DIR="Documentation" | |
BUNDLE_ID=$(/usr/libexec/PlistBuddy -c "Print :CFBundleIdentifier" "${BUILD_ROOT}/${INFOPLIST_PATH}") | |
# DOCUMENTATION_FOLDER_PATH | |
if [ -e /usr/local/bin/appledoc ] ; then | |
/usr/local/bin/appledoc --project-name $PRODUCT_NAME --output $DOCUMENTATION_DIR --logformat xcode --exit-threshold 2 --verbose xcode --docset-bundle-filename "$BUNDLE_ID.$PRODUCT_NAME.docset" . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CALayer *layer = [view layer]; | |
layer.shouldRasterize = YES; | |
layer.rasterizationScale = [[UIScreen mainScreen] scale]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec osascript <<EOF | |
set location to system attribute "OBJECT_FILE_DIR_normal" | |
tell app "CoverStory" | |
activate | |
set var to location | |
open var | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec osascript <<EOF | |
set objects_normal to system attribute "OBJECT_FILE_DIR_normal" | |
tell app "CoverStory" | |
activate | |
open (objects_normal as text) & "/i386" | |
end tell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
exec osascript <<EOF | |
set objects_normal to system attribute "OBJECT_FILE_DIR_normal" | |
set fp to objects_normal & "/i386" | |
set posix_path to POSIX file fp | |
set appExists to false | |
tell application "Finder" | |
try | |
exists application file id "com.google.CoverStory" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSDictionary *relationshipMap = [[fetchRequest entity] relationshipsByName]; | |
NSArray *relationshipKeyPaths = [relationshipMap allKeys]; | |
[fetchRequest setRelationshipKeyPathsForPrefetching:relationshipKeyPaths]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Add two methods to handle the notification. You want to create and add a new store when the old one has been removed. | |
- (void) didChangePersistentStores:(id)notification { | |
NSArray *addedStores = nil; | |
NSArray *removedStores = nil; | |
NSArray *uuidChangedStores = nil; | |
addedStores = [[notification userInfo] valueForKey:NSAddedPersistentStoresKey]; | |
removedStores = [[notification userInfo] valueForKey:NSRemovedPersistentStoresKey]; | |
uuidChangedStores = [[notification userInfo] valueForKey:NSUUIDChangedPersistentStoresKey]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void) recursiveSave:(NSManagedObjectContext *)context { | |
NSError *error = nil; | |
[context performBlock:{ | |
if (![context save:&error]){ | |
[self errorHandler:error]; | |
} else { | |
[self recursiveSave:[context parentContext]]; | |
} | |
}]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// in the initializer, or viewWillAppear,etc: | |
[self addObserver:self forKeyPath:keyPath options:options context:(__bridge void*)self]; | |
// in dealloc, or viewDidDisappear, etc: | |
[self removeObserver:self forKeyPath:keyPath context:(__bridge void*)self]; | |
- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id) object change: (NSDictionary *) change context: (void *) context { | |
if ((__bridge id)context == self){ |
OlderNewer