views:

111

answers:

2

Is the following allowed by the app store review process?

- (NSString *) platform
{
size_t size;
    sysctlbyname("hw.machine", NULL, &size, NULL, 0);
    char *machine = malloc(size);
    sysctlbyname("hw.machine", machine, &size, NULL, 0);
    NSString *platform = [NSString stringWithCString:machine encoding: NSUTF8StringEncoding];
    free(machine);
    return platform;
}
A: 

Since there isn't an obvious practical reason to do this, I doubt the question has come up.

Chuck
+1  A: 

This code looks exactly the same as the code on this blog post. Irrespective of what you're trying to do with knowledge of the device type, this will go through the App Store review process without problems.

shek
Thanks a ton...
Worth pointing out too that according to at least one comment on the blog post, that exact code was specifically give as an example by Apple as a way to determine the capabilities of the device.
Coxy