title: Assigning UIButton to UIView in Xcode
body: <p>In my project i used the below code for a purpose and it is working properly.
  My code:</p>
  
  <pre><code> UIView *view = [[[UIImageView alloc] initWithImage:[UIImage imageNamed:[NSString stringWithFormat:@"%d.jpg",index]]] autorelease];
  
  view.frame = CGRectMake(70, 80, 180, 260);
  return view;
  </code></pre>
  
  <p>But here instead of UIImageView i would like to use UIButton,So I replaced the first lin eof above code by:</p>
  
  <pre><code>  UIView *view=[[UIButton alloc] setBackgroundImage:(UIImage *)[scrollImages objectAtIndex:index] forState:UIControlStateNormal];
  </code></pre>
  
  <p>But at this point i am getting an error message as </p>
  
  <blockquote>
    <p>"Initializing 'UIView*_strong' with an expression of incompatible type 'void'".</p>
  </blockquote>
  
  <p>Can anyone help me to solve this by replacing UIImageView with UIButton....</p>