How do you make a button open a new window?

I am trying to create an action that opens a new window but cannot figure out how to do it. Does anybody have any help with where to start?

Select a View-based Application give the name as Button & add a new file give the name SecondViewController,
Write the following code in Button.m
Import your SecondViewController , By writing statement
#import "SecondViewController.h"
- (void)viewDidLoad {
    [super viewDidLoad];
          UIButton *btnObj = [UIButton buttonWithType:UIButtonTypeRoundedRect];
          btnObj.frame = CGRectMake(40, 40, 70, 50);
          [btnObj setTitle:@"CLICK" forState:UIControlStateNormal];
          [btnObj addTarget:self action:@selector(nextView) forControlEvents:UIControlEventTouchUpInside];
          [self.view addSubview:btnObj];
          //[btnObj release];
-(void)nextView{
          SecondViewController *secObj = [[SecondViewController alloc]initWithNibName:@"SecondViewController" bundle:nil];
          [self presentModalViewController:secObj animated:YES];

Similar Messages

  • How do i make a button open a new window...

    Hi,
    I'm making some very basic login software and i want the program to open up a new window when the "Login" button is pressed and then display a message saying whether the login was successful or not.
    Any help would be appreciated but i would love some code to help me see how to do it and help me on my way.
    Cheers.

    what do you exactly need, the "how to create and display a frame"? I bet your program already has a frame, so I suspect you know how to do that. Well, just do it again.
    Note: if its just a plain message you wish to display to the user, the easiest way will be by using javax.swing.JOptionPane, look for the showXxxx methods.
    If the question was more "how do I know when my button get pressed", take a look at that other question: http://forum.java.sun.com/thread.jsp?forum=57&thread=156406

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • How do you make adobe X open the "combine pdf" window in the foreground?

    This may not be the correct forum for this question, but considering that I simply
    have not been able to get a reply in any other Adobe forum, I decided
    to just post this question to ALL Adobe forums until I get a response.........
    How do you make adobe X open the "combine pdf" window in the foreground?
    I am using a "Windows 7" computer at work with "Acrobat X Pro" and I'm constantly combining
    pdf's and tiff's in Acrobat.
    It would be nice if when I select 30 or 40 files to combine, the *******
    "Combine Supported Files in Adobe Acrobat" window would open in the
    foreground, not behind the 10 or so windows already open.
    I have been researching this for some time now with no solution.
    If the answer is that "IT CAN'T BE DONE", then that's fine. At least
    I will have an answer and can stop searching. If (as I suspect) it can
    be done, then kindly supply me with "step by step" instructions.
    Michael Jones

    Hi ,
    I guess that was a bug in that version .
    It does not happen in Acrobat XI and Acrobat DC .The window comes right in front of everything else .
    I wonder that was a bug and that was fixed the other versions.
    You could upgrade to the latest Acrobat version ,i.e Acrobat DC and you would not experience this anymore .
    Regards
    Sukrit Dhingra

  • How do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    how do you make a link open on a new page (typically the target="_blank" command) in MUSE?

    Newer version does not have the same interface.  I'm stuck trying to understand how to add a "blank" target to a hyperlink...  See how your screenshot has a dropdown associated with the "Hyperlink" object?  Mine doesn't...

  • How do you make an application open on a specific monitor?

    How do you make an application open on a specific monitor? I have two monitors, and I was able to get Firefox to open on the secondary display always by resizing it with the option or command key [I forget which one] and then quitting it. Now everytime I start it, it opens on the second monitor.
    However, when I try to do the same with QuickTime [when playing videos], it always opens on the primary display no matter what I do with it. How do I make it always open on the secondary display?
    Thanks in advance for any help!

    Thanks for the suggestion, but no, Spaces is not what I want. I have two physical monitors, and simply want an application to always open on one monitor, not be able to switch back and forth between different desktops.

  • How do I get firefox to open a new window when i click on a link in a webpage ?

    When I click on a link in a webpage in Firefox, generally it opens the new page in the window i am in (though some times it does not). How do I get it to open a new window (or tab) each time I click a link.
    For example, on www.bbc.co.uk if I click on a link, the new page opens in the same window, if I then click another link in the new window, again, it opens in the same window. To get back to the original window, I have to use the back button twice. Surely there is a setting so that all 3 windows can be open on separate tabs or separate windows.
    I have been to the tabs window in options, but doesn't seem to make a difference.

    Open link/bookmark in new tab in same window:
    *Middle-click (press the mouse scroll wheel) the link
    *Ctrl+left click the link
    *right-click the link, choose "Open Link in New Tab"
    Open link/bookmark in new window:
    * Shift+Enter on the link
    * Shift+left click on the link
    See: http://www.7is7.com/software/firefox/shortcuts.html

  • Home button opens a new window instead of just returning active tab to home

    Running firefox 9.0.1 on Snow Leopard. After browsing for a short time clicking on the home button opens a new window instead of just returning theactive tab to home

    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.org/kb/Safe+Mode

  • How do you make the dashboard open automatically at login?

    Ok, you know in your dock you can right click on any application icon and it will come up with some options, one of them being "Open at Login." Well, I want to automatically open the dashboard at login, but when I right click on the dashboard icon it does not give that option. How do I make the dashboard open automatically when I log in?

    There is a freeware app called "Dashboard Starter" that will start the DB up when you log-in, or anytime you force quit the Dock.app.
    Search www.macupdate.com for it.
    iSMH

  • How do you make 2 buttons that have different link in one form?

    <form name="form1" method="post" action="">
    <input name="cmdBtn" type="submit" id="cmdBtn" value="one">
    <input name="cmdBtn" type="submit" id="cmdBtn" value="two">
    </form>
    i want the link of button "one" to have different link with button "two". How can i do it using jsp?
    thanks

    i posed this question to the javascript forum but no reply, so i just post it here if in case there are jsp users here who knows the answer to my question. hope u guys understand. thanks
    I have 2 jsp files namely page1.jsp and page2.jsp.
    page1.jsp
    <%@ page contentType="text/html; charset=" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <script language="JavaScript" type="text/JavaScript">
    function MM_openBrWindow(theURL,winName,features)
    { //v2.0
    window.open(theURL,winName,features);
    </script>
    </head>
    <body>
    <form name="form1" method="post" action="">
    <p>
    <input name="txtValue" type="text" id="txtValue" value="i want this value to be passed when i click the 'open new window' button" size="80">
    </p>
    <p>
    <input type="submit" name="Submit" onMouseDown="MM_openBrWindow('page2.jsp','','scrollbars=Yes,width=500,height=500')" style="TEXT-DECORATION:none" value="Open New Window">
    </p>
    </form>
    </body>
    </html>
    page2.jsp
    <%@ page contentType="text/html; charset=" language="java" import="java.sql.*" errorPage="" %>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    <body>
    <%
    String value = request.getParameter("txtValue");
    %>
    <form name="form1" method="post" action="">
    <p> Value is <%=value%></p>
    </form>
    </body>
    </html>
    what the code does is it open a new window (page2.jsp) if you click the button in page1.jsp, my problem is, i can't pass the value of txtValue from page1.jsp to page2.jsp, How can i do it?
    thanks

  • Exit button - Opens a new Window

    Portal experts,
    We are facing some problem with exit button in the standard iViews like Bank, personal data.
    When we click on the exit button, it is opening a new window rather than coming out of the iView. I searched for sap notes, didnt find anything.
    can anyone faced this problem?
    Please help us.
    Cheers
    Jay

    Hello Jay,
    Yes you make the settings using Work Protect Mode in the Portal. If you don't want to open a new window you need to configure workprotect mode.
    Simply follow this Note 734861 - WorkProtect Mode - Global Settings
    Let me know in case you face any issues.
    Vijay

  • How do I stop Firefox from opening a new window when I go to a search item?

    When I do a search, and click on a topic, Firefox opens a new window on the tool bar at the bottom of my screen. How can I stop this from happening?

    I'm guessing you use Google for search. There is a setting in Google search to open each result in a new window. (When you use tabbed browsing, that means each result opens in a new tab.) You can check on whether you have that setting turned on as follows:
    On a Google results page, click the button on the right side with the "gear" icon, then click Search Settings from the drop-down list. At the bottom of the page is the setting to open results in a new window.
    Is that the culprit?

  • How do I change firefox to open a new window when I start it several times instead of opening a new tab when I want to go to a different location?

    I want to go to several different websites at the same time. I want to compare the information on each site. I do not want to open a tab, I want a whole new window. How do I change firefox so it will open a new window instead of opening a new tab and then requesting the site I want to go to?

    In Windows XP I am able to right click a link and get an option to open it as a new Firefox window
    *'''tear off tabs'''
    You will probably note tabs can be dragged along the tab toolbar, they also tear off. You can click a tab and drag it off the browser onto the Windows Desktop where it will open as a new window, or drag it on to another open browser window.
    An alternative is to click the tab and drag it down, again it will then open in a new Window.

  • Logoff button opens a new Window

    Hi gurus,
    we have newly installed EP 6.0 SP20. When we try to logoff the portals with the log off button, a new window is opened and the logoff takes a lot of time to actually logoff. The new window is open even after the delayed logoff. Has any one faced this issue and is it a known issue and does it have a fix or suggest take it up with SAP as i have not found anyrelated notes
    Please Advise
    regards
    raj

    Hi,
    logoff portal issue are also ""common"" in EP7.
    With the EP7 SP6 or 7, sorry I can not exactly remember, we were experiencing log off problem using IE6.
    Mozilla were working.
    With SP 11, log off option works on both Mozilla and IE 6, opening a new window and log off quite quickly.
    Here's my little experience.
    Fabien.

  • Does any version of InDesign let you set hyperlinks to open in new window?

    I'm converting some InDesign books to pdf and epubs and my client wants the hyperlinks to open in new window when these files are viewed in browsers. so far no version I've tried has this capability.

    It must be done in Acrobat. Ask in the Acrobat forums.

Maybe you are looking for

  • Error Message while Approving Tasks in Project Server 2010

    Hi All, While performing Tasks approvals in MS Project 2010 I am getting below error message: An Error Occured while processing one or more items. This was caused by one of the following: A timesheet job is failed and blocking coorelation in the queu

  • Can't print Firefox pages on my HP Officejet Pro 8500A but I'm able to print using safari, word etc.

    I run a Mac OS X 10.5.8 and I'm trying to print on an HP Officejet Pro 8500A. I am able to print pages from Safari, Word etc. But when I try to print from Firefox all the pages come out blank (there is no error message). I just updated my firefox bro

  • Problem with 3D sphere in Photoshop Extended CS6

    Here is a still from what will be a trade show video. The problem is that the longitudinal lines are a bit wobbly, especially near the poles, for instance in the top right quadrant, between the orange and yellow earplugs. http://www.flickr.com/photos

  • Create SA from PR - Vendor from source List

    Dear All, I am creating a SA from PR, where i have selected a vendor & info record. and now when i tried to create a SA wrt PR, system is asking for a Vendor and if i entered different vendor also its accepting & again asking for the Net price. Can i

  • How to run the sample code using the sdk?

    Hi, I want to run the jsp code from the enterprize sdk available in the sdn community. Can any one tell me how to execute these jsp sample codes and what is the pre-requisite regarding the set up. I already have the deployment ready. thanks AMar