プロパティリストの読み込み(XCode4対応)

test2.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>color</key>
	<array>
		<dict>
			<key>name</key>
			<string>とき色</string>
			<key>Red</key>
			<integer>250</integer>
			<key>Green</key>
			<integer>156</integer>
			<key>Blue</key>
			<integer>184</integer>
		</dict>
		<dict>
			<key>name</key>
			<string>つつじ色</string>
			<key>Red</key>
			<integer>207</integer>
			<key>Green</key>
			<integer>64</integer>
			<key>Blue</key>
			<integer>120</integer>
		</dict>
	</array>
</dict>
</plist>

ViewController.h
#import <UIKit/UIKit.h>

@interface ViewController : UIViewController

@property (retain, nonatomic) IBOutlet UITextView *tv;

- (void)readTest2;

@end

ViewController.mの一部
- (void)viewDidLoad
{
   [super viewDidLoad];
   // Do any additional setup after loading the view, typically from a nib.

   [self readTest2];
}

- (void)readTest2
{
   NSString *path = [[NSBundle mainBundle] pathForResource:@"test2" ofType:@"plist"];
   NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
   NSArray *_plist = [NSArray arrayWithArray:[dict objectForKey:@"color"]];

   NSMutableString *message = [NSMutableString stringWithString:@""];
   for (NSDictionary *color in _plist)
   {
       NSString *name = [color objectForKey:@"name"];
       NSNumber *red = [color objectForKey:@"Red"];
       NSNumber *green = [color objectForKey:@"Green"];
       NSNumber *blue = [color objectForKey:@"Blue"];

       NSString *m = [NSString stringWithFormat:@"[ %@: (r,g,b) = (%@,%@,%@) ]", name, red, green, blue];
       [message appendString:m];
   }

   tv.text = message;
}