How can i check whether is a plist is empty?
+1
A:
If your plist is an array:
NSArray *array = [[NSArray alloc] initWithContentsOfFile:yourFile];
if ([array count] == 0) {
NSLog(@"Your plist is empty");
}
Or if your plist is a dictionary:
NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:yourFile];
if ([[dictionary allKeys] count] == 0) {
NSLog(@"Your plist is empty");
}
Tim van Elsloo
2010-08-22 12:24:25
thks for your help
Stefan
2010-08-22 12:47:31