nsbundle - Objective-C, NSArray from executableArchitectures -


I am trying to determine the architecture of another file from my application. I am using my application bundle and am comparing a different bundle in my example. The methods are in place and they return the values ​​to NSLog, although they were not expecting the values ​​I was hoping for. Does anyone mean something, how to interpret returning values? - (zero) what current {nsara * x86_64_Arch = [[NSBundle main bundle] executable arcotecture]; NSArray * i386_Arch = [[NSBundle bundle path: @ "/ path / from / other / bundle"] executable architecture]; NSLog (@ "% @% @", [x86_64_Arch ComponentsJodged BustString: @ ""], [i386_ Arch ComponentsJointedBustString: @ ""]); }

The output I get is:

  2012-07-09 00: 00: 59.990 What Arch [2200: 403] 16777223 7 18   

[16777223] The value that is given for the x86_64 bundle, and [other] for the i386 bundle [7 18]. When I read the documentation on it, it looks a bit different from this:

These constants describe CPU types that can support the executable code of a bundle . enum {NSBundleExecutableArchitectureI386 = 0x00000007, NSBundleExecutableArchitecturePPC = 0x00000012, NSBundleExecutableArchitectureX86_64 = 0x01000007, NSBundleExecutableArchitecturePPC64 = 0x01000012};

  NSLog (@ "% u 0x% x", 0x01000007, 16777223 ); // print 16777223 0x1000007 NSLog (@ "0x% x% u", 18, 0x00000012); // print 0x12 18   

I'll leave 7 and 0x7 as a practice for the reader.

And do you know?

Comments