简体   繁体   中英

xCode can't Control-drag into .m file

I'm trying to change the results field in the sample app SimpleURLConnections in the AppleDeveloper Library from an Image View Object in the GetController.m to a Text View so that it will display responses that aren't images. (I know some code that checks the response type also needs to change.)

When I drag a Text View object (or ANY object) from the Utilities pane to the MainWindow.xib in the editor pane, it appears to be created ok but when I try to Control drag from the Text View into the @property area of GetController.m , I don't get any "Insert Outlet.." popup or new entry in the GetController.m file? (By experimentation, I can get it to populate an IBOutlet in the AppDelegate.m file.

What am I doing wrong?

Thanks,

Rick

It may be because you are doing it wrong.You added the textview to mainWindow and Getcontroller is a controller entity[its a view controller i think.] .An xib will be connected to the outlet if and only if it has the custom class correctly set to that class.

Add a view controller with custom class in attribute inspector set to that Getcontroller and then you can connect the outlet

当您将控件拖到**。m时,应按“控件”键,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM