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
Matchmaking.gameNear = function(user, location, callback) { | |
console.log('[DEBUG] [gameNear]'); | |
Q.fcall(this.updateUserLocation.bind(this,user,location)) // TODO: why do we have to pass 'this' first in bind() params? | |
.then(this.findGamesNearby.bind(this,user,location)) | |
.then(function(games_nearby) { | |
foo(games_nearby); | |
}).done(); | |
}; |
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
// TODO: Use weak self to avoid retaining self for a long time (during long downloads) | |
SDWebImageManager *manager = [SDWebImageManager sharedManager]; | |
[manager downloadWithURL:imageURL | |
options:0 | |
progress:nil | |
completed:^(UIImage *image, NSError *error, SDImageCacheType cacheType, BOOL finished) | |
{ | |
if ( [self.imageURL isEqual:imageURL] && | |
image && | |
!error ) |
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
/////// .h /////// | |
// Core Data MOM file: http://grab.by/jf4c | |
// NOTE: Some attributes excluded in the code below | |
@interface CDUserPhotos : NSManagedObject | |
@property (nonatomic, retain) NSData * data; // core data attribute | |
@property (nonatomic, readonly) NSArray* albums; // not an attribute. Calculate from self.data |
NewerOlder