IBAction not appearing in xib file (A) - xcode

I have added a normal file, and in the .h file I've added the following code:
-(IBAction)PushButton;
My problem is, the action doesn't appear in the xib file when I go into "File's Owner".
I only have the problem with my "A" files. It works perfectly fine in the "M" files.
Any ideas?

May you have not set the class name in the xib

Related

.swift viewcontroller missing (!)

In my project navigator, a .swift file that connects to a viewcontroller has an "!" next to it and says that it's "missing".
When I click on the file, it shows the code for that viewcontroller, and my app works, but the title bar in the mainstoryboard for that viewcontroller doesn't match the file name.
I'm not sure what the problem is or how to fix it. Thanks!

Add both .h and .m files in Xcode

When I add a new file in Xcode 6.3.2 I see templates for the .m and .h file but how do you add both at once?
I'm sure there used to be a way of adding both at once.
The option has been moved into the more generic "Cocoa Touch Class" template, which allows you to make the class in either Objective-C or Swift.
Complete the name of your pair of files with the default prefix filled-in for you. Choose the superclass such as NSObject. Choose the Objective-C language. Click the Next button, then choose the folder location where to save your pair of new .h and .m files.
You can do this by add new file and "Cocoa Class"

File's Owner 'view' outlet not showing

I created a project in Xcode 6 beta 2, which initial had a storyboard. I wanted to work with separated xibs so I removed storyboard and line related to storyboard from Info.plist and added several xibs. Now the problem is that I can't connect file's owner 'view' outlet (because it's not visible) to view from xib. First thought was that I misspelled name of the file's owner custom class name (from Identity Inspector), but I didn't. Also file's owner class is a UIViewController child. I don't know that the problem can be. Did some faced this issue ?
It's probable that you need to close Xcode, clean the project and try again. I created a new project without storyboards and I did the following:
1) I created the nib file.
2) I created the UIViewController class.
3) I opened the nib and selected the File's owner tab. Then I wrote the name of the custom UIViewController class.
4) Without selecting the file's owner tab on the Placeholders left bar (make sure of this) go to Connections inspector tab and you should see the view outlet.
Simply cleaning, quitting Xcode and re-opening fixed it for me.

Xcode 5 can't open .m file

I installed Xcode 5 a few hours ago. I opened my project with it. I have several .h and .m file in my project. I could view all of them except one of my .m file. When i clicked that .m file, the cursor became rainbow and nothing happened.
To be sure , i checked my project folder, go to the that .m file and click get info. I could see the preview of that file. Also i could open it in text editors.
I couldn't find the problem. Any advice is appreciated.
Best Regards,
Taha
I created a new project to check that .m file. And the result is positive. But still i can't open that .m file in my real project.
Weird solution but works for me.
1) Delete .h and .m files.
2) Right click on xx.xcodeproj and click show package contents.
3) Delete project.xcworkspace.
4) Add .h and .m files again.

XCode has lost associating from xib to .h file (MonoTouch)

When I am editing an XIB in XCode I don't get the associated .h file to show up in the assistant editor window. Other XIB's work fine.
This is a problem as it's the way I create outlets by dragging onto the assistant window. If I open the .h file manually in another window I can't associate an outlet this way either. The .h file exists.
Also, my project is MonoTouch and therefore I invoke the opening of the file from MonoTouch. I assume it's a problem originating in MonoTouch and not Xcode.
Someone please help, or I will be forced to learn Objective C soon and quit with this MonoTouch business.
Sometimes there is a different solution, such as when the controller file is RENAMED.
When this happens, edit the .XIB file with the Source Control Editor (right click on .xib, Open With->Source Control Editor), and make sure that all references to the name of the controller are correct and that the path and name of the .h file are correct.
Look in the "IBClassDescriber" element specifically. The "className" under the "IBPartialClassDescription" element and the "minorKey" under the "IBClassDescriptionSource" element must be correct. MT will generate a .h file with the same name as the controller.
After making the changes, save the file, choose Build->Clean All, then double-click the .XIB file to open it in XCode.
It may or may not work for you, but it worked for me when everything else failed.
As Stuart mentioned in his comment, deleting the /obj folder under the project which contains the .xib files, force MT to regenerate .h files
Came across the same issue and removing the /obj directory and restarting did the trick.
MonoDevelop 3.0.3.5 with XCode 4.4.
Was rather confusing as I am came across issue whilst on first MonoDevelop iOS Helloworld tutorial.
In my case, this issue has appeared when I change a namespace in .cs view controller file according to the file location. But after that, I caught this issue. When I have returned namespace to incorrect variant I got back my .h file.
Update:
You need to change the namespace in view.cs and in view.designer.cs, then Xcode .h file will be generated correctly.

Resources