I'm trying to determine the architecture of another file from my application. I'm using my application bundle and comparing it to a different bundle in my example. The methods are in place and they do return values to NSLog, although they are not the values I was expecting. Can anyone make some sense as to how to interpret the returned values?
- (void)whatArch {
NSArray *x86_64_Arch = [[NSBundle mainBundle] executableArchitectures];
NSArray *i386_Arch = [[NSBundle bundleWithPath:@"/path/to/other/bundle"] executableArchitectures];
NSLog(@"%@ %@",[x86_64_Arch componentsJoinedByString:@" "], [i386_Arch componentsJoinedByString:@" "]);
}
The output I get is:
2012-07-09 00:00:59.990 whatArch[2200:403] 16777223 7 18
The [16777223] is the value that returns for the x86_64 bundle, and [7 18] for the (other) i386 bundle. When I read the documentation on executableArchitecture it shows something much different:
These constants describe the CPU types that a bundle’s executable code may support.
enum {
NSBundleExecutableArchitectureI386 = 0x00000007,
NSBundleExecutableArchitecturePPC = 0x00000012,
NSBundleExecutableArchitectureX86_64 = 0x01000007,
NSBundleExecutableArchitecturePPC64 = 0x01000012
};