Why can't I set a link for my NSTextView in Xcode 4?

I am making a simple dialog in Xcode 4 using Interface Builder. I have three NSButtons, all of which are connected to the corresponding IBOutlets. However, I have an NSTextView that I would also like to attach. I have an ad for it in MyDialog.h :

 @interface MyDialog : NibLoaderOC { @public IBOutlet NSTextView* tv; IBOutlet NSButton* acceptButton; IBOutlet NSButton* editButton; IBOutlet NSButton* rejectButton; } @end 

But when I drag the line "New abstract line" over tv , it will not stand out. If I try to make a new outlet, she will say:

Unable to insert new output connection: Could not find information for class named MyDialog

I tried restarting Xcode, it does nothing. What am I doing wrong?

+4
source share
4 answers

Although I would still be interested in the correct solution, I fixed it by simply manually editing the xib code to create the link.

This has an unfortunate side effect of the Interface Editor, which does not want to play well with the file (although all my edits were correct, and the code compiles and works fine).

+1
source

I noticed that the .m file was moved inside the en.lproj folder.

Just delete (link only) .m file from Xcode and move .m from en.lproj. Add it again. This will fix the problem.

Do not worry, you will return all your connections.

+3
source

I got this error in xcode 4.6.0. restarting xcode did not fix it for me. deleting the received data for the project, and then restarting xcode eliminated it.

delete / Users / myusername / Library / Developer / Xcode / DerivedData / MyProject

+1
source

Another thing to check is to make sure that if you have a custom class that you specified in the Custom Class section in the Interface Builder Identity Inspector.

So for example, if you have the following ad

 @interface MyViewController : UIViewController { @public IBOutlet MyCustomView* aCustomView; } @end 

Make sure you add this to the inspector as shown. Otherwise, I found that you cannot connect it.

Inspector view

+1
source

Source: https://habr.com/ru/post/1379511/


All Articles