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 <QuartzCore/QuartzCore.h> | |
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
splashView.image = [UIImage imageNamed:@"Default.png"]; | |
[self.window addSubview:splashView]; | |
[self.window bringSubviewToFront:splashView]; | |
splashView.layer.anchorPoint=CGPointMake(0, .5); | |
splashView.center = CGPointMake(splashView.center.x - splashView.bounds.size.width/2.0f, splashView.center.y); | |
[UIView beginAnimations:nil context:nil]; |
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 application:didFinishLaunchingWithOptions: in app delegate | |
// before [window makeKeyAndVisible]; | |
UIImageView *splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
splashView.image = [UIImage imageNamed:@"background.png"]; | |
// after [window makeKeyAndVisible]; | |
splashView = [[UIImageView alloc] initWithFrame:CGRectMake(0,0, 320, 480)]; | |
splashView.image = [UIImage imageNamed:@"Default.png"]; | |
[window addSubview:splashView]; |
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
// App specific Logging | |
#ifdef DEBUG_P | |
#define PLog(fmt, ...) NSLog((@"%s:%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); | |
#else | |
#define PLog(fmt, ...) // stubbed out | |
#endif | |
// Library specific Logging | |
#ifdef DEBUG_L | |
#define LLog(fmt, ...) NSLog((@"%s:%d " fmt), __PRETTY_FUNCTION__, __LINE__, ##__VA_ARGS__); |
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
.DS_Store | |
*.mode1 | |
*.mode1v3 | |
*.mode2v3 | |
*.perspective | |
*.perspectivev3 | |
*.pbxuser | |
xcuserdata/ |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
self.filename = @"file.ext"; | |
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentDir = [documentPaths objectAtIndex:0]; | |
self.filePath = [documentDir stringByAppendingPathComponent:self.filename]; | |
[self createAndCheckDatabase]; |
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
#define DEFINE_ABSTRACT_METHOD(returnType, name)\ | |
- (returnType)name {\ | |
@throw [NSException exceptionWithName:NSInternalInconsistencyException\ | |
reason:[NSString stringWithFormat:@"You must override %@ in a subclass", NSStringFromSelector(_cmd)]\ | |
userInfo:nil];\ | |
} | |
// usage |
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
export PATH=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:$PATH |
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
- (NSString*)jsonStructureFromManagedObjects:(NSArray*)managedObjects; | |
- (NSArray*)managedObjectsFromJSONStructure:(NSString*)json withManagedObjectContext:(NSManagedObjectContext*)moc; | |
- (NSDictionary*)dataStructureFromManagedObject:(NSManagedObject*)managedObject | |
{ | |
NSDictionary *attributesByName = [[managedObject entity] attributesByName]; | |
NSDictionary *relationshipsByName = [[managedObject entity] relationshipsByName]; | |
NSMutableDictionary *valuesDictionary = [[managedObject dictionaryWithValuesForKeys:[attributesByName allKeys]] mutableCopy]; | |
[valuesDictionary setObject:[[managedObject entity] name] forKey:@"ManagedObjectName"]; | |
for (NSString *relationshipName in [relationshipsByName allKeys]) { |
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
#if __has_feature(objc_arc) | |
#else | |
- (void)dealloc | |
{ | |
[super dealloc]; | |
} | |
#endif |
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
@implementation MySharedThing | |
+ (id)sharedInstance | |
{ | |
DEFINE_SHARED_INSTANCE_USING_BLOCK(^{ | |
return [[self alloc] init]; | |
}); | |
} | |
@end |
OlderNewer