title: How to assign child-to-parent in Objective-C?
body: <p>I've made a UIElement class which inherit UIView class in order to make custom properties for my views.</p>
  
  <p>The problem I've faced, as you can see the code, I can't assign a <strong>UIElement</strong> object to Gesture Recognizer's <strong>view</strong> property.</p>
  
  <p>As long as UIElement is a child of UIView, I can't make child-to-parent relationship.</p>
  
  <p>I'm thinking (alot) to figure out a solution, but I didn't find any.</p>
  
  <pre><code>- (void)viewDidLoad {
      [super viewDidLoad];
  
      UIElement * element = [[UIElement alloc] init];
      element.name = @"A Name"; // Custom property
  
  
      UILongPressGestureRecognizer *longPress = [[UILongPressGestureRecognizer alloc]initWithTarget:self action:@selector(responsToGesture:)];
  longPress.minimumPressDuration = 0.3;
      [longPress setDelegate:self];
      [element addGestureRecognizer:longPress];
  }
  
  
  - (void)responsToGesture:(UILongPressGestureRecognizer *)sender {
  
      UIElement * element = sender.view; // Here's the problem: Incompatible pointer types
      NSLog(@"Element's Name: %@", element.name);
  }
  </code></pre>