-(void) createPlistFile {
filepath = @"/Users/agnostos_el/Downloads/PhoneBook/PhoneBook/contacts.txt";
manager = [NSFileManager defaultManager];
atomo = [NSMutableDictionary dictionary];
if ( [manager fileExistsAtPath:filepath]==NO)
{
NSLog(@"Το Αρχειο Δεν Υπαρχει Το δημειουργω");
[[NSFileManager defaultManager]createFileAtPath:filepath contents:record attributes:atomo];
}
else
{
}
}
- (void) times
{
filepath = @"/Users/agnostos_el/Downloads/PhoneBook/PhoneBook/contacts.txt";
atomo = [NSMutableDictionary dictionary];
stoixeia = [NSArray arrayWithObjects:onoma.stringValue, eponimo.stringValue,poli.stringValue, odos.stringValue, per.stringValue,tk.stringValue,xora.stringValue,kin.stringValue,kin1.stringValue,kin2.stringValue,kat.stringValue,erg.stringValue,fax.stringValue,email.stringValue,email1.stringValue,email2.stringValue,pros_sel.stringValue,simio.stringValue,nil];
eponimos = eponimo.stringValue;
innerDict = [NSDictionary dictionaryWithObjects:
[NSArray arrayWithObjects: stoixeia, nil]
forKeys:[NSArray arrayWithObjects:eponimos, nil]];
[self createPlistFile];
pListDict = [NSDictionary dictionaryWithContentsOfFile:filepath];
[atomo setObject:innerDict forKey:@"eponimo"];
if ([pListDict count] == 0)
{
id plist = [NSPropertyListSerialization dataFromPropertyList:(id)atomo
format:NSPropertyListXMLFormat_v1_0 errorDescription:nil];
record = [[NSData alloc]initWithData:plist];
[record writeToFile:filepath atomically:YES];
}
else
if ([pListDict count] >= 1)
{
[pListDict setObject:atomo forKey:eponimos];
id plist = [NSPropertyListSerialization dataFromPropertyList:(id)pListDict
format:NSPropertyListXMLFormat_v1_0 errorDescription:nil];
record = [[NSData alloc]initWithData:plist];
[record writeToFile:filepath atomically:YES];
}
}
Я хочу загрузить данные в массив и затем отобразить их в виде таблицы (приложение Mac),
какие-либо предложения?