title: ALAssetsLibrary enumerateGroupsWithTypes returns no data
body: <p>I am using the AssetsLibrary framework to retrieve all asset groups in the iPhone. I have some code snippet like this:</p>
  
  <pre><code>NSMutableArray *groups = [[NSMutableArray alloc] initWithCapacity:5];
  void (^groupEnumerator)(ALAssetsGroup*, BOOL*) = ^(ALAssetsGroup *group, BOOL *stop) {
      if(group != nil) {
          NSLog(@"Adding group %@", [group valueForProperty:ALAssetsGroupPropertyName]);
          [groups addObject:group];
      }
  };
  
  ALAssetsLibrary* library = [AssetsManager defaultAssetsLibrary];
  [library enumerateGroupsWithTypes: ALAssetsGroupSavedPhotos
      usingBlock:groupEnumerator
      failureBlock:^(NSError * err) {NSLog(@"Erorr: %@", [err localizedDescription]);}];
  </code></pre>
  
  <p>And I found a weird behavior:</p>
  
  <p>1) When I run my app in the iOS simulator (use command + R in Xcode), the groupEnumerator will be executed and group names will be printed in the console</p>
  
  <p>2) I wrote some unit test for my app, when I run the unit test (use command + U in Xcode), which calls the above code snippet as it is called in my app, the groupEnumerator seems not get executed at all and none of the group name will be printed, and the failureBlock doesn't get called too and I don't get any error when running the tests but the group enumeration doesn't work as it does in the app.</p>
  
  <p>I check Apple's documentation, and I know this method (enumerateGroupsWithTypes:usingBlock:failureBlock:) is asynchronous, however, even if I wait for a long time in my unit test, I don't see the groupEnumerator get executed.</p>
  
  <p>I am testing against iOS 5.0 with Xcode 4.2. </p>
  
  <p>Any help is appreciated. Thanks.</p>