dataFromPropertyList:format:errorDescription:
プロパティリストフォーマットからNSDataオブジェクトを返します
+(NSData *)dataFromPropertyList:(id)plist: format:(NSPropertyListFormat)format: errorDescription:(NSString **)errorString:
解説
プロパティリストフォーマットからNSDataオブジェクトを返します。
【NSPropertyListFormat】
●NSPropertyListOpenStepFormat
●NSPropertyListXMLFormat_v1_0
●NSPropertyListBinaryFormat_v1_0
返り値
( NSData * )
データ
引数
( id )plist
( NSPropertyListFormat )format
( NSString ** )errorString
フレームワーク
Foundation
クラス
NSPropertyListSerialization
Class Methods
使用可能
10.2
参照
+ propertyListFromData:mutabilityOption:format:errorDescription:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { NSString *error; NSData *serializationData; NSString *thePath = [[NSBundle mainBundle] pathForResource : @"theList" ofType:@"plist"]; NSData *plistData = [ NSData dataWithContentsOfFile : thePath ] ; serializationData = [NSPropertyListSerialization dataFromPropertyList: plistData format: NSPropertyListXMLFormat_v1_0 errorDescription: &error]; NSLog([serializationData description]); } @end