Nib file question

@implementation HelloView
- (id)initWithFrame:(NSRect)frame
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code here.
    return self;
What does this code initialize? I thought it called an object in the foundation code, but apparently it's an object that has been placed in a nib file?

Okay, so NSWindow is actually not an NSViewClass object?
I could instantiate a window with NSWindow code, or else use NSView in conjunction with the nib file which will instantiate the NSWindow object into an NSView object, which can then be subclassed into the application. Is that right?

Similar Messages

  • Simple nib file question

    I believe that all the examples I've seen of nib/xib files have been connections to the corresponding controller or view files, or to the app delegate and the main window,
    Please correct me if I'm wrong, I might just be tired and missing an important clue
    I'm using a Utility Application template, and have most of my work done using the MainView and MainViewController. I'd like to now work on the FlipsideView and FlipsideViewController to display and/or manipulate status and options, which is already in instances/classes in the MainView and MainViewController type.
    How do I access data in the other View, ViewController, or app delegate by connecting buttons and fields from my FlipsideView?
    This may be a "duh! Oh Yeah" question/answer, as in just examine how the FlipsideView is connected to the MainViewController. However, I could use a little leading and pointing here.
    In my test app, I've already created a number of labels for static info, or to hold the value of a field in the other class instances. I'm just trying to figure out how to make the connections. I do have a few of the data elements setup with IBOutlets already.

    When the controllers of separate nibs need to communicate with each other, the best solution depends on the structure of the program and how many controllers are involved. Luckily the discussion gets much easier if we restrict it to the nibs in the Utility template. However, the Utility template that came with SDK 3.0 is quite different from the 2.x version. I'll start with 3.0.
    With the 3.0 Utility template you have a built in communication channel because the flipside view controller is the modal child of the main view controller. That means flipsideViewController.parentController points to mainViewController. And mainViewController.modalViewController points to flipsideViewController.
    So for example, if textField1 is in the main view, and label1 is in the flipside view:
    // in FlipsideViewController.m
    self.label1.text = parentViewController.textField1.text;
    Note however that communication in the other direction is limited to the time the flipside view is active. While mainViewController will always exist when the flipside view covers it, the flipsideViewController is released when its view is dismissed. So in order to export info from flipside to main, you might have the flipside controller save the data ahead of time. For example if the mainViewController needs the text from label2 which is on the flipside:
    // in FlipSideController.m
    parentViewController.copyOfLabel2 = self.label2.text;
    You also mentioned getting data from the app delegate. The app delegate is accessible from any object in the program precisely because it's "the shared application object's delegate". So for example, if mainViewController is an instance variable (with a matching property) of the app delegate, a method of any object in the program could obtain a pointer to the mainViewController, and thus any objects in its view:
    // in AnyClass.m
    #include "MyAppDelegate.h"
    #include "MainViewController.h"
    - (NSString*)getTextField1 {
    myAppDelegate *delegate = [UIApplication sharedApplication].delegate;
    MainViewController *mainViewController = delegate.mainViewController;
    return mainViewController.textField1.text;
    The solution for the 2.x version of the Utility template is based on the fact that both the main and flipside controllers are children of a root view controller. I'll wait to find out which version you have before dealing with the 2.x template.
    Hope that helps!
    - Ray

  • Can i create a home window without using a NIB file

    I hate interface builder, it is a really counter-intuitive piece of junk. Please don't try to convince me otherwise I prefer to do it all in code. Right now i have my whole product running dynamically, creating all the interface objects programmatically as my positioning is all calculated on the fly.
    However I still have one NIB file (MainWindow.NIB) that creates the home window and somehow links to my AppDelegate class, which is the startup class for my app. I see that my main.c routine calls UIApplicationMain() which somehow loads the main nib (hidden magic here), and then eventually my AppDelegate() method which is of calss UIWindow() gets called with an initialize() call followed by applicationDidFinishLaunching() call and off we go.
    Can I create the window dynamically by not using NIBs? Now that we have ipad and iphone to contend with, I would want to create a window that is either 320 x 480 or 768 x 1024 depending on what machine I am on. I would like to get rid of the NIB because I don't understand the wiring stuff and I tried to make a NIB myself but now get a cryptic error message, and anyway the NIB has a fixed size and my app wants to be dynamic now that we have two screen sizes.
    The second part of the question is how do you know what kind of machine you are on? I don't see a Gestalt() routine like in the old mac days so you can tell what machine it is.

    There are always less-informed people who think that a STATIC development tool is somehow more powerful than a flexible dynamic interface computed as one goes. The idea of a static screen form that you control dates back the 80's; modern interfaces are DYNAMIC and interface builder cannot construct those; sure it can perhaps help you lay out things, but if the user turns on certain features then new controls are visible. We have built products with over 500 controls in them and as only perhaps 25 are needed at any one time the software rearranges the screen in the most optimal form at all times. The more advanced the product the more one chafes at a static design tool.

  • Switch between Nib files

    Hi everybody,
    I am struggling with a functionality which I thought of as "simple" at first. A little background:
    1. I have two digital cameras and two nib files containing the GUIs for either camera.
    The GUIs are controlled by two NSWindowController objects (Camera1Controller and
    Camera2Controller).
    2. If no camera is connected show an openning screen GUI (MainAppGUI.xib).
    3. Target behaviour: plug in either camera -> show the right GUI.
    4. The target behaviour may be repeated as often as the user wants.
    What I did? Created a class MainAppDelegate of type NSObject<NSApplicationDelegate>.
    This class is the owner of the MainAppGUI.xib and is the "Main nib file". It receives
    the notifications from either camera when they are connected and tries to load one
    of the Camera1.xib or Camera2.xib. I use the NSBundle loadNibNamed:owner: method.
    Here comes my first question, how can I set the owner of the files? What are the right bindings
    to File's Owner in the interface builder of the Camera1.xib, Camera2,xib and MainAppGUI.xib.
    Do I have to use a document based application? I know that those questions seem like I have
    to read more but I really did and seem to grow just all the more confused not smarter.
    So please any pointers or help will be highly appreciated.
    Best Regards
    artOf...

    Ok

  • System wide failure to load .nib files

    Hi everyone,
    I've recently stumbled across a problem. Several of OS X bundled applications are no longer functioning due to uncaught exceptions in the application.
    1) Mail.app throws an exception and terminates when trying to open an e-mail message:
    *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[NSViewController loadView] could not load the "MessageView" nib.'
    2) Stickies.app (Sticky notes) generates a log record (seen in the console app) when attempting to show a sticky note:
    From the console log:
    -[NSWindowController loadWindow]: failed to load window nib file 'StickiesDocument'.
    But the application is not getting terminated.
    3) Preview.app has stopped working, but is not generating any log records or uncaught exceptions.
    4) Terminal.app generates a log record when attempting to open a terminal window at startup:
    From the console log:
    -[TTWindowController loadWindow]: failed to load window nib file '(null)'.
    There might be other apps that could possibly have the same issue
    Having provided the background of the issue my question therefore is: What might be possible solutions to this? (Except reinstalling OS X which is the last (and only) option on my list)
    Thanks in advance!
    With regards,
    Valentine

    Unfortunately, there is no where to download Apple's applications without reinstalling.
    Do a backup. Boot to the Recovery Volume (command - R on a restart or hold down the option key during a restart and select Recovery Volume). Run Disk Utility Verify/Repair and Repair Permissions. Then reinstall the OS.
    OS X Recovery
    OS X Recovery (2)

  • Why can't I find the "MainMenu.nib" file on my Macbook air?

    I'm trying to remove private browsing from my computer and I need to find the "MainMenu.nib" file... when I go to that directory it isn't there.
    Help please.

    Can someone please help me with my question?
    I'm trying to remove private browsing from my computer and I need to find the "MainMenu.nib" file... when I go to that directory it isn't there.
    I'm running Yosemite.

  • Problems loading nib files after class is split into a static library.

    I've recently split a project so that the common re-usable controls are in their own class library. My original application project now references these using a cross project reference.
    However, since I have split the projects up, my original project crashes when it loads main.xib because it cannot find one of the custom classes which is defined in the library project.
    When I first split up the projects, I noticed that there were problems with the nib files not being able to find the IB outlets of the custom classes, but I managed to get around these by going importing the relevant library class files manually (File > Read Class Files…).
    I have made sure that all of the nib files compile without warning, so as far as I can tell, Interface Builder is able to read the necessary class headers, but when I try to run the app, it crashes saying that there is an unknown class in the Interface Builder file and that the class is not coding compliant.
    Are there any steps I've missed or advice on how to troubleshoot this?

    I did a bit of digging. The reason why this wasn't working is because the class in question was referenced by the nib files, but not in code. Therefore, while the code compiled and there were no warnings with the nib files, the linker was not linking the classes because no code used them directly.
    This can be fixed by going to the Project Settings, and on the Build tab, underneath the Linking heading, adding -ObjC to the Other Linker Flags section.

  • Invalid Binary: "Missing .Nib File" ?

    Dear Adobe Community,
    I have a big problem... When finally I've uploaded the Binary file of my App to iTunnes Conect, I've received several emails like this from Apple after several attempts:
    "We have discovered one or more issues with your recent delivery for "Name of the App". To process your delivery, the following issues must be corrected:
    The binary being analyzed must be an executable: /tmp/mz_4718812371818442247dir/nameoftheapp.zip/viewer.app/viewer
    Missing Nib File - The referenced nib file 'MainWindow.nib' was not found in the application bundle.
    Once these issues have been corrected, go to the Version Details page and click "Ready to Upload Binary." Continue through the submission process until the app status is "Waiting for Upload." You can then deliver the corrected binary."
    I'm going crazy with this. It is the first time that something similar is happening to me, please, someone have the solution for this problem?
    Really appreciate your help and any suggestion from Abode team!
    Best,
    E.

    Just to echo this - we have the same problem. We are going to try renaming the file and resubmitting but the concern must be problems further down the line.
    I am concerned about the process of unzipping and rezipping the file as there may be issues with encryption?
    In addition there are a number of other *~ipad.nib files included in the app build which we have not renamed - however it seems logical that they may also be affected.
    Grateful as the other posters have commented for an update on this issue as soon as you have it.
    Thanks
    UPDATE 12.20pm BST
    We unpacked the file, renamed the file in question, rezipped and sent it off again. This time no error email yet from Apple, and status has changed to Waiting For Review. Seems a bit too easy though....! Hard to believe we won't get another error back in due course, but I guess you never know.
    Message was edited by: tortoise816 to update our situation.

  • How can I switch to a different Nib file with a button

    Hi there Im working on a Xcode application for IOS and I must admit im kinda new to Objective C. This specific application requires me to switch between different nib files. I am having quite a difficult time trying to figure this out on my own so some help would be appreciated. I have got the button linked with an
    - (IBAction) but i can't quite get the coding to get the buttton to open the next application or nib file.
    Thanks ~Cal~

    What i want is that it opens an application menu with several buttons, and then you press one and it opens a new window full of buttons
    and i want it to be a mac osx app:)

  • CGI map file questions, help !!!

    I am trying to use the CGI map file to open web reports. I got two questions at this time.
    1. How to refresh the report to reflect resent edits ? I used the CGI map to open a report. Later, I made some edits to the report and opened it again. However, the browser showed the report before the edit. I had to save the report to different file name and edited the key in the map file to show the edited report. This should not be the right way.
    2. How to open a report on a separated screen which is on top of the original one ?
    Any suggestions? Thanks!
    null

    Hi Kate.
    As far as a find and replace tool is concerned, most of us
    here prefer using some tool such as FAR or BkReplacem as they offer
    more features to help in this kind of scenario. The simple answer
    is however that these tools, as indeed does the inbuilt tool, bases
    it's search on the HTML. Therefore if there are specific instances
    of HTML strings you will have to analyse carefully them before you
    replace anything. It sounds like you are already some down down
    this line. Take a backup of your project and test out your theory.
    As far as your map file question is concerned, you can safely
    reimport your map file PROVIDED that no changes have been made to
    the mapids in the meantime. Personally I wouldn't do this unless
    you are 100% sure of this. If it is a case of having 100s of topics
    that are not mapped and never have been but could be, I'd just
    create a new map file and map away.

  • .nib files showing up as folders

    I have all the developer tools installed but all my .nib files show up as folders in finder. It's a pain in the a$$ to keep having to drag these things to the dock to get them to open. How do I get them to show up as interface builder files?
    --Much Thanks

    Don't worry about them. Among the things iPhoto 6 does when it updates, is updates the content of the thumbnails to be more compatible with iPhoto 6. If you interrupted that process when it was doing it, it may leave behind temporary information that should not be deleted.

  • Error report form iTunes Store: Missing Nib File

    After having uploaded the .zip-file to the iTunes Store (update of an existing app), I got the following error-report from the iTunes store: Missing Nib File - The referenced nib file "MainWindow.nib" was not found in the application bundle. Is it possible that this error occurred while creating the app in the Adobe app builder or where do I have to look for this error? The first uploading of the original app worked without an error. What do you recommend me?
    Thank you very much for an answer.
    Ueli Mattenberger, VMA Media AG, Switzerland

    See http://forums.adobe.com/thread/1277293 and http://status.adobedps.com/ for information on this issue.
    Neil

  • Main window ptr. from separate NIB file

    Hi All,
    This sounds like the simple kind of job a programmer would do everyday, but I haven't been able to figure it out yet.
    My NSObject app has the usual main window and MainMenu.nib file, and my user-defaults are kept in an NSWindowController subclass complete with its own separate Preferences.nib file. It does the job but I'd prefer to attach the prefs window to the main window as a sheet rather than present it as a separate pane.
    Assuming this is possible, I'd at least need a pointer to the main window to start with. How can I get the main window's pointer from within this separate nib file, please?
    Thanks in advance
    Ernie

    Thanks guys. I've figured this out now!
    Ernie

  • Duplicate windows from single nib file?

    I've got a Window inside a Nib file that I want to display multiple copies of, but I have no idea how I would pull this off.
    I've tried existing suggestions of placing the window in a seperate nib file with the File's owner set to the NSWindowController class, and then creating multiple instances of this class with the initWithWindowNibName call, however for some reason this seems to fall short when I add a WebView to the window, as it no longer displays a window when I call the showWindow method.
    Is there a better alternative to achieve what I'm looking for?

    Any update on this ability?  We create many in house videos that need to be encoded to 14 different
    bitrates for use with Flash Media Server as dynamic http streams.
    Currently when I am ready to export a finished sequence, I will pick my first preset and queue it in AME.  Then I duplicate that thirteen times, setting each of the new thirteen queued items to their appropriate bitrates.  Then I have to change each of the output names to be "filename_bitrate.flv".
    This process is much slower when queued in AME than if I exported each individually from PP.  I just don't have the time to manually export each version.
    I have also started noticing that some of the last few projects won't render beyond the quality of the first queued item.  Do I need to render the largest bitrate file first?
    Any indication from Adobe on the correct workflow to create multiple bitrate files to be consumed by FMS as dynamic http streams would be appreciated.
    The link above is dead.  Does anyone have an updated link to the document above?

  • WARNING!!! NSWindow Nib files

    WARNING!!!!
    1) You cannot access a nib file programatically in any case!
    2) You cannot create an NSWindow from within its NSWindowController!
    3) You cannot 'show' an NSWindow from within an NSWindow (you must use an NSWindowController to 'show' an NSWindow)!
    One of the biggest hindrances to learning the manuals is that there are so few warnings on what you cannot do.

    Maybe different things are tricky for different people. The three points I listed would have saved me hours of frustration if I had known them before I started reading on views.
    (The Interface Builder is awesome until you want to change something programatically, which there is usually no need to do. But I am on the side of making more technology available to the public, rather than the same or less. At some point, if everyone could easily change windows programatically, the design of the system might loose its consistency. So there is some real concern from the design side of things. At this point, people should be willing to adopt the Apple patterns for their windows through the strength of the branding, and not because the access to programatically designing them is limited. There may be some security issues as well, which is possible.)
    I'm very satisfied with the fact that I can now launch windows in a number of application design patterns with complete control over their design, which is something that I need to do for this project but may never use again. And it was a little confusing to me, too, that some properties can be set only before a window is shown, and some after.

Maybe you are looking for

  • How to get selected row from table(FacesCtrlHierBinding ).

    I'am trying to get selected row data from table: FacesCtrlHierBinding rowBinding = (FacesCtrlHierBinding) tab.getSelectedRow(); Row rw = rowBinding.getRow(); But import for oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding cannot be fo

  • Error connecting weblogic server 10.3.6.0 64bits

    Hello I installed weblogic server 10.3.6.0 64bits on windows server 2008 R2 64bits. I have jdeveloper 11.1.1.7.0 installed on client machines which are xp pro 32bits and win 7 32bits. When I try to connect weblogic server from jdeveloper it is giving

  • Flash 8 Player security settings Help

    Hi All. Im having some annoying problems with Flash player 8 (the standalone player not web one). I am making a flash portfolio, and am using an XML file to import data (such as images and text) into the portfolio at runtime. Everything works when ru

  • Work center design and operation confirmation

    Hi All, In my scenario im grouping the similar m/c to a work center say for ex. 4 lathes m/c into a single work center as LatheALL and also the indiv cap as 4 my customer wants the traceability in which m/c the job is done So i had designed in such a

  • Start a game with a Button.

    Hi I already have a game. I want to start it with a start button. Just a plain button that when clicked upon, gives way to the stage. help please.Bear in mind I just started actionscript.