Why can't I add code to project after compiling in xcode

I have been following an online tutorial to on programming in Unreal Engine 4 (- YouTube).

(The tutorial is for Windows, but currently there is a real shortage of tutorials and documentation related specifically to Mac and Xcode.)

I created a new Actor by going to File > Add code to project… > and adding an actor. After naming the new actor I clicked “Create Class” which opened Xcode. I then edited the .cpp and .h files for the new actor and compiled using “Product > Build For > Profiling”.

After The build completed successfully I returned to Unreal editor and tried going to “Add code to project…”. Clicking on “Show All Classes”, and searching for the new Actor.

The actor is not listed. I tried quitting the editor and re-opening it multiple times, but the new Actor still does not appear.

I also tried “File > Refresh Xcode Project” then tried recompiling the project in Xcode and opening and closing Unreal Editor several more times, but still nothing.

I havn’t found much detail on using Xcode and Unreal, so I am hoping someone can tell me why I can’t see the new Actor reference? What am I doing wrong?

I figured out the problem!

My scheme settings where wrong and I needed to switch them using the dropdowns next to the build and stop icons at the top of the xcode window.

Originally it was set to:
MyProject > My Mac 64-bit

I had to change it to:
MyProjectEditor > My Mac 64-bit

The correct Scheme had an unreal engine logo next to it, so I should have noticed this much sooner :slight_smile:

Building is still done by going to Product > Build For > Profiling (the default build button compiles in Debug mode which required running the editor in Debug mode also).

After building I have to close and reopen the Unreal Editor to see the changes, which is a pain when you are working on functions that need a lot of testing in the editor, but at least everything is working now.