title: NSPredicate with bitmask for filtering NSArray
body: <p>I'm trying to test whether some particular asset collections contain only one media type/subtype using an <code>NSPredicate</code>. The: <code>testForPhotosPredicate</code> works just fine, however when trying to use the <code>testForPanoramasPredicate</code> it fails with the message: <code>Unable to parse the format string "mediaSubtypes &amp; %i"</code></p>
  
  <p>How can I use a bitmask in this predicate for the mediaSubtypes?</p>
  
  <pre><code>for (PHFetchResult *newFetch in collectionFetches)
  {
      for (PHAssetCollection *sub in newFetch)
      {
          PHFetchResult *assetsInCollection = [PHAsset fetchAssetsInAssetCollection:sub options:fetchOptions];
  
          NSArray *allAssets = [assetsInCollection objectsAtIndexes:[NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, assetsInCollection.count)]];
  
          if (allAssets.count &gt; 0)
          {
              [allAssetsArray addObjectsFromArray:allAssets];
  
              NSPredicate *testForPhotosPredicate = [NSPredicate predicateWithFormat:@"mediaType = %i",PHAssetMediaTypeImage];
  
              NSArray *testForAllPhotos = [allAssets filteredArrayUsingPredicate:testForPhotosPredicate];
  
              if (testForAllPhotos.count == allAssets.count)
              {
                  NSPredicate *testForPanoramasPredicate = [NSPredicate predicateWithFormat:@"mediaSubtypes &amp; %i",PHAssetMediaSubtypePhotoPanorama];
  
                  NSArray *testForAllPanoramas = [testForAllPhotos filteredArrayUsingPredicate:testForPanoramasPredicate];
  
                  if (testForAllPanoramas.count == testForAllPhotos.count)
                  {
                      NSLog(@"all panos");
                  }
              }
          }
      }
  }
  </code></pre>