iOS Firebase How to pass Snapshot values/keys outside of Block
<p>I am really new to Firebase but I am beginning to like it. So I am having a problem with passing the values of snapshots outside the block. </p>

<p>I want to use NSStrings and or NSarrays to become the value of the snapshots. so that I can use them throughout the rest of my code. </p>

<p>Here is my code</p>

<pre><code>NSString *string1;
NSArray *array1;
Firebase *usersRef = [fb childByAppendingPath:@"Parent name"];

FQuery *statesRef = [usersRef queryOrderedByChild:@"email"];

FQuery *specificStateRef = [statesRef queryEqualToValue:@"user name"];

[specificStateRef observeEventType:FEventTypeChildAdded withBlock:^(FDataSnapshot *snapshot) {

   //NSLog(@"snapshot:  %@", snapshot);
   NSLog(@" key: %@", snapshot.key);
   NSLog(@" value:  %@", snapshot.value);
   //HELP ME HERE
   array1=[[NSarray alloc]initwithObjects:snapshot.value];
   string1=snapshot.key;

}];
</code></pre>

<p>So outside this block if I wrote. </p>

<pre><code>    NSLog(@" String1 = %@", string1);
    NSLog(@" Array1 = %@", array1);
</code></pre>

<p>Unfortunately, the values of string1 and array1 both equal Nil. How can I get the values from Firebase and then be able to use them throughout the rest of the code. How can I get those values out of the block? Thanks y'all</p>