Questions concerning problems with code you've written must describe the specific problem — and include valid code to reproduce it — in the question itself. See SSCCE.org for guidance.
Closed 10 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
我尝试使用 containsString 但 xcode4 不允许使用
以下是我解决它的方法:
希望这会有所帮助,即使它有点晚了。
I tried using containsString but it was not allowed with xcode4
Here is how I solved it:
Hope this helps even if its a bit late.
您可以使用
UI_USER_INTERFACE_IDIOM()
,它将返回UIUserInterfaceIdiomPhone
或UIUserInterfaceIdiomPad
。请记住,在任何设备上< 3.2,这是不可用的,因此首先检查是否可以检索该属性 - 在本例中,它不是 iPad。或者,要具体确定该平台是否为 iPad,请使用
希望这会有所帮助;)
You can use
UI_USER_INTERFACE_IDIOM()
, which will either returnUIUserInterfaceIdiomPhone
orUIUserInterfaceIdiomPad
. Bear in mind that on any device < 3.2, this is unavailable, so first check to see whether the property can be retrieved - in this case, it is not an iPad.Or, alternatively, to specifically work out whether the platform is an iPad or not, use
Hope this helps ;)
很好地尝试模拟器:
它提供了iPad模拟器,当我拿到设备时会更新答案;)
Well trying on simulator:
it gives iPad Simulator, will update the answer when I will get the device ;)
您可以尝试Apple 开发者论坛。
You might try the Apple Developer Forums.