Interface Builder Binding leads to death

I have an Array Controller which is updating an NSMutableArray. The NSMutableArray is made up of an Object called Power which has several NSString objects (each synchronized). One of these is called name.
When the user hits an "Import" button, the program reads a file and creates Power objects, adding them to the Array Controller. When it finishes adding Powers it prints them all to console (in this way I know they are all properly formed).
I am attempting to bind the strings of the Power objects to an NSTableView using Interface Builder. I've done more or less the exact same thing in a few other programs with no troubles. However, this time, I can only bind one of the columns successfully.
If I bind any column to the string "name" of the Power objects in the Array Controller, it displays the names just fine. If I try binding any column to any of the other strings, it results in a program crash at runtime (which is being hooked by gdb, but I do not know how to use it).
Does anybody know what might cause this? Why does one NSString bind perfectly to a column when others don't and each object has every field populated?

Can I ask what is your cell/column/table progression?

Similar Messages

  • Can I no longer browse classes in interface builder?

    in tiger, I used to be able to browse classes in interface builder, and from their I could create subclasses, and create actions and outlets. then I could create files for the classes from the classes menu. then when I went back to xcode I would have empty class file templates that I could then write the methods for.
    also, I could easily instantiate my class via the classes menu.
    alas, now I cannot find these features. have they dissappeared entirely? is there an equivilant way to do this?

    I found that disturbing too...
    However the system changed completely. You can no longer define the super-class directly in Interface Build, however you can still define classes there with IBOutlets and IBActions.
    First, to instantiate a blue cube as a custom object, simply drag a blue cube from the Library windows inside : Library --> Cocoa --> Objects & Controllers --> Controllers.
    To set the class, go in Identity inspector (CMD + 6) here you'll be able to define the class name, its outlets and its actions, you can even define the action argument type (sender) here, however, weirdly, they took the ability to add the colon directly at the of the method name, so you'll have to add it yourself.
    However, Apple documentation advise you to add methods and outlets directly in Xcode and not in IB, "Whenever you want to create a new controller class, or add an outlet or action to an existing class, do it in Xcode."
    Indeed, if IB is opened at the same time, it will update the class's outlets and actions directly, Xcode and IB are more binded together than before.
    Message was edited by: PsychoH13

  • Adding navigation items to view controllers in interface builder - pwnd me

    I am perplexed by Interface builder. I had SDK version 2.x (can't recall now) and just upgraded to the newest 3.1 and now things do not work the same.
    So that I could have a custom navigation item applied to my view controller, I have followed the instructions here:
    http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptua l/IB_UserGuide/EditingNibFileObjects/EditingNibFileObjects.html
    in section entitled "Configuring the Views for Additional Navigation Levels"
    When I try to load the nib at runtime I get this error:
    [* Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "EventCreate" nib but the view outlet was not set.']
    The view is set on the controller; however, I did not do anything to set the file's owner since the before-mentioned doc does not say anything about that. It seems the view must be set on the file's owner to make it work. This is confusing.
    I've noticed that the nibs I had set up using the previous release (2.x can't remember now) aren't totally supported in the way I had them set up with navigation items. In IB, I would set the File's Owner to by view controller and then I could drop a navigation item in and connect that right away to the controller, and the controller had a navigation item outlet exposed by default. That doesn't appear to work any more. When I open my older nibs (xib files) the navigation item outlet shows up in the inspector for the controller BUT its greyed out, as if obsolete. There's no navigation item outlet showing in IB anymore, it seems when building new xibs. So, I don't know what to do here.
    Can somebody help me?

    crouchingchicken wrote:
    I would set the File's Owner to by view controller and then I could drop a navigation item in and connect that right away to the controller
    Yes, I agree. The nav item used to show up as an outlet of any view controller.
    When I try to load the nib at runtime I get this error:
    The problem with the doc is this line:
    To push a new view controller at runtime, _create a new instance of your custom UIViewController subclass, initialize it with the nib_ file you created for it, and push it on the navigation controller stack.
    The underlined portion can lead us to believe we can alloc and initWithNibName:bundle: as we would when File's Owner is a proxy for the controller we create in code. But that won't work in this case, since the controller we want is the one that's created from the view controller object when the nib is loaded. In other words, we don't want to alloc a new controller, we just want to grab the object made from the nib. Here's what to do:
    // RootViewController.m
    - (IBAction)nextView {
    NSLog(@"nextView");
    // SecondViewController *viewController = [[SecondViewController alloc]
    // initWithNibName:@"SecondViewController" bundle:nil];
    NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"SecondViewController"
    owner:self options:nil];
    NSLog(@"nib=%@", nib);
    SecondViewController *viewController = [nib objectAtIndex:0];
    [self.navigationController pushViewController:viewController animated:YES];
    // [viewController release];
    Be sure not to release the object obtained from the nib, since we didn't alloc it. Top level objects created from a nib are autoreleased. You can put some logging into the second view controller's dealloc to verify it gets dealloced when popped:
    // SecondViewController.m
    - (void)dealloc {
    NSLog(@"dealloc: %@", self);
    [super dealloc];
    - Ray

  • Style display problem in Web Interface Builder (OWC)

    Hi,
    I wanted to create my own styles for my BPS Planning Layouts and then
    use it in the Web Interface Builder on Office Web Components.
    Step 1 : I saved a Planning Layout in my hard disk.
    Step 2 : I created my styles as explained in the SEM BPS help notes (->
    Format, Styles ) and saved it in Excel.
    Step 3 : I used UPP_MASTER_CHECKIN in tn se38 and then
    UPP_LAYOUTS_UPDATE_WITH_MASTER in order to apply the master template in
    all my layouts.
    Step 4 : I put my styles in all my layouts in the BPS0 (for Lead
    Columns, Head Datas and Data Columns).
    Step 5 : Once I generated my layouts in the BPS0, the result was what I
    expected : the styles were right and at the good place. I checked
    publish for the WEB for all the layouts that needed it.
    Step 6 : I created a Web Interface with BPS_WB using my layouts as
    Office Web Components (Web Excel : true)
    Step 7 : I generate my Web Page
    And when I look at my layouts the styles disappeared....
    However if I modify the Standard Styles (SEM-BPS-headata or SEM-BPS-
    sub1 for example)and put them in my layouts then it works !!!! The
    modified styles appear in the Web Interface Builder.
    I do not understand why it works with the standard styles and not if I
    create and put my own. Did I something wrong or missed a step or is a problem with SEM BPS ????
    Thank you for your help
    J-Michel

    Sorry that note say :
    <b>Styles. Consequently no changes to the SAP standard styles are taken over to the OWC</b>
    I try fix that problem too, go check new design in BW-BPS.

  • After upgrading to Mountain Lion, Interface builder starts up with an error every boot.

    I've got a late 2008 Macbook Unibody 13", and a few months back I upgraded from Snow Leopard to Mountain Lion.  Ever since the upgrade, at every boot up Interface Builder starts up with an error.  I've just ignored it mostly, but now I'm getting annoyed with it.  How can I find the programs that start up every boot to research this, or stop it from loading Interface Builder every time?

    You have to delete it using the minus sign at the bottom. The check/un-check is for hiding items.

  • Load Class in Interface Builder 3

    Hello,
    i am trying to get started with Cocoa after having worked a while with Xcode & smaller AppleScript based projects.
    As my idea was to create a menubar-based (NSStatusItem) service app for myself i started with this tutorial:
    http://files.semaja2.net/NSStatusItem%20-%20ObjC.html
    Unfortunaly it seems like there was a change in Interface Builder regarding loading Classes from Version 2 to IB version 3
    The tutorial tells me to (about the middle of the tutorial):
    Rename the “NSMenu1” to “StatusItem”, following this in “Interface Builder” >>choose from the menu “Classes > Read Files..” now select the AppController.h >>file, Once the file has been read it should change out project view to “Classes” >>from here find the AppController item and right click on it and select >>“Instantiate AppController”:
    I was able to follow the tutorial until there without problems but it looks like the Classes-Tab is gone in IB 3.x.
    So i feel somehow unable to finish this small tutorial.
    how would i do this step in Interface Builder 3.x ?
    Any help is heavily appreciated.
    Best regards
    fidel

    fidel-castro wrote:
    I was able to follow the tutorial until there without problems but it looks like the Classes-Tab is gone in IB 3.x.
    So i feel somehow unable to finish this small tutorial.
    how would i do this step in Interface Builder 3.x ?
    You're right, this has changed. I'm currently using IB 3.1.1 but I believe the changes appeared in IB 3.
    Once you've done the "Read class files" and selected your AppController.h file IB should know about your class.
    In order to instantiate your AppController in IB first go to the Library window and find the "NSObject" (it will appear as a blue cube). Drag one of these NSObject's from the Library window and drop it into your MainMenu.xib window along with the other icons that appear there (File's Owner, First Responder, Application... etc).
    Now you will have created an instance of an NSObject in your MainMenu.xib file. And, since your AppController class is a subclass of NSObject (and IB knows this since you've had it read in your AppController.h file) you can now change this NSObject instance into an instance of your AppController.
    Select the NSObject icon in the MainMenu.xib window then go to IB's Inspector window and click on the next to last icon in the top tool bar. This should change the Inspector window's title bar to say "Object Identity" and the Class Identity in the first text field should be set to NSObject. You should be able to type "AppController" into this field (or click the popup and it should show up in the popup list. Once you've done this it will transform the NSObject instance into an AppController instance.
    You'll see another slight difference between IB 3.x and the tutorial when you do the <Control>-Drag between items to connect up the outlets and actions. Instead of finalizing the connections in the Inspector window like the tutorial says you'll get a small popup window right next to the item you're connecting to that will list the available outlets/actions you can connect to. Simply click the one you want. You can still double-check your connections in the inspector window though.
    Steve

  • Looking for simple sample of iphone apps without using Interface Builder

    I successfully went through the 'iphone app tutorial' and used Interface Builder, but now want to try creating apps without it.
    The UI Catalog sample is too complex, but didn't see anything that just had a view and a button or label.
    Ideally I want code that doesn't require any IB usage, but I can't tell if that is possible yet...
    Anyone have a link to an easy sample?
    Or has anyone created a test app themselves and wouldn't mind posting?
    I took a stab at creating one and posted it on the "101" forum, but it would be hard for somebody to try and figure out what I was attempting
    Thx for any links/___sbsstatic___/migration-images/migration-img-not-avail.png
    ps
    I really need a good book, especially "cookbook" style

    hey dear
    I have one solution of your problem
    just go to in iphone developer search for FAQ
    In faq their is one section how to use prohramming in this you can see
    the how to ceate label,button etc.
    after that simply add the view or remove theview.

  • Cannot open nib - The application Interface Builder quit unexpectedly

    Just installed the iPhone SDK and installed sample code. The Interface Builder will not start. At startup, the following message is displayed: "The application Interface Builder quit unexpectedly."
    I've tried the standard Xcode SDK and it has the same problem. I've repaired permissions on the disk, to no avail. I'm stumped on this. Thanks for any suggestions.
    Here's the first section of the crash report, showing the builds for Interface builder and Mac OS X (10.5.6).
    Process: Interface Builder 8090
    Path: /Developer/Applications/Interface Builder.app/Contents/MacOS/Interface Builder
    Identifier: com.apple.InterfaceBuilder3
    Version: 3.1.2 (677)
    Build Info: InterfaceBuilder-6770000~1
    Code Type: X86 (Native)
    Parent Process: launchd 137
    Date/Time: 2009-01-03 19:29:24.618 -0700
    OS Version: Mac OS X 10.5.6 (9G55)
    Report Version: 6
    Exception Type: EXCBADACCESS (SIGBUS)
    Exception Codes: KERNPROTECTIONFAILURE at 0x0000000000000011
    Crashed Thread: 0
    Thread 0 Crashed:
    0 com.apple.CoreFoundation 0x910272b4 CFRetain + 36
    1 com.apple.HIToolbox 0x911ff566 TThemeFont::SetCTFont(__CTFont const*) + 62
    2 com.apple.HIToolbox 0x911ff4f4 TThemeSpecifiedFont::Init(THIThemeTextInfo const*) + 32
    3 com.apple.HIToolbox 0x9110ccb3 ThemeFontCreate(THIThemeTextInfo const*) + 239
    4 com.apple.HIToolbox 0x9110cb85 TThemeText::ConstructThemeFontWithFontID(__CFString const*, THIThemeTextInfo const*) + 79
    5 com.apple.HIToolbox 0x9110ca49 TCoreTextEngine::Init(void const*, THIThemeTextInfo const*) + 159
    6 com.apple.HIToolbox 0x9110c781 TThemeTextCache::Create(void const*, THIThemeTextInfo const*) + 177
    7 com.apple.HIToolbox 0x9110c659 ThemeTextCreate(void const*, THIThemeTextInfo const*) + 33
    8 com.apple.HIToolbox 0x9110c3b5 DataEngine::GetTextDimensions(void const*, float, HIThemeTextInfo*, float*, float*, float*) + 289
    9 com.apple.HIToolbox 0x9110c250 HIThemeGetTextDimensions + 202
    10 com.apple.HIToolbox 0x912abbad HIClockView::CalculateTextDimensions() + 133
    11 com.apple.HIToolbox 0x912abd82 HIClockView::GetOptimalSizeSelf(CGSize*, float*) + 118
    12 com.apple.HIToolbox 0x9114852d HIView::SendGetOptimalBounds(CGRect*, float*) + 151
    13 com.apple.HIToolbox 0x9114846d HIView::GetOptimalSize(CGSize*, float*) + 53
    14 com.apple.HIToolbox 0x9119bd85 GetBestControlRect + 105
    15 ...terfaceBuilder.CarbonPlugin 0x162f127a IBWindowForHostingCarbonControls + 9638
    16 ...terfaceBuilder.CarbonPlugin 0x162f1b1f IBWindowForHostingCarbonControls + 11851
    17 ...terfaceBuilder.CarbonPlugin 0x162f2766 IBWindowForHostingCarbonControls + 14994
    18 ...terfaceBuilder.CarbonPlugin 0x162f37c8 IBWindowForHostingCarbonControls + 19188
    19 ...terfaceBuilder.CarbonPlugin 0x162eb17a 0x162e5000 + 24954
    20 com.apple.InterfaceBuilderKit 0x002c65e0 -IBLibraryObjectTemplate classesOfPasteboardObjects + 194
    21 com.apple.InterfaceBuilderKit 0x002c64b9 -IBLibraryController typeSummaryForObjectTemplate: + 106
    22 com.apple.InterfaceBuilderKit 0x002c5fc4 -IBLibraryController createAssetForTemplate:inNamespace: + 554
    23 com.apple.InterfaceBuilderKit 0x002c4fe3 -IBLibraryController createAssetsFromTemplatesInNibNamed:forPlugin: + 746
    24 com.apple.InterfaceBuilderKit 0x002c499e -IBLibraryController loadLibraryObjectsForPlugin: + 287
    25 com.apple.InterfaceBuilderKit 0x002c414e -IBPlugin didLoad + 480
    26 ...terfaceBuilder.CarbonPlugin 0x162ea66f 0x162e5000 + 22127
    27 com.apple.InterfaceBuilderKit 0x002c389f -IBPluginController loadPluginAtPath:error: + 2809
    28 com.apple.InterfaceBuilder3 0x00002345 0x1000 + 4933
    29 com.apple.AppKit 0x91f983a3 -NSApplication run + 83
    30 com.apple.AppKit 0x91f658a4 NSApplicationMain + 574
    31 com.apple.InterfaceBuilder3 0x00004eca 0x1000 + 16074

    Thanks for asking. It happens when I click the "Interface builder.app" name in finder and when I double-click an .xib file name in finder.
    As I mentioned, I have repaired permissions on the drive to no avail. I have also read older posts on the web referring to various preference plist files but those don't exist with this build of xcode.
    I have also had older builds of xcode on this mbp and worked thru a couple of tutorials. Interface Builder from those older builds worked. I'm not sure were to get them, now, and I doubt they would have the iphone sdk included.

  • Xcode 4.2.1 crashes when using a QCView in Interface Builder

    Hi, I have been trying to use a QCView in one of my projects but I get a crash everytime. I tried loading the QuartzComposerChart sample application but if I compile the project I get a crash, it just seems to crash when it wants to but I was able to get it compiled if I didn't click on the .nib file. It seems to be related to interface builder anyway.
    Adding a QCView to a new project results in a .xib file not being able to be saved I get this error
    The document “MainMenu.xib” could not be autosaved. -[NSConcreteMapTable state]: unrecognized selector sent to instance 0x402d47420
    Heres my crash log:
    UNCAUGHT EXCEPTION (NSInvalidArgumentException): -[NSKeyValueUndefinedSetter state]: unrecognized selector sent to instance 0x4026f43a0
    UserInfo: (null)
    Hints: None
    Backtrace:
      0  0x00007fff8963726a __exceptionPreprocess (in CoreFoundation)
      1  0x00007fff83bb2d5e objc_exception_throw (in libobjc.A.dylib)
      2  0x00007fff896c34ce -[NSObject doesNotRecognizeSelector:] (in CoreFoundation)
      3  0x00007fff89624133 ___forwarding___ (in CoreFoundation)
      4  0x00007fff89623f48 _CF_forwarding_prep_0 (in CoreFoundation)
      5  0x00007fff88c829b2 _PatchToComposition (in QuartzComposer)
      6  0x00007fff88c5bd47 -[QCPatchController encodeWithCoder:] (in QuartzComposer)
      7  0x00007fff8a60559d _encodeObject (in Foundation)
      8  0x00007fff8dc72814 -[NSNibConnector encodeWithCoder:] (in AppKit)
      9  0x00007fff8dc72599 -[NSNibBindingConnector encodeWithCoder:] (in AppKit)
    10  0x00007fff8a60559d _encodeObject (in Foundation)
    11  0x00007fff8a60678e -[NSKeyedArchiver _encodeArrayOfObjects:forKey:] (in Foundation)
    12  0x00007fff8a606e56 -[NSArray(NSArray) encodeWithCoder:] (in Foundation)
    13  0x00007fff8a60559d _encodeObject (in Foundation)
    14  0x00007fff8dbe5ab7 -[NSIBObjectData encodeWithCoder:] (in AppKit)
    15  0x00007fff8a60559d _encodeObject (in Foundation)
    16  0x000000010aaf0938 -[IBCocoaDocument compiledKeyedObjectsData:] (in IDEInterfaceBuilderCocoaIntegration)
    17  0x000000010aaf10e0 -[IBCocoaDocument fileWrapperOfType:error:] (in IDEInterfaceBuilderCocoaIntegration)
    18  0x00007fff8db59801 -[NSDocument writeToURL:ofType:error:] (in AppKit)
    19  0x000000010a681231 -[IBDocument writeToURL:ofType:error:] (in IDEInterfaceBuilderKit)
    20  0x00007fff8db58769 -[NSDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] (in AppKit)
    21  0x000000010a6846ff -[IBDocument writeToURL:ofType:forSaveOperation:originalContentsURL:error:] (in IDEInterfaceBuilderKit)
    22  0x00007fff8db58b68 -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:forceTemporaryDirectory:error:] (in AppKit)
    23  0x00007fff8db4285d -[NSDocument _writeSafelyToURL:ofType:forSaveOperation:error:] (in AppKit)
    24  0x00007fff8db58911 -[NSDocument writeSafelyToURL:ofType:forSaveOperation:error:] (in AppKit)
    25  0x0000000107ad664a -[IDEEditorDocument writeSafelyToURL:ofType:forSaveOperation:error:] (in IDEKit)
    26  0x00007fff8db61ea7 __-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_8 (in AppKit)
    27  0x00007fff8db61327 __-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_14 (in AppKit)
    28  0x00007fff8db61c80 __-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_7 (in AppKit)
    29  0x00007fff8a7a5a8d -[NSFileCoordinator(NSPrivate) _invokeAccessor:orDont:thenRelinquishAccessClaimForID:] (in Foundation)
    30  0x00007fff8a7a8e65 -[NSFileCoordinator(NSPrivate) _coordinateReadingItemAtURL:options:writingItemAtURL:options:error:byAccessor:] (in Foundation)
    31  0x00007fff8db5725c -[NSDocument _fileCoordinator:coordinateReadingContentsAndWritingItemAtURL:byAccessor:] (in AppKit)
    32  0x00007fff8db45702 __-[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:]_block_invoke_1 (in AppKit)
    33  0x00007fff8db5ab75 -[NSDocument performAsynchronousFileAccessUsingBlock:] (in AppKit)
    34  0x00007fff8db453af -[NSDocument saveToURL:ofType:forSaveOperation:completionHandler:] (in AppKit)
    35  0x0000000107b8b66b -[IDEEditorDocument saveToURL:ofType:forSaveOperation:completionHandler:] (in IDEKit)
    36  0x000000010a6811fd -[IBDocument saveToURL:ofType:forSaveOperation:completionHandler:] (in IDEInterfaceBuilderKit)
    37  0x00007fff8db46d40 __-[NSDocument autosaveWithImplicitCancellability:completionHandler:]_block_invoke_1 (in AppKit)
    38  0x00007fff8db40898 -[NSDocument continueFileAccessUsingBlock:] (in AppKit)
    39  0x0000000107b898db -[IDEEditorDocument continueFileAccessUsingBlock:] (in IDEKit)
    40  0x00007fff8db40cad __-[NSDocument performAsynchronousFileAccessUsingBlock:]_block_invoke_6 (in AppKit)
    41  0x00007fff8db71333 __-[NSDocumentController(NSInternal) _onMainThreadInvokeWorker:]_block_invoke_3 (in AppKit)
    42  0x00007fff882cc8ba _dispatch_call_block_and_release (in libdispatch.dylib)
    43  0x00007fff882ce72a _dispatch_main_queue_callback_4CF (in libdispatch.dylib)
    44  0x00007fff895cc4dc __CFRunLoopRun (in CoreFoundation)
    45  0x00007fff895cbae6 CFRunLoopRunSpecific (in CoreFoundation)
    46  0x00007fff8c1283d3 RunCurrentEventLoopInMode (in HIToolbox)
    47  0x00007fff8c12f63d ReceiveNextEventCommon (in HIToolbox)
    48  0x00007fff8c12f4ca BlockUntilNextEventMatchingListInMode (in HIToolbox)
    49  0x00007fff8d7a23f1 _DPSNextEvent (in AppKit)
    50  0x00007fff8d7a1cf5 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] (in AppKit)
    51  0x00007fff8d79e62d -[NSApplication run] (in AppKit)
    52  0x00007fff8da1d80c NSApplicationMain (in AppKit)
    53  0x0000000107165eec (in Xcode)
    54  0x0000000000000002
    This also happens when I try loading a composition into a QCView. Does anyone know how to fix this?
    Thanks
    Ed

    Glad you posted... I am getting similar messages in xcode 4.2.1
    The document “MainMenu.xib” could not be saved. -[DVTFileSystemVNode state]: unrecognized selector sent to instance 0x40540f920
    I didn't make the connection with QCView until I saw your post. I have several .xib in the project with QCViews and all of them have this same problem.  .xib files without QCViews in them are fine.
    However, my application does not crash, but runs fine. (The xib's and application were written with xcode 3.2, and I can't edit them now in 4.2.1, because I can't save them.  )
    Any other clues would be welcome.
    Thanks
    Keith

  • How to instantiate a control in code instead of using Interface Builder ?

    I really appreciate the combination of the interface builder and Xcode altogether.
    However when I am learning QT, I realize I had been pampered by Apple's Design to a certain extend as I only need to create say a NSLabel instance and use Interface Builder to do the linking and never have to worry about instantiating the Object myself.
    But I'm curious, what is the way to instantiate a new hmmm say...NSLabel in the code ?
    NSLabel* label = new NSLabel();
    Then what ?
    What you are seeing here is how QT did it, could anyone create an equivalent in ObjC ? No fancy code please, just bare minimum.
    #include <QApplication>
    #include <QWidget>
    #include <QLabel>
    int main (int argc, char * argv [ ])
    QApplication app(argc, argv); //NSApplication in ObjC
    //These two lines merely created a window and set the title bar text.
    QWidget* window = new QWidget();
    window->setWindowTitle("Hello World");
    QLabel* label = new QLabel(window);//Create a label and inform the it belongs to window.
    label->setText("Hello World");
    window->show();
    return app.exec();
    Message was edited by: Bracer Jack

    Hi Jack -
    I think my best answer will be something of a disappointment, because I don't know how to show a one-to-one correspondence between the code you're working with and a Cocoa program. The main function of a Cocoa GUI program for OS X will look something like this:
    #import <Cocoa/Cocoa.h>
    int main(int argc, char *argv[])
    return NSApplicationMain(argc, (const char **) argv);
    As you commented, we could draw a correspondence between the first statements, but after that the functionality of the Cocoa program is going to be spread out in a way that makes for a rather tedious comparison. The only way I know to answer your question in less than 5000 words, is to skip ahead to one of several points in the startup sequence where the programmer can intervene with custom code.
    For example, a common way to get control would be to program a custom controller class and add an object of that class to the main nib file which is loaded during the startup sequence. By making a connection to the Application object in that nib file, the custom object could be made the delegate of the Application object, and if we then added a method named applicationDidFinishLaunching, our code would run as soon as the application's run loop was started.
    Now I finally have enough context to directly answer your question, so here is the code to create a label and add it to the key window at launch time:
    // MyAppController.m
    #import "AppController.h"
    @implementation AppController
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSLog(@"applicationDidFinishLaunching");
    NSRect frameRect = NSMakeRect(150, 300, 150, 30);
    NSTextField *label = [[NSTextField alloc] initWithFrame:frameRect];
    [label setEditable:NO];
    [label setStringValue:@"Hello World!"];
    [label setFont:[NSFont labelFontOfSize:20]];
    [label setAlignment:NSCenterTextAlignment];
    NSView *contentView = [self.window contentView];
    [contentView addSubview:label];
    @end
    If I needed to develop a worst case scenario for this thread, the next question would be, "Ok sure, but your code still needs a nib to start up. I want to see a Cocoa GUI program that doesn't require any nib".
    It turns out that it's quite easy to build a simple iPhone app without any nib, but it's considerably more difficult for an OS X app. If anyone wants to see my nib-less iPhone code, I'll be happy to post it (I think I did post it here once before, and the response was underwhelming). But I've never attempted the much more difficult nib-less OS X app. Just in case you really want to go there, here's a blog that goes into the details: [http://lapcatsoftware.com/blog/2007/07/10/working-without-a-nib-part-5-open-re cent-menu>.
    Hope some of the above is helpful!
    - Ray

  • Interface Builder Error: Could not read archive

    I created a new project in Xcode. I double click on MainWindow.xib and it opens up Interface Builder like it should, but then I get an error saying "Could not read archive". This happens every time with any project I have tried to start; please help.

    I' ve the same problem. And if I make a new interface and save it, after a new klick on MainWindow.xib there's tthe error saying too.
    Sorry for my bad Englisch, but I'm German.

  • Could Not Read Archive Interface Builder

    I made a new project in Xcode without tweaking any settings. When I go to open my mainwindow in interface builder I get an error saying Could Not Read Archive. Does anyone know whats going on. Please help as I can't work with my interface files

    I' ve the same problem. And if I make a new interface and save it, after a new klick on MainWindow.xib there's tthe error saying too.
    Sorry for my bad Englisch, but I'm German.

  • File's Owner does not show methods in Interface Builder 3.2.6 but the class is set correctly and the nib on the lower left is green

    Hi, I'm trying to make my first IPhone app. After having problems with interface builder the first time I coppied the code directly from a tutorial in case I made any mistakes. I saved the program, and re-opened the .xib file. Right clicking  File's Owner does not show a list of methods. I've been looking around for solutions for this but have not gotten anything to work. I tried deleting the default .xib and creating a new one through file-> new file. This did not help. I did notice that File's owner was showing up as a light blue cube apposed to a yellow one now and found that a bit odd but otherwise nothing changed. I opened the library menu and selected helloWorldiPhoneViewController so it would show up in the view port. I set the class field of File's Owner to hellowWorldiPhoneViewController. File's Owner still does not show methods when right clicked or when a line is dragged over a button. I read somewhere that the color of nib on the lower left of the viewport may indicate a problem, but it is green not indicating any issue. Every solution I found for someone else seems nto to work for me and I don't know how to continue.
    here is the .h file just in case:
    //  HelloWorldViewController.h
    //  HelloWorld
    //  Created by Paul Peelen on 2011-03-14.
    //  Copyright 2011 9697271014. All rights reserved.
    #import <UIKit/UIKit.h>
    @interface HelloWorldViewController : UIViewController {
            UILabel *textLabel;
    @property (nonatomic, retain) IBOutlet UILabel *textLabel;
    - (IBAction)changeTheTextOfTheLabel;
    @end
    I'm trying to connect changeTheTextOfTheLabel to a button and textLabel to a label

    You need a parameter for an interface builder method. The type should be id and the name is typically "sender". It would look like this:
    - (IBAction)changeTheTextOfTheLabel: (id) sender;
    Be careful about those tutorials. Many are ancient and do not correspond to current Xcode behaviour.

  • How to make a form for input in web interface builder

    Hi expert:
        How to make a form for input in web interface builder?I have already used it to do PS planning, but I don't know how to  draw lines and checkboxes . Thanks in advance.
    Allen

    WAD:
    Open the WAD and create a new template. On the left hand navigation you will have several Web Items available. Under 'Standard' you have 'Analysis' item. Pull that into your template to the right. Under the Properties tab you need to pick the query [form/layout] that you have built in Query Designer.
    You will also find other items such as Button group, Checkbox, drop down, list box etc available. Pick and drag into the template whatever it is you require. Lets say you want a button. Under the Properties tab select the 'Command' that you require. You could use standard commands that are available there. You could also define functions and commands that you require.
    Query Designer:
    Open the QD and drag the characteristics and key figures that you require into the rows and columns of the QD. You would need to specify restrictions under the Filter tab of the QD based on the granularity of data that you require. You would need to remember that the key figures need to be made Input Ready [do this by clicking on KF and on the planning tab select "change by user and planning functions"].
    This shouldgive you a start. After you've explored it yourself a bit we can discuss further and I can certainly provide you additional details/material on these areas.
    Srikant

  • Trying to make a NSMatrix (of NSButtons) in Interface Builder 3.0

    In Interface Builder 2.x, to make a NSMatrix of NSButtons, all you had to do was option click and drag a corner after the guidelines appear till you had a NSMatrix. For some reason you can't do this anymore with IB 3.0. Does anyone know how to make a NSMatrix of NSButtons?

    I found out how. It's not the same, but basically you have more freedom. Just option drag a button, again and again till you have your pseudo NSMatrix built. After this go under Layout, to Embed Objects In ->, to Matrix, with all the buttons selected, then you have a NSMatrix.

Maybe you are looking for

  • I am having trouble with my new Mac....Help please

    I just got a new Mac G4 from my neighbor, who happens to be older, so the computer is still in great condition. The only problem is, he doesn't remember the login password! So I can start the computer, but I can't actually login. And I've tried to pu

  • Error in( F110) Automatic payment Program

    Hi, while posting the payment through (F110) Automatic payment program , i have got the Error that " Error in creating the payment document; read job log" please help me out Thank you

  • HT204291 AirPlay a video but only sound playing on tv and no picture, what can I do.

    Anyone know why there's sound but no picture when AirPlay a video ?

  • Container Element Value in Runtime

    I am somewhat new to Workflow. I have an error status on WorkFlow, for the reason that the value is not retrieved for the Container Element in the Workflow Condition. How can we check that whether the value is being retrieved by the container element

  • Full screen photo as caller ID

    Hi, is there a way to have full screen photo as caller ID even if I have my contacts synced with gmail. Otherwise is there a way to unsync contacts without have them deleted from iPhone? Many thanks. Ciao, Andrea