This file contains 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
NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; | |
[formatter setDateFormat:@"yyyy"]; | |
//Optionally for time zone converstions | |
[formatter setTimeZone:[NSTimeZone timeZoneWithName:@"..."]]; | |
NSString *stringFromDate = [formatter stringFromDate:myNSDateInstance]; |
This file contains 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
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
UIBarButtonItem *btnSettings = [[UIBarButtonItem alloc] initWithTitle:@"Settings" | |
style:UIBarButtonItemStylePlain target:self action:@selector(displaySettings:)]; | |
self.navigationItem.rightBarButtonItem = btnSettings; | |
[btnSettings release]; | |
} |
This file contains 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 *longURL = @"http://mugunthkumar.com" | |
NSString *baseURLString = | |
@"http://api.bit.ly/shorten?version=2.0.1&longUrl=%@&login=bitlyapidemo&apiKey="; | |
NSString *urlString = [[NSString alloc] initWithFormat:@"%@%@", | |
baseURLString, longURL]; | |
NSURL *url = [[NSURL alloc] initWithString:urlString]; | |
NSString *result = [[NSString alloc] initWithContentsOfURL:url]; | |
NSLog(result); | |
[url release]; | |
[urlString release]; |
This file contains 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 goals.select{|g| g.status != 'awaiting' && g.open }.length > 0 | |
logic | |
end |
NewerOlder