title: Information not sending over to Apple Watch on viewDidLoad
body: <p>I have an iOS app that has a watchOS extension, both of which are build in Objective-C. The app needs to send over an array when it loads up (<code>viewDidLoad</code>) or appears (<code>viewDidAppear:(BOOL)animated</code>). When the app loads up, nothing happens, but if I somehow add a file to the app (either through the built-in adder or by importing one from my desktop or AirDrop), the watch app updates. Pressing the refresh button does not make the app work. However, once I add a file, it updates fine and starts updating perfectly. I'm not sure why this happens, but here is some code I used. I cut out some less useful code.</p>
  
  <p>In <code>viewDidLoad</code>:</p>
  
  <pre><code>- (void)viewDidLoad
  {
  NSArray *path = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
  NSString *appFolderPath = [path objectAtIndex:0];
  NSString *inboxAppFolderPath = [appFolderPath stringByAppendingString:@"/Inbox"]; //changes the directory address to make it for the inbox
  
  //move all files from inbox to documents root
  //get to inbox directory
  NSString *documentsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
  
  NSArray *inboxContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:[NSString stringWithFormat:inboxAppFolderPath,documentsDirectory] error:nil];
  
  //move all the files over
  for (int i = 0; i != [inboxContents count]; i++)
  {
      NSString *oldPath = [NSString stringWithFormat:@"%@/%@", inboxAppFolderPath, [inboxContents objectAtIndex:i]];
      //NSLog(oldPath);
      NSString *newPath = [NSString stringWithFormat:@"%@/%@", appFolderPath, [inboxContents objectAtIndex:i]];
      //NSLog(newPath);
      NSError* error;
      [[NSFileManager defaultManager] moveItemAtPath:oldPath toPath:newPath error:&amp;error];
      NSLog(@"error: %@", error.localizedDescription);
  }
  //end of moving all files
  
  
  
  //Turn every file inside the directory into an array
  //add directory in case it doesn't already exist
  if (![[NSFileManager defaultManager] fileExistsAtPath: inboxAppFolderPath])
  {
      [[NSFileManager defaultManager] createDirectoryAtPath: inboxAppFolderPath withIntermediateDirectories:NO attributes:nil error:nil];
      NSLog(@"directory created");
  }
  
  
  
  //a bunch of NSPredicates go here to filter out the array
  
  
  [self sendStuffToWatch];
  
  [super viewDidLoad];
  // Do any additional setup after loading the view, typically from a nib.
  
  [self connectToWatch];
  }
  </code></pre>
  
  <p>In <code>-(void)connectToWatch</code>, there is</p>
  
  <pre><code>-(void)connectToWatch
  {
  //set up WatchConnectivity session
  if([WCSession isSupported])
  {
      self.watchSession = [WCSession defaultSession];
      self.watchSession.delegate = self;
      [self.watchSession activateSession];
  
  
      if([WCSession defaultSession].paired){
          NSLog(@"Watch session active");
      }
      else
      {
          NSLog(@"WATCH NOT CONNECTED");
      }
  }
  }
  </code></pre>
  
  <p>In <code>-(void)sendStuffToWatch</code></p>
  
  <pre><code>-(void)sendStuffToWatch
  {
  if(self.watchSession)
  {
      NSError *error;
      NSDictionary *applicationDict = @{@"array":recipes};
      [self.watchSession updateApplicationContext:applicationDict error:&amp;error];
      NSLog(@"sent info to watch");
  }
  }
  </code></pre>
  
  <p>In <code>-(void)viewDidAppear:(BOOL)animated</code>, there's only this</p>
  
  <pre><code>-(void)viewDidAppear:(BOOL)animated
  {
  [self sendStuffToWatch];
  }
  </code></pre>
  
  <p>The code for the refresh button is</p>
  
  <pre><code>-(IBAction)Refresh:(id)sender
  {
  [recipeTable reloadData];
  [self sendStuffToWatch];
  [self viewDidLoad];
  }
  </code></pre>