#pragma mark - #pragma mark write/read NSDictionary <=> PList - (NSString *)dataFilePath { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docDirectory = [paths objectAtIndex:0]; return [docDirectory stringByAppendingPathComponent:@"aktuelleArtikel.plist"]; } - (NSMutableDictionary *)readFromPlist { NSMutableDictionary* plistDict; // File exist ? if ([[NSFileManager defaultManager] fileExistsAtPath: [self dataFilePath]]){ NSString *filePath = [self dataFilePath]; plistDict = [[NSMutableDictionary alloc] initWithContentsOfFile:filePath]; // NSString *value; // value = [plistDict objectForKey:@"ProductVersion"]; } else { plistDict = [[NSMutableDictionary alloc] init]; } return plistDict; } - (void)writeToPlist:(NSMutableDictionary *) plistDict { NSString *filePath = [self dataFilePath]; [plistDict writeToFile:filePath atomically: YES]; }
bei
- (NSString *)dataFilePath {
kommt der Error: “method definition not in @implementation context” was kann ich da machen?
Tut mir leid, zu voreiliegt gepostet, hatte das ganze in die flasche datei kopiert
OK 🙂