Skip to content

Instantly share code, notes, and snippets.

View alaeddineG's full-sized avatar

Alaeddine Gallas alaeddineG

  • Self employed
  • Montreal
View GitHub Profile
- (NSString*) postedSince {
NSInteger days = self.age.integerValue / (60 * 60 * 24);
NSInteger second = self.age.integerValue % (60 * 60 * 24);
NSInteger hours = second / (60 * 60);
NSInteger minute = (second % (60 * 60)) / 60;
NSMutableString* postedSince = [NSMutableString new];
if(self.age.integerValue < 60){
return [NSString stringWithFormat:@"%ld s", (long)self.age.integerValue];
- (BOOL)handleMessage:(Connection *)connection data:(NSData *)data onTopic:(NSString *)topic retained:(BOOL)retained {
DDLogVerbose(@"handleMessage");
if (![[OwnTracking sharedInstance] processMessage:topic data:data retained:retained context:self.queueManagedObjectContext]) {
return false;
}
NSArray *baseComponents = [[Settings theGeneralTopic] componentsSeparatedByString:@"/"];
NSArray *topicComponents = [[Settings theGeneralTopic] componentsSeparatedByString:@"/"];