Does TargetMachO="Target Apple"?

With my cross platform projects, I leverage Ohanaware App Kit features in the Mac versions.

Thus, when I get a new release of OAK, I spend some time inserting “#if TargetMacOS or TargetIOS” into its methods, until cross-platform debug runs stop complaining. Then I export my tweaked OAK to put into the other projects. This takes a little time, but isn’t too overbearing.

I’m wondering whether “#if TargetMachO” would do just as well. Or would this just be an equivalent to TargetMacOS? From the documentation, I’m still not sure.

Thanks in advance.


Well MachO is the executable firmst and it currently means Apple.
But in earlier days we had PEF as format.

1 Like

“Classic” support hasn’t been an issue for many years, so I’ll take that as a “yes” :slight_smile:

1 Like

MachO originally meant “MacOS”
And may still

#if TargetMacOS or TargetiOS

is likely safer


Actually it’s Mach-O for the file format

1 Like

An interesting discussion between two gentlemen I respect very much. I’ve already moved the “solved” button once, and may now just remove it. :slight_smile:

As I understand Christian (and I vaguely remember), back in the day, TargetMachO was there to differentiate Mac OS X code from anything expected to also work in OS 9. One could infer that today it would work as I asked. Then again, Norman has gotten his hands dirty under the hood with Xojo.

This may be worthy of an experiment. :slight_smile:

1 Like

I’m just referring to Xojo’s use of the name TargetMachO
Whether iOS uses macho isnt really relevant IF TargetMachO in Xojo means “macOS”

TargetMacho came into being around the time there was Carbon & Cocoa

You can quickly tell if it applies to iOS
In a new ios project in App.Opening just put

#if TargetMacho

I doubt you ever hit the break

1 Like

I’ll let you know.

Oh, case makes a difference. “TargetMacho” is rather amusing. :slight_smile:

iOS also uses Mach-O as executable file format.
So the break should stop there.

You prove correct, Norman. With the test project (named ‘Macho Camacho’), it did not break, which means it’s broken :slight_smile:

For good measure, I added a pushbutton which presented a message box with conditional text, and “No it doesn’t work” was produced.

So despite what logic and Christian say (the two go together), you are correct in what TargetMachO actually does. I’d say it is simply obsolete.

TargetMacho has NOTHING to do with the file format
Despite what it seems

It probably should be removed as TargetCocoa made more sense

TRY my little test - you wont hit the break point on iOS
I knew that before I posted the suggestion here :slight_smile:

Norman, I know you were addressing Christian, but I mentioned above that I “did” do the test. :slight_smile:

I saw that
And it came out precisely as I knew it would :stuck_out_tongue:

1 Like

…and I was hardly surprised. :slight_smile: