Hi,
I am developing an iPhone app using Core Data and ahev noticed that I get exceptions when I would expect and error, this is an example:
NSError *error;
// exception here if edited attribute name todoText in modeller and generated new database with that new name in it(ie clearing the iphone), ie tring to access a field not in the database
@try {
NSMutableArray *mutableFetchResults = [[todoListManagedObjectContext executeFetchRequest:request error:&error] mutableCopy];
//seems like vars declaered inside a try is only known inside it, so process here
if (mutableFetchResults == nil) { // nil = error
// Handle the error.
As seen in the comments I don't get an error for trying to access a non existing field....why not just use the error return system for this?
I guess my question is, what are errors and exceptions for, and do I really need to test for both like this?
Rgds PM