NSDate *now = [NSDate date];
NSCalendar *gregorian = [[NSCalendar alloc]
initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *nowComponents = [gregorian components:NSYearCalendarUnit fromDate:now];
NSDateComponents *xmasComponents = [[NSDateComponents alloc] init];
[xmasComponents setDay:25];
[xmasComponents setMonth:12];
[xmasComponents setYear:[nowComponents year]];
NSDate *xmas = [gregorian dateFromComponents:xmasComponents];
int ttx = (int) ([xmas timeIntervalSinceDate:now] / (24 * 60 * 60)) + 1;
NSLog(@"%d", ttx);
[xmasComponents release];
[gregorian release];
segunda-feira, abril 20, 2009
segunda-feira, fevereiro 23, 2009
sexta-feira, fevereiro 13, 2009
iPhone: no Google "My Maps"?
The iPhone maps application won't access your personal maps, those markers that you put on maps (the "My Maps") when using Google Maps on your desktop computer.
I didn't notice the omission until I planned a week-end trip putting markers on a map. And then? I realised I was stuck. After googling a bit, I realised the feature wasn't there. After googling a bit more, I realised that some bit and pieces were in place... Hence I made my own service to access my maps on the iPhone.
Visit http://my-maps.appspot.com/ to get details.
Note that Google is not providing public APIs to access this information, and as such they might consider this usage to be abusive, in which case I will have to redraw this service.
I didn't notice the omission until I planned a week-end trip putting markers on a map. And then? I realised I was stuck. After googling a bit, I realised the feature wasn't there. After googling a bit more, I realised that some bit and pieces were in place... Hence I made my own service to access my maps on the iPhone.
Visit http://my-maps.appspot.com/ to get details.
Note that Google is not providing public APIs to access this information, and as such they might consider this usage to be abusive, in which case I will have to redraw this service.
Subscrever:
Mensagens (Atom)