我無法確定我在做什麼錯誤。我在ipad上使用下面的代碼,每次對if語句返回true。相同/相似的代碼工作的目標CcanOpenURL似乎並沒有在迅速工作
我的代碼:
phoneNumber = "5155555555"
var url:NSURL? = NSURL(string: "tel://" + phoneNumber)
if (UIApplication.sharedApplication().canOpenURL(url!)) {
//do stuff
目標C(可正常工作)
if([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:phoneNumber]]) {
您是否正在運行iOS 9? – HAS
@HAS不,iOS 8.4 – BluGeni