Home > Could Not > Could Not Connect The Action To Target Of Class Nswindowcontroller

Could Not Connect The Action To Target Of Class Nswindowcontroller

I just don't know how to get rid of the message. Join them; it only takes a minute: Sign up Could not connect the action: to target of class NSApplication up vote 10 down vote favorite 4 I keep getting Could not hook things up to File's Owner, and it should work fine since your view controller really will be the object that's loading the file. Reply With Quote 03-17-2011,12:26 PM #2 ukchucktown View Profile View Forum Posts Member Since Oct 26, 2009 Posts 128 Usually you need to register a control with a target. Source

So is it not possible to instantiate and connect view-controllers from within IB at all? But it runs "against the grain" of the document architecture, so it'd be more work. You have two options for handling action messages. If you haven't done so already, you want to drag a NSObject out of the Object Library palette in Xcode 4 to the margin to the left of your layout.

Once that's done, drag a control onto the view object in Interface Builder then open the File's Owner and click the little Arrow icon in the Utilities window. I call it a "window controller" because that's the class it's derived from, you're calling it a "view controller" because that's the role it plays in your app design - but Good luck! The above uses a hard-coded Nib name, and it doesn't specify a Nib owner, which means the view controller will be the Nib's owner.

Apple Hardware Apple Desktops Apple Notebooks Apple TV Other Hardware and Peripherals Developer Playground iOS Development OS X - Development and Darwin « Previous Thread | Next Thread » Thread Information What class have you implemented -startServer: in? Why is Cocoa at runtime trying to connect those actions to MyDocument rather than MyController? This may not, however, be what you want - what you may want instead is to instantiate your controller object to is appears in the same icon view as the File's

They will be ignored. > Cocoa-dev mailing list () > Help/Unsubscribe/Update your Subscription: > http://lists.apple.com/mailman/options/cocoa-dev/ > > This email sent to Because File's Owner's Custom Class is usually To start viewing messages, select the forum that you want to visit from the selection below. Copy my applicationDidFinishLaunching() into yours and run. –yohon Oct 10 '14 at 8:56 add a comment| 1 Answer 1 active oldest votes up vote 0 down vote Replace the below line Somehow I seem to have got away with it before in a previous document-based application, but thinking about it...

The time now is 10:54 PM. Drag the blue line on top of the control to hook the control to the instance variable (outlet) in your controller. Then, in your document class, delete the -windowNibName and override -makeWindowControllers instead, with something like this: - (void) makeWindowControllers { MyViewController *vc = [[MyViewController alloc] initWithWindowNibName: @"MyDocument"]; [self addWindowController: vc]; } Help please.

Chances are it's not liking the fact that you've > "reassigned" > File's Owner. Instead, do that in your > document class' -windowControllerDidLoadNib: method. Somehow my xib is trying to invoke startServer method in NSApplication which doesn't exist. Create a new Cocoa Class ("Child") with base class "NSViewController".

My resume: http://www.dot-app.org Hamish Allan Re: Could not connect the action to target of class Mar 12 2005, 21:10 Thank you, Sherm, for such a comprehensive reply. this contact form Rename the NSObject a suiting one. Does Wand of the War Mage apply to spells cast from other magic items? Not the answer you're looking for?

I don't understand why OSX is so different to iOS development using NSObject? –Dale Clifford Jul 13 '15 at 10:54 add a comment| up vote 0 down vote You've made a I've changed back the custom class of my File's Owner to my Document class, added a new IBOutlet myWindowController to that class, instantiated my Controller object in IB, and connected the The first option is good if you > want your view controller to do something in addition to sending a > message to the document, such as tell some view objects have a peek here It's a similar process for the actions.

James Hamish Allan Re: Could not connect the action to target of class Mar 11 2005, 02:56 On Mar 11, 2005, at 1:31, James McConnell wrote: > Because File's Owner's Custom Chances are it's not liking the fact that you've "reassigned" File's Owner. Is it possible to have 3 real numbers that have both their sum and product equal to 1?

Now that you've got a representation of your WindowController, which as you said contains startServer:, then you can connect your UI element to that.

Update Cancel cacau Yeah, these kinds of problems don't really show up at runtime (at least with the default settings/flags/env variables) unfortunately. Not at all, I should have said "I don't need multiple window controllers, but would you agree with me that I need at least one?" which is what I really meant. Thanks, Hamish Sherm Pendley Re: Could not connect the action to target of class Mar 11 2005, 18:01 On Mar 10, 2005, at 8:31 PM, James McConnell wrote: > Because File's Apple Store Mac iPod iPhone iPad iTunes Support Search Re: Could not connect the action to target of class [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: Could not connect

Update CancelAdd Comment Add comment Cancel Your Answer Post answer By posting your answer, you agree to the privacy policy and terms of service. Sorry for the confusion! Your view is different with different controls and variable names. Check This Out more hot questions question feed lang-c about us tour help blog chat data legal privacy policy work here advertising info mobile contact us feedback Technology Life / Arts Culture / Recreation

Getting error message when integrating a simple piecewise function Is it bad form to write mysterious proofs without explaining what one intends to do? Hint :configure your browser Monospace font in the Preferences. You change the type of File's Owner in that file to you view controller class! It's kind of difficult to explain how it works in Interface Builder.

Tweet Thread Tools Show Printable Version Subscribe to this Thread… 03-17-2011,12:07 AM #1 chris_284 View Profile View Forum Posts Member Since Mar 16, 2011 Posts 3 Getting an error connecting to I got my terminology from Apple's "Document Architecture" document: http://developer.apple.com/documentation/Cocoa/Conceptual/ AppArchitecture/Concepts/DocumentArchitecture.html which talks about NSDocuments being model-controllers and NSWindowControllers being view-controllers.