title: Dynamically add textview on click of button in ios objective c
body: <p>I have a <code>scrollview</code>. I have put a <code>textfield</code> and a button over it in same line. I want when user enter a <code>URL</code> in <code>textbox</code> and click on <code>button</code>, <code>URL</code> should be added dynamically created <code>textview</code> over <code>textbox</code> and <code>button</code>. (I am using <code>textview</code> because it automatically detect the <code>URL</code> and present as link).
  I have already tried following codes but it is not working:</p>
  
  <p><strong>1.</strong> </p>
  
  <pre><code>- (IBAction)addLinkClicked:(id)sender  {
  
      NSLog(@"Add Link button clicked");
      UITextView *linkTextView = [[UITextView alloc] init];
      linkTextView.text = @"http://google.com";
      linkTextView.layer.cornerRadius = 5.0;
      [self.scrollView addSubview:linkTextView];
  }
  </code></pre>
  
  <p><strong>2.</strong> </p>
  
  <pre><code>- (IBAction)addLinkClicked:(id)sender  {
  
      NSLog(@"Add Link button clicked");
      UITextView *linkTextView = [[UITextView alloc] init];
      linkTextView.text = @"http://google.com";
      linkTextView.layer.cornerRadius = 5.0;
      [self.scrollView insertSubview:linkTextView atIndex:[self.scrollView.subviews count]];
  }
  </code></pre>
  
  <p>Please help me to resolve my issue.</p>