开发者

how to create a device specific app in objective c

开发者 https://www.devze.com 2023-01-27 18:29 出处:网络
I want to create an app which is 开发者_如何学JAVAspecific to the device type.Say my app should work only oniPhone but not on iPad or iPod even if it (the app) has common features.[[UIDevice currentDe

I want to create an app which is 开发者_如何学JAVAspecific to the device type.Say my app should work only on iPhone but not on iPad or iPod even if it (the app) has common features.


[[UIDevice currentDevice] model]; would give you the current device model.

Now, compare strings with the isEqualToString: rather than using the comparison operator.

Once done, you should write the functionality that you want to run, after doing the comparison.


If your application is for App Store distribution you may be able to use the UIRequiredDeviceCapabilities key of Info.plist to produce a sufficiently restrictive set of requirements. Make this entry a dictionary and then for example setting a telephony=false value would exclude phone devices, still-camera=false value would exclude (current) iPads etc. The iTunes/App Store will then not allow a user to install the app on an unsupported device

0

精彩评论

暂无评论...
验证码 换一张
取 消