title: how to pass a Parameter from a Method which opens a UIAlertView to the UIAlertViewDelegate-Method?
body: <p>Given the following code:</p>
  
  <pre><code>- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo {
      if (mainViewController.loggedIn) {
  
          UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"test" message:@"notification received. view now?" delegate:self cancelButtonTitle:@"Later" otherButtonTitles: @"Show"), nil];
          NSString *hash = [userInfo objectForKey:@"id"];
  
          [alert setValue:hash forKey:@"hash"];
  
          [alert show];
          [alert release];
      }
  }
  </code></pre>
  
  <p>Here I try to set a value (hash) for the key @"hash". I'm doing this, because I need this hash value in case the user presses the "Show" button. Then - in the delegate method - I try to read the value again:</p>
  
  <pre><code>- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex {
      if (buttonIndex == 1) {
          NSString *hash = [alertView valueForKey:@"hash"];
          if (hash != nil) {
              // send hash to server to show the correct site
          }
      }
  }
  </code></pre>
  
  <p>But as soon as i call<code>[alert setValue:hash forKey:@"hash"];</code> my iphone app crashes.
  This is what i see in the console:</p>
  
  <blockquote>
    <p><em>*</em> Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[ setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key hash.'</p>
  </blockquote>
  
  <p>Does anybody has an idea what I made wrong. Or how could i pass my "hash" value to the <code>clickedButtonAtIndex</code> method?</p>