title: CKSubscription with complex predicate
body: <p>I am trying to use <code>CKSubscription</code> this way:</p>
  
  <pre><code>NSArray *events = @[@1,@2,@3];
  NSInteger myValue = 100;
  
  NSPredicate *predicate = [NSPredicate predicateWithFormat:
      @"(value &gt; %@) AND (prev_value &lt; %@) AND (event_type IN %@)",
      @(myValue), @(myValue), events];
  
  CKSubscription *sub = [[CKSubscription alloc] initWithRecordType:@"TableName"
      predicate:predicate options:(CKSubscriptionOptionsFiresOnRecordCreation)];
  
  [db saveSubscription:sub completionHandler:^(CKSubscription *s, NSError *error) {
      if (error) {
          NSLog(@"Error: %@", error.localizedDescription);
          return;
      }
      NSLog(@"Success!");
  }];
  </code></pre>
  
  <p>This getting me error:</p>
  
  <pre><code>Error: Error saving record subscription with id 781FB482-C9C9-4DA5-8022-CFDB8006223A to server:
  invalid attempt to set value type NUMBER_INT64 for field 'binding_0' for type
  '_sub_trigger_sub_220b17724b5262b0590a3c9d66be9826', defined to be: INT64_LIST
  </code></pre>
  
  <p>This looks like valid <code>NSPredicate</code> can not be properly stored in CloudKit as part of <code>CKSubscription</code> object. It that real Apple bug or mine?</p>
  
  <p>P.S. I have tried a lot of different combinations by removing different parts of predicate condition. Looks like the only condition for <code>event_type</code> works fine, but when I am mixing 3 conditions with <code>AND</code> - this causes a problem.</p>
  
  <p>P.P.S. I am using <code>Xcode 6 beta 6</code> on <code>OSX 10.10 DP6</code> and <code>iOS8 beta 5</code> on iPhone 5S</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <p>Subscriptions with one of the following predicates works fine:</p>
  
  <pre><code>NSPredicate *predicate1 = [NSPredicate predicateWithFormat:
      @"(value &gt; %@) AND (prev_value &lt; %@)", @(myValue), @(myValue)];
  
  NSPredicate *predicate2 = [NSPredicate predicateWithFormat:
      @"(event_type IN %@)", events];
  </code></pre>
  
  <p>But saving subscription with common predicate fails:</p>
  
  <pre><code>NSPredicate *predicate = [NSPredicate predicateWithFormat:
      @"(value &gt; %@) AND (prev_value &lt; %@) AND (event_type IN %@)",
      @(myValue), @(myValue), events];
  </code></pre>
  
  <p>Looks like real Apple CloudKit bug. Just opened issue at bugreport.apple.com #18105879</p>
  
  <p><strong>UPDATE 2:</strong></p>
  
  <p>Thanks to @purrrminator - here are two radars with problem with receiving CloudKit push notifications:</p>
  
  <p><a href="http://openradar.appspot.com/18807663" rel="nofollow">http://openradar.appspot.com/18807663</a></p>
  
  <p><a href="http://openradar.appspot.com/18798061" rel="nofollow">http://openradar.appspot.com/18798061</a></p>
  
  <p>I found workaround for saving <code>CKSubscription</code> properly via presenting <code>IN</code> condition with a lot of equality comparers. But really I got no push notifications from CLoudKit...</p>