





- (void)awakeFromNib {
[super awakeFromNib];
// do my customization here.
}

[[UIApplication sharedApplication] setApplicationIconBadgeNumber:3];

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setInteger:polygonShape.numberOfSides forKey:@"numberOfSides"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
int numberOfSides = [defaults integerForKey:@"numberOfSides"];
if(numberOfSides!=0) {
polygonShape.numberOfSides=numberOfSides;
numberOfSidesLabel.text = [NSString stringWithFormat:@"%d",numberOfSides];
}




NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setValue:[NSDate date] forKey:@"now"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:-60] forKey:@"1 minutes ago"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:60 * 30] forKey:@"30 minutes from now"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:-60 * 60 * 24] forKey:@"24 hours ago"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:-7 * 60 * 60 * 24] forKey:@"a week ago today"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:365 * 60 * 60 * 24] forKey:@"a year from now"];
for (NSString *key in dict)
{
NSDate *date = [dict objectForKey:key];
NSLog([NSString stringWithFormat:@"Key: '%@' Date: '%@'", key, date]);
}
#import
NSURL *someURL = [NSURL URLWithString:@"http://www.somesite.com:8080/path/targetpage.html"];
NSLog([NSString stringWithFormat:@"Host: '%@' Port: '%d'", [someURL host], [someURL port]]);
COCOA has a couple dictionary objects. One is changeable (mutable) and one is not.
NSDictionary and NSMutableDictionary
NSMutableDictionary *dict = [NSMutableDictionary dictionary];
[dict setValue:[NSDate date] forKey:@"now"];
[dict setValue:[NSDate dateWithTimeIntervalSinceNow:-60] forKey:@"1 minutes ago"];








2009-07-10 16:40:15.586 HelloPoly[4322:20b] Unknown class Controller in Interface Builder file.
Don't despair! In Interface Builder select the Controller object and then do a File -> write class files.
Be sure to look at UIKit Reference API
One thing to remember is that everything you can do in Interface Builder you can do programmatically.
> sudo mdutil -i on /Volumes/<volume_name>
