title: How to properly use a UIAlertAction handler in Objective-C
body: <p>Simply put, I would like to call a <strong>method</strong> or <strong>reference a variable</strong> from my class in a UIAlertAction handler.</p>
  
  <p>Do I need to pass in a block to this handler or is there some other means to achieve this?</p>
  
  <pre><code>@interface OSAlertAllView ()
  @property (nonatomic, strong) NSString *aString;
  @end
  
  @implementation OSAlertAllView
  
  + (void)alertWithTitle:(NSString *)title message:(NSString *)msg cancelTitle:(NSString *)cancel inView:(UIViewController *)view
  {
      __weak __typeof(self) weakSelf = self;
  
      UIAlertController *alert = [UIAlertController alertControllerWithTitle:title message:msg
                                                                  preferredStyle:UIAlertControllerStyleAlert];
      UIAlertAction* defaultAction = [UIAlertAction actionWithTitle:cancel style:UIAlertActionStyleDefault
          handler:^(UIAlertAction * action) {
              // I'd like to reference a variable or method here
              weakSelf.aString = @"Apples"; // Not sure if this would be necessary
              self.aString = @"Apples"; // Member reference type 'struct objc_class *' is a pointer Error
              [self someMethod]; // No known class method Error
          }];
  
      [alert addAction:defaultAction];
      [view presentViewController:alert animated:YES completion:nil];
  }
  
  - (void)someMethod {
  
  }
  </code></pre>