views:

43

answers:

1

Is it possible to hide certain application settings in standard Settings application based on current device capabilities? For example user can choose whether to show compass calibration UI or not, but I don't want to show this setting if device does not have a compass (e.g. iPhone 3g).

Well, I think that is not possible actually but may be I missed something simple here (or any other available options)...

A: 

It is possible, and it's recommended to do this. One example is to check whether the device can make phone calls:

if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"tel:"]]) {
    // do stuff with a phone number
}

There are other ways to check device capabilities. Check the documentation to find them. For example, the CLLocation docs have a +(BOOL)headingAvailable method, which tells you if you can find out the heading.

nevan
Yes, I know how to disable related features **inside** application. What I want to do is to hide preference outside my app - which is defined in Settings.bundle and displayed in standard Settings app.
Vladimir