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)initialize { | |
| // Update the preferences location from the old location (which is now used for the App Store) | |
| NSDictionary *retailUserDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:[NSApp applicationIdentifier]]; | |
| if (retailUserDefaults == nil) { | |
| NSDictionary *macAppStoreUserDefaults = [[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.thecocoabots.hyperspaces"]; | |
| for (NSString *key in [macAppStoreUserDefaults allKeys]) { | |
| [[NSUserDefaults standardUserDefaults] setObject:[macAppStoreUserDefaults objectForKey:key] forKey:key]; | |
| } |
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
| SomeClass *someObj = nil; | |
| // This is a rude and nasty hack. Basically if someObj is nil, just keep checking until you get it. | |
| while (someObj == nil) { | |
| someObj = [AppDelegate sharedAppDelegate].somethingIWantFromSystemEvents; | |
| if (someObj == nil) { | |
| CBLog(@"Could not get a hold of the thing I wanted from System Events.app. Sleeping for 2 seconds before trying again."); | |
| sleep(2); | |
| } |
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
| Project Folder: | |
| AppName | |
| → Classes | |
| → MyGreatClass.m | |
| → MyGreatClass.h | |
| → … | |
| → Model |
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
| KEYWORDS="TODO:|FIXME:|\?\?\?:|\!\!\!:" | |
| find "${SRCROOT}" \( -path "${SRCROOT}/Vendor" -or -path "${SRCROOT}/.git" \) -prune -o \( -name "*.h" -or -name "*.m" \) -print0 | xargs -0 egrep --with-filename --line-number --only-matching "($KEYWORDS).*\$" | perl -p -e "s/($KEYWORDS)/ warning: \$1/" |
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
| #import "NASpinSegue.h" | |
| @implementation NASpinSegue | |
| - (void)perform{ | |
| UIViewController *sourceViewController = (UIViewController *)self.sourceViewController; | |
| UIViewController *destinationViewController = (UIViewController *)self.destinationViewController; | |
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
| static inline BOOL CBIsEmpty(id obj) { | |
| return obj == nil | |
| || (NSNull *)obj == [NSNull null] | |
| || ([obj respondsToSelector:@selector(length)] && [obj length] == 0) | |
| || ([obj respondsToSelector:@selector(count)] && [obj count] == 0); | |
| } |
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)dwk_postChangeNotification:(NSString *)notificationName newValue:(id)newValue oldValue:(id)oldValue | |
| { | |
| if (CBIsEmpty(newValue) || CBIsEmpty([self fileModificationDate])) { | |
| return; | |
| } | |
| NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity:2]; | |
| [userInfo setObject:newValue forKey:kNotificationOldValueKey]; | |
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
| #import <UIKit/UIKit.h> | |
| #import "ViewController.h" | |
| @interface Peekaboo : UIView | |
| @property (nonatomic, retain) ViewController *parentView; | |
| - (void) show; | |
| @end |
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
| ROFL:ROFL:LOL:ROFL:ROFL | |
| ______ / \______ | |
| L / \ | |
| L O L====== \__ | |
| L \________________________| | |
| H H | |
| /==============/ |
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
| // | |
| // NSScreen+CBAdditions.h | |
| // Hyperspaces | |
| // | |
| // Created by Tony Arnold on 2/11/10. | |
| // Copyright 2010 The CocoaBots. All rights reserved. | |
| // | |
| #import <Cocoa/Cocoa.h> |