Control reaches end of a non-void function


#1

I am getting this warning in the following code Can anyone see where I am going wrong? Thanks.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Attempt to load an existing to-do dataset from an array stored to disk. NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()]; if (plist) { //If there was a dataset available, copy it into our instanse variable tasks = [plist mutableCopy]; } else { //Otherwise, just create an empty one to get us started. tasks = [[NSMutableArray alloc] init]; } }


#2

You have not returned the BOOL value.

Like so - notice the last line of code

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //Attempt to load an existing to-do dataset from an array stored to disk. NSArray *plist = [NSArray arrayWithContentsOfFile:docPath()]; if (plist) { //If there was a dataset available, copy it into our instanse variable tasks = [plist mutableCopy]; } else { //Otherwise, just create an empty one to get us started. tasks = [[NSMutableArray alloc] init]; } return YES; }