2011-05-04 6 views

답변

3

당신이 변수 urArray 배열하고 생성 할 파일의 전체 경로 이름을 보유하고 pListFilePath를라는 NSString 변수를 들고 있다고 가정하면, 다음이 그것을 할 것입니다 :

[urArray writeToFile:pListFilePath atomically:YES]; 
+0

@ 7KV7 : 감사합니다 .. 어떻게 NSDictionary에 배열을 저장할 수 있습니까? NSDictionary ... – user701630

+0

방금 ​​작성한 plist 파일에서 사전을 초기화 할 수 있다고 생각합니다 – visakh7

+0

NSDictionary * dict = [[ NSDictionary alloc] initWithContentsOfFile : filePath]; ' – visakh7

1
NSMutableDictionary *dict1=[[NSMutableDictionary alloc]init]; 
    [dict1 setValue:txtUserName.text forKey:@"username"]; 
    [dict1 setValue:txtPassword.text forKey:@"password"]; 
    [dict1 writeToFile:[self plistPath] atomically:YES]; 
    [dict1 release]; 
2

이 단계를 수행 NSArray 저장소 PLIST에

예 : arrResult는 배열

입니다3210
NSMutableDictionary *dict1=[[NSMutableDictionary alloc]init]; 

[dict1 setValue:arrResult forKey:@"Result"]; 
[dict1 writeToFile:[self plistPath] atomically:YES]; 
[dict1 release]; 
+0

U 다른 답변을 추가하는 대신 기존 답변을 업데이트 할 수 있습니다 .... – visakh7

+0

@ 7KV7 제안 해 주셔서 감사합니다. – iOSdev

관련 문제