title: Send an NSObject by watchConnectivity
body: <p>I am working on a WatchOS 2 version of our app and stuck on the fact that i can only send a string with the function "updateApplicationContext:(NSDictionary *)".</p>
  
  <p>I hoped I could make an NSObject with some variables to send over as object in this NSDictionary. After a few days I still didn't find a solutions for this problem. Is there anyway to send a NSObject over the function?</p>
  
  <p>If there is no way to send an NSObject is it possible to send something like a struct?</p>
  
  <p>My code is a s follows:</p>
  
  <pre><code>-(void)updateWatchData
  {
      //Objective-C
      if ([WCSession isSupported]) {
          WCSession *session = [WCSession defaultSession];
          session.delegate = self;
          [session activateSession];
  
          if(session.isPaired) {
              //Objective-C
              DLog("Sending watch data");
              NSMutableArray *kalenderData = [[NSMutableArray alloc] init];
  
              for (int i = 0; i &lt; self.dataContainerViews.count; i++) {
                  DataContainerView *container = self.dataContainerViews[i];
  
                  if(container.listType == ListGPKalender){
                      for(int j = 0; j &lt; container.tableArray.count; j++){
                          GrandPrix *gp = container.tableArray[j];
                          WatchGrandPrix *watchGp = [[WatchGrandPrix alloc] init];
  
                          watchGp.gpnaam = gp.gpnaam;
  
                          [kalenderData addObject:watchGp];
                      }
                  }
              }
  
              NSArray *keys = [NSArray arrayWithObjects:@"kalenderData", nil];
              NSArray *objects = [NSArray arrayWithObjects:kalenderData, nil];
              NSDictionary *dictionary = [NSDictionary dictionaryWithObjects:objects forKeys:keys];
  
              NSError *anyError;
              if([[WCSession defaultSession] updateApplicationContext:dictionary error:&amp;anyError]){
                  DLog("Data Send!");
              }else{
                  DLog("Failed to send data with error: %@", anyError);
              }
          }
      }
  }
  </code></pre>
  
  <p>And the NSObject is just:</p>
  
  <pre><code>@interface WatchGrandPrix : NSObject
  
  @property(nonatomic,strong) NSString *gpnaam;
  
  @end
  </code></pre>
  
  <p>The error i got was </p>
  
  <blockquote>
    <p>Failed to send data with error: Error Domain=WCErrorDomain Code=7010
    "Payload contains unsupported type."
    UserInfo={NSLocalizedDescription=Payload contains unsupported type.,
    NSLocalizedRecoverySuggestion=Only pass valid types.}</p>
  </blockquote>
  
  <p>Thanks!</p>