iPhone Tutorials

iPhone Tutorials
June 26, 2011 Oskar



Soon I will post some tutorials of some recent iPhone apps I’ve put together.

static WordCheatEngine *sharedEngine = nil;

#pragma mark Singleton Methods
+ (id)getEngine {
    @synchronized(self) {
        if(sharedEngine == nil)
            sharedEngine = [[super allocWithZone:NULL] init];
    }
    return sharedEngine;
}
+ (id)allocWithZone:(NSZone *)zone {
    return [self getEngine];
}
- (id)copyWithZone:(NSZone *)zone {
    return self;
}
- (NSComparisonResult)compare:(WordFeudString *)otherObject {
    if (self.point > otherObject.point) {
        
        return (NSComparisonResult)NSOrderedAscending;

    }
    
    if (self.point < otherObject.point) {
        return (NSComparisonResult)NSOrderedDescending;

        
    }
    
    return (NSComparisonResult)NSOrderedSame;
}

Comments are disabled. Please continue the discussion in the Forum.
Showing legacy comments below.

5 Comments