FirstResponder missing redo:
Asked Answered
J

2

7

Why my FirstResponder in InterfaceBuilder's file is missing redo: connection (in Received Actions list)? undo: exists, but redo: doesn't. How could I fix it?

Jone answered 16/1, 2013 at 15:0 Comment(4)
I don't understand your question at all, could you please elaborate?Costive
In InterfaceBuilder's file (default name: MainMenu.xib) there always is object named FirstResponder. It always has some default connections. And if you want to implement NSUndoManager you need to use FirstResponder's connections undo:/redo:. And I have implemented NSUndoManager. Added FirstResponder's undo: connection to button witch should do undo function. It works. Now I need redo: connection from FirstResponder to add redo function. And it always could be found in FirstResponder, but now there is no redo: connection in my FirstResponder. Why could it be so?Jone
He means that when he has the First Responder placeholder item selected in a nib file, and has the connections inspector open, undo: is not among one of the listed Received Actions...Leucine
4.5.2. I created new project and there exists both connections in first responder, but in my current project redo: doesn't existsJone
B
17

This is a bug. The workaround is to throw this in a file somewhere:

@interface NSResponder (Redo)
- (IBAction)redo:(id)sender;
@end

Then make your connection in Interface Builder. Once that is done you can delete this code.

Blaeberry answered 28/8, 2013 at 14:36 Comment(0)
L
1

This is a bug in Xcode, it doesn't see the redo: action even though it is there. As a workaround you can create a custom action redo: for making the connection.

See my Radar here: http://www.cocoanetics.com/2013/01/radar-interface-builders-first-responder-is-missing-some-editing-actions/

Lyautey answered 30/1, 2013 at 8:49 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.