title: Button To Open New View
body: <p>I recently became a member as I noticed that there is alot of knowledge here and I am a complete beginner at making iOS apps. I am currently making an app that works perfectly for everything I want it to do. The only problem is that I added a new button to the app and I do not know how to open a new view with it or how to hook it up to a segue or whatever will open the new view. I made the button programmatically, and as a selector I have a method called pushnext. I am trying to implement a method that will open a view but all I know is that the information in the view I want to display is contained in GridViewController.m , I do not know how to call that view and I have read many other posts here but I just can't seem to figure it out. I hope you guys can help me out. Thank you for your time.</p>
  
  <p>I am also using a storyboard with the following:</p>
  
  <p>Tab Bar Controller (2 icons) : then from there it splits to First View Controller and then to Navigation Controller. From Navigation Controller it is connected to Grid View Controller (What I want the button to open) and then from Grid View Controller it has a connection to Detail View Connection. Please help me if you could. I followed the guides found here if it helps you <a href="http://mobile.tutsplus.com/tutorials/iphone/design-build-a-small-business-app-custom-detail-views/" rel="nofollow">http://mobile.tutsplus.com/tutorials/iphone/design-build-a-small-business-app-custom-detail-views/</a></p>
  
  <p>EDIT: I have added the code I have below so it is easier for you guys.</p>
  
  <p>I finally see it now, the reason was because I was using the "add comment" instead of answer question.</p>
  
  <p>This is what I Have in FirstViewController.h</p>
  
  <pre><code>-(void)pushnext;
  </code></pre>
  
  <p>Then I have my button in FirstViewController.m </p>
  
  <pre><code>self.roundButton = [self createButtonWithPicture:CGRectMake(110, 200, 100, 100) andLabel:@""];
  [self.view addSubview:roundButton];
  
  [self.roundButton addTarget:self action:@selector(pushnext:) forControlEvents:UIControlEventTouchUpInside];
  </code></pre>
  
  <p>Also Inside of FirstViewController.m I have the implementation I want to use for opening the new view with my button:</p>
  
  <pre><code>-(void)pushnext{
  [UIView transitionFromView:contact toView:cable duration:1.0 options UIViewAnimationOptionTransitionFlipFromLeft completion:^(BOOL finished){
      [contact release];
     }];
  </code></pre>
  
  <p>From there I want the method pushnext to open that view for me but I just can't seem to get it. I have my button setup in the very first screen that pops up after the app loads, and I don't know what that view is called so I called it contact in my code, and I want it to open the view that has all the information contained with GridViewController.m I just don't know what to do. You suggested to use a segue to connect them but how am I supposed to connect a segue to my button. I also have the problem that my button is done programmatically not through IB. Thank you for your time and I hope you can help me. Thank you once again, I am just desperate because I have been stuck for days trying to figure it out by reading and examples and I just don't get it. I also attached a picture of my storyboard. There you might be able to see better what I am talking about, I have my button programmed in the "Tab Bar Controller" page but I want the button to open the page labeled "Grid View Controller-Second" and the image is here <a href="http://i.stack.imgur.com/YKs1o.png" rel="nofollow">http://i.stack.imgur.com/YKs1o.png</a></p>