NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *myPlistPath = [documentsDirectory stringByAppendingPathComponent:@"Accounts.plist"];
NSArray *arr = [NSArray arrayWithContentsOfFile:myPlistPath];
int count = 0;
for (NSDictionary *dict in arr) {
count += dict.count;
}
return count;
What am I doing wrong?
I get the following error with the above code: Program received signal: “EXC_BAD_ACCESS”.