ApplicationShouldTerminateAfterLastWindowClosed Doc-based Project Help?

If I do the following:
( 1 ) create a NON-document based Cocoa Project:
( 2 ) add a button to the nib window, name it [DONE]
( 3 ) Control Click and Drag from [DONE] to the Window and select performClose: from the HUD
( 4 ) Run and click on [DONE] and applicationShouldTerminateAfterLastWindowClosed gets called, and the app quits just like it is supposed to. So this brief amount of code works GOOD..
// TestNoDocAppDelegate.h
// TestNoDoc
#import <Cocoa/Cocoa.h>
@interface TestNoDocAppDelegate : NSObject <NSApplicationDelegate> {
NSWindow *window;
@property (assign) IBOutlet NSWindow *window;
@end
// TestNoDocAppDelegate.m
// TestNoDoc
#import "TestNoDocAppDelegate.h"
@implementation TestNoDocAppDelegate
@synthesize window;
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application
// If the user closes the last window in the application, make sure the application quits.
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender {
NSLog(@"[4567] %@",@"applicationShouldTerminateAfterLastWindowClosed");
return YES;
@end
But if I try to get this to work with a Document based Project I cannot get applicationShouldTerminateAfterLastWindowClosed to trigger such that the application will quit.
I have tried creating an AppController Class (SubClass of NSController) then dragged it to the Nib Window, auto-created the AppController methods, and put the code there, and IB will not let me Control-Click-Drag from the File's Owner to the AppController instance in the Nib. The AppController won't highlight. So obviously I am doing something wrong...
When I tried this awakeFromNib in MyDocument Class I still could not get applicationShouldTerminateAfterLastWindowClosed to trigger.
- (void) awakeFromNib
NSLog(@"[4001] %@",[NSApp delegate]); // returned null
[NSApp setDelegate:self];
[[NSApp delegate] applicationShouldTerminateAfterLastWindowClosed:NSApp];
// this got called OK
NSLog(@"[4002] %@",[NSApp delegate]);
// returned non-null value (whether it was good or not, I don't know. I assume it was.)
I am missing something with either not having the right class, or probably with the Nib Window connections.
I'd be grateful for some help.
Bill Hernandez
Plano, Texas
Message was edited by: Bill_Hernandez
Message was edited by: Bill_Hernandez
Message was edited by: Bill_Hernandez

Bill_Hernandez wrote:
Steve Herman1 wrote:
Add an NSObject (the blue box) to MainMenu.xib.
Select the blue box and then the rightmost icon in the Inspector window.
Change the class from NSObject to TestDocAppDelegate.
Control-drag from File's Owner to the TestDocAppDelegate icon and connect it as the delegate.
I tried this before and when I control-click-drag (CCD) from File's Owner to TestDocAppDelegate, it will not allow me to do that. When I CCD over each instance icon in the xib window, the only one that highlights is the window icon.
Since you mention the "window icon" it sounds like you're working in the wrong xib file. I see the same behavior if I do what you've described in the MyDocument.xib.
But a Cocoa document-based project template comes with two xib files. You need to be doing this in MainMenu.xib not MyDocument.xib (the MainMenu.xib for a document-based app doesn't have a window icon by default).
I normally do this slightly different, but it achieves the same result (I think...)
( 1 ) Create New Project, call it TestDoc
( 2 ) Control-Click on the Classes Group,
and Add New File...
called TestDocAppDelegate
( 3 ) Do a Cmd-Shift-L to open the Library,
select the Classes TAB,
in the search field at the bottom type in the first few characters for the name
of the class you just created, in this case "TestD"
and only one Class is displayed in the list, TestDocAppDelegate.
( 4 ) Drag the TestDocAppDelegate icon to the xib window
{code}
Instead of using the ( 4 ) steps above, I created a new project and used your EXACT steps, and could not get that to work either.
I believe you're correct that your steps have the same effect as mine. I tried using your steps and it still works for me. In fact, I had never really played with the "Classes" tab in IB, so I learned something new. Thanks!
I think the problem is that you're adding your delegate object and attempting to make the connection in the wrong xib file.
Steve

Similar Messages

  • Need help for the web based project

    I am using netbeans 5.5 and Sql server for db.What is the full form for DAO and how is it going to help me in my project.U also talk about uml want ot know about it.
    and how is it coming to help me.Its a very wast topic i serached.what will be helpful to me of the UML.
    What should i start first --- jsp or db design.
    What should i use for web based project --- only use jsp(presentation)+dao or jsp+servlet+dao.What would be best ?
    provide some nice link based on dynamic fetching of values from the database and showing it at runtime.
    Message was edited by:
    java@mani

    As stated in http://forum.java.sun.com/thread.jspa?threadID=5167752 start reading the Java EE tutorial to get insights in the material.
    what will be helpful to me of the UML.UML generally visualizes the core functionality. See http://www.google.com/search?q=uml+tutorial for some tuts.
    What should i start first --- jsp or db design.Start with both and end with the best balance between both.
    What should i use for web based project --- only use
    jsp(presentation)+dao or jsp+servlet+dao.Depends on the business needs. Generally 3-tier webapplications are the best: web, business and data.
    provide some nice link based on dynamic fetching of values from the
    database and showing it at runtime.Check some SQL and JDBC tutorials how to fetch and process the data:
    http://www.google.com/search?q=sql+tutorial
    http://www.google.com/search?q=jdbc+tutorial
    How to process it in the business and web layer is stated in the Java EE tutorial I've linked in your former topic.
    For applying the patterns, check the http://java.sun.com/blueprints/corej2eepatterns/

  • Browser based AIR Help and PDF Files

    Hi everyone,
    I am so glad to have forum like this, hoping that sharing your experiences will help a little bit further.
    Just recently I have tried to generate an browser based AIR Help in combination with merged projects. By the way, Peter Grainge's tutorial was very helpful here, thanks Peter!
    My project also contained a single PDF file in a baggage container. After I had published my file, I had noticed that it was not possible to open the PDF in any way.
    So I tried the same using the Adobe AIR Help Application and there the PDF worked. Now I was wondering whether I did something wrong or do I need to be aware of something.
    Personally I don't mind using the Adobe AIR Help Application, the only disadvantage I had discovered beside the local installation, is the the document spacing seemed to be a little odd. Actually there was no space between the border and the content. With any other single source output there is, including the browser based AIR help.
    I didn't find any similar problems on this forum, but maybe any of you has a little hint for me.
    Thanks and greetings from Germany,
    Christian

    PDF should work from browser based AIR Help. Try a different file.
    See the AIR topics on my site about the margins. In short, you create a copy of your CSS and just change the body tag margins in Notepad. Use the ordinary CSS when you are working or creating other outputs, use myproject_AIR.css when you generate the help.
    See www.grainge.org for RoboHelp and Authoring tips
    @petergrainge

  • Browser Based AIR Help not displaying in browser

    Hi All!
    Publishing with RoboHelp 8...
    WebHelp generates and publishes properly to the server. Viewable, working, all good.
    Browser Based AIR Help previews, generates, publishes, but won't display via IE or Safari. All that I get is a blank page instead of index.htm
    Side Note/Side Issue: Project contains links to Baggage File PDF's. The links in the WebHelp version works properly. The BB AIRHelp only displays a blank page
    Any thoughts?

    LOL, it was never my intent to berate you. Only to try and point out that things like this require some thinking through.
    As for the "sexist overtones", those totally aren't intentional either. I facilitate RoboHelp and Captivate classes for my living. I find that as humans, we all have food in common. As a result, it is often helpful to use an analogy to better understand what is going on with things we cannot see physically, such as RoboHelp generating and publishing files.
    If you look through these forums at all, you will see that I use the analogy of a Single Source Layout as being just like a recipe. The Single Source Layout Pod being just like a recipe box. And I'm always calling the SSL the "SSL Recipe". Go ahead and search. You'll be surprised.
    So it had nothing to do with this post. Only that it's my preferred way of trying to help make sense of things that aren't exactly tangible.
    Sorry if I offended you in any way. I certainly didn't mean to!
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7, 8 or 9 within the day!
    Adobe Certified RoboHelp HTML Training
    SorcerStone Blog
    RoboHelp eBooks

  • Java EE Based Projects in JCAPS 6

    Hi All,
    Can some one please tell me brief description on "HOW TO DEVELOP JAVA EE BASED PROJECTS" in java CAPS 6 ?
    If you have any links for screenshots or procedure it will be helpful....
    Thanks in advance
    Jags

    If you are coming form Java CAPS 5.x then:
    Go to http://blogs.sun.com/javacapsfieldtech/ and search for "JCA". This will geive you several step-by-step tutorials on how to use JCA Adapaters in Java EE projects, including how to start a Java EE project for the occasion.
    If you are not coming from Java CAPS 5.x then have a look anyway.
    Regards
    Michael

  • Sample RFID based Project using SAP XI

    Hello everybody,
    Can anybody send me a RFID based project that can be implemented using XI?
    I searched in sdn and Google, but didn't come across any.
    Appreciate your help.
    Thank you,
    Deepak.

    Hi,
    Please don't mind but I am not getting what exactly you are looking for.
    Because the above posted links have covered all the configuration as well as installation things with XI step-by-step.
    Are you looking for the basic flow of RFID or do you have any scenario where this RFID is to be implement.
    RFID is generally used as for indentification purpose, normally used with your login cards, or bar-code system at shops etc.
    Let me know if you are looking for any specific scenario to be implemented. Because if you are comparing it with  other scenarios then do you have sender and receiver systems ready with you.
    for e.g. if you are dealing with bar codes, then you have to connect the bar-code application with XI and then to receiver system such as database or may be SAP.
    On the basis of request from that application XI will provide the data to bar code application (such as item code, item price, quantity etc) from data base or SAP or anyother application.
    I hope now you might be clear with it
    thanks
    Swarup
    Thanks
    Swarup

  • Use Of Dictionary Based search help in adobe interactive form

    Hi friends,
       I wanted to export the search help value into corresponding field of Adobe interactive form.
      I am using dictionary type search help in WD context attribute property.  I am able to get the search help popup with right data on form. But if select some value it is not exporting data into the field and getting "entry too longer"  error.
    Can any one help out for this issue.
    Note : Wanted to use only dictionary based search help.
    Thanks in advance
    Naganath Mudale

    thanks

  • Flash CS4 IDE based project and embed metadata tags

    I posted this in one of the other sub-forums before I realised this one was available.
    I am moving over to using the Flex based embed metadata tags to import assets into my Flash CS4 IDE based project. This is working very well but I have hit one small problem - how do you now create a pre-loader? I've done the usual google to look for a solution and found many Flex based solutions and tried them all out but they do not appear to work from within a CS4 IDE based project - even when tried out on a web page.
    Is there a solution to this?

    I'm doing the same thing, it's great to have the embed function, but the swf loads all embed content before anything else.  This for me makes the feature useless. I make games and game sites want everything in one swf, so making a separate swf preloader wont work for me.  Hope Adobe creates a solution for this. 
    Here are my post on the subject:
    http://forums.adobe.com/thread/499997?tstart=0
    and
    http://forums.adobe.com/thread/499994?tstart=0
    Also I submitted a feature request with Adobe, I suggest you do the same.
    good luck!

  • After mixing a project i select bounce and burn the disc that is burned plays on any cd player but when i try to burn the wav or mp3 file that was created the resulting disc will only play in a computer this also happens with video projects help please

    after mixing a project i select bounce and burn the disc that is burned plays on any cd player but when i try to burn the wav or mp3 file that was created the resulting disc will only play in a computer this also happens with video projects help please are there any settings i need to alter as it seems the wav or mp3 file i ceated is being converted to a data file somewhere between the folder and disc drive

    Same thing for a movie file.. If you want to play back the movie via a DVD and a DVD player you must create a Movie DVD  and not just burn files to a data DVD... as Data DVDs are just storage devices for files and therefore will only work with computers...
    Movie DVDs are special formats that include things like menus and special file formats.. so they can playback via a DVD Player...
    You will need a 3rd party DVD Burning app like Toast which is what i actually use.... or the more popular DVD Creator app...to create and then burn a Movie DVD that will playback on a DVD Player....
    https://answers.yahoo.com/question/index?qid=20101220205435AA70beb

  • Multiple Windows without Document based project?

    Is there a way to put multiple windows in my web browser without a document based application? I hate document based projects. A regular project is much easier to work with. What makes a Document based application so special anyway? Thanks in advance.

    Well, it gives you documents. You can save and open them. It keeps track of its windows and its own nib files.
    A document-based application might not be appropriate for your program. You can create windows on the fly. It is a bit more work that way. I don't think I've ever done it. Any applications that weren't document-based also had only a specific number of windows that were all defined in the nib file.
    What do you hate about document-based projects? You don't have to use them. Just keep an open mind and come back later and try them again. It took me a couple of tries before I got the hang of core data. Document-based applications might make more sense the next time around.

  • Webhelp v browser-based AIR Help

    Hi, I 'm going to be writing help for a web-based application for the first time and am trialing Robohelp 9. Can anyone tell me the difference between the published files for Webhelp and browser-based AIR help? Would there be any technical difference in deploying them to a web server? My apologies if this has been answered elsewhere - I couldn't find a reference to it.
    Also (probably a separate question), is there any way to incorporate commenting with either output type? I know this is not supported in the SSLs, but is there a way around it using script? It seems strange that only the 'offline' AIR help includes online commenting. And Adobe's own help pages include it (though they don't seem to use Robohelp!).
    Many thanks in anticipation.

    Hi Susie et all,
    Just spotted this thread and am in the exact same position as you :-)
    Really like the browser-based Air help look and trying to keep up with the limitiations and any issues.
    We cannot use classic Air Help as the help system supports a web-based product and there is no way that the client will allow a 'special' install for a help system.The trouble starts when you start comparing Air Help, browser-based webhelp and browser-based Air help. In Air Help you are teased with the Favourites tab, the comments pod but they are not available for browser-based Air. The search also works differently in Air formats (results in topic window), something I only became aware of a few days ago. You cannot add custom buttons to tool bar in BB Air something I've found very userful in web help. We have also had a few formatting issues and use a different .css for webhelp and airhelp (mainly to get styles to match the different skins).
    There is no doubt that the browser-based Air output looks slick and as John said the skin can be modified to give a corporate feel. But your visitors will need flash player to view content in the left hand pane - its flash that gives it the slick look and feel. I'm trying to run some test this week to find out what will happened without flash player AND to check how the help appears in the various browsers.
    I'm curious, have you had any specific issues with running browser-based help on a webserver? We are still awaiting feedback from developers, but so far they have been unable to get browser-based help running on server - just a blank page with grey background. I'm reassured by Peter's comments so hoping it is some security setting that they can deal with. The most sensible approach now is to try and get webehlp running in same environment.
    I will definitely post feedback and will be following this thread closely now.
    Kind Regards
    Craig

  • I was filling a form online, then I got to where I had to upload an Microsoft document but when I clicked on upload document I only had the option of uploading photos and videos, but not Microsoft doc. Please help.... How do I upload Microsoft doc related

    I was filling a form online, then I got to where I had to upload a Microsoft document but when I clicked on upload document I only had the option of uploading photos and videos, but not Microsoft doc. Please help.... How do I upload Microsoft doc  and other related office documents?

    tis true
    I know, I always do that but I was in a rush to get somewhere and I was relying on my thousand dollar Mac to do some kind of recovery or something. I know Microsoft always keeps temporary files (I think Mac does too, part of me asking here in this forum was for someone to tell me where I can find those files) and when you go to open Office Works then it gives you the option of opening the last recent documents, saved or not saved.
    I usually copy paste into my emial just in case something goes wrong with the created document but I just didn't have the time to login and do all that My loss, you live and you learn, BUT still if ANYONE got any info on this, PLEASE DO CHIME IN *keeping the hope alive*

  • Non Server Based Html Help

    I am using the following call which works perfectly well for
    server based HTML help:
    RH_ShowHelp( pWnd->m_hWnd, pDoc->m_sHelpPath,
    HH_DISPLAY_TOPIC, 0 )
    where pDoc->m_sHelpPath equals
    http://localhost/Help/HelpStart.htm.
    However I cannot get this code to work for non-server based
    help despite my best efforts
    i.e. where pDoc->m_sHelpPath equals
    C:\Inetpub\wwwroot\Help\HelpStart.htm.
    Can anybody offer an explanation?

    To create, you would need a copy of Acrobat pro which comes with designer, which allows you to hide show subforms. See designer forum for more info.
    You can also use the form fields in acrobat perhaps based on page templates.
    The only reason to get a server product with this would be to enable end users of the form to save the pdf using the Free reader. if this is not a requirement (PDF is submitted to a webserver, or simply printed) not sever would be required.

  • Devoloping project help for java projects

    hi
    we have done a project using java swings. now we need to provide project help documentation, and
    that help should be accessed from the menu.
    can u please give me any approch for this?
    thank u
    sarabh.

    You can start from this point.
    http://java.sun.com/developer/JDCTechTips/2002/tt0423.html

  • Text loading and formating in menu based project??? need help

    so here is my deal, code follows, i can get the text to load from a txt. file in the project folder but i can get it to behave the way i need it too. 1. the formating is not working 2. i cant get it to null after i navigate away from the page. I think if i can do those two things i will be done and good to go can anyone help? i have a total of 3 pages that need text to load ad be formated Oct, Nov, and Dec and there al 1,2,3 respectfuly.
    var myFormatOct:TextFormat = new TextFormat();
    myFormatOct.size = 13;
    myFormatOct.leading = 1;
    myFormatOct.align = TextFormatAlign.RIGHT;
    var myTextLoaderOct1:URLLoader = new URLLoader();
    var myTextField_txtOct1:TextField = new TextField();
    myTextField_txtOct1.wordWrap=true;
    myTextField_txtOct1.width = 325;
    myTextField_txtOct1.height = 550;
    myTextField_txtOct1.x = 80;
    myTextField_txtOct1.y = 190;
    var myTextLoaderOct2:URLLoader = new URLLoader();
    var myTextField_txtOct2:TextField = new TextField();
    myTextField_txtOct2.wordWrap=true;
    myTextField_txtOct2.width = 325;
    myTextField_txtOct2.height = 550;
    myTextField_txtOct2.x = 350;
    myTextField_txtOct2.y = 190;
    var myTextLoaderOct3:URLLoader = new URLLoader();
    var myTextField_txtOct3:TextField = new TextField();
    myTextField_txtOct3.wordWrap=true;
    myTextField_txtOct3.width = 325;
    myTextField_txtOct3.height = 550;
    myTextField_txtOct3.x = 600;
    myTextField_txtOct3.y = 190;
    myTextLoaderOct1.addEventListener(Event.COMPLETE, onLoadedOct1);
    myTextLoaderOct2.addEventListener(Event.COMPLETE, onLoadedOct2);
    myTextLoaderOct3.addEventListener(Event.COMPLETE, onLoadedOct3);
    function onLoadedOct1(e:Event):void {
    myTextField_txtOct1.text = e.target.data;
    addChildAt(myTextField_txtOct1,5);
    function onLoadedOct2(e:Event):void {
    myTextField_txtOct2.text = e.target.data;
    addChildAt(myTextField_txtOct2,5);
    function onLoadedOct3(e:Event):void {
    myTextField_txtOct3.text = e.target.data;
    addChildAt(myTextField_txtOct3,5);
    myTextLoaderOct1.load(new URLRequest("myTextOct1.txt"));
    myTextLoaderOct2.load(new URLRequest("myTextOct2.txt"));
    myTextLoaderOct3.load(new URLRequest("myTextOct3.txt"));

    You don't appear to show any attempt to apply the format to the textfields.  You either set it as the default before you add text or set it to the format after it has been written to the textfield.  Here is a link to help documentation that will explain...
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextFormat.h tml
    As far as nulling goes, there is no attempt shown for that as well, so it is not really clear (to me) what you intend/mean as far as nulling it.  To clear a textfield you can just assign iut an empty string... as in ""

Maybe you are looking for