【问题标题】:Query not giving result in iOS 7在 iOS 7 中查询未给出结果
【发布时间】:2025-12-12 21:05:02
【问题描述】:

我在我的应用程序中使用 sqlite 并且有一个在 iOS 6/iOS 5 中运行良好但在 iOS 7 中没有给出结果的查询查询是:

 Select `user_name`, `user_udid`, `id_ipad` from tablename WHERE user_id ='%@' AND id_ipad = 1 LIMIT 0,1",[[UIDevice currentDevice] uniqueIdentifier]]

在里面

[[UIDevice currentDevice] uniqueIdentifier] 

返回正确的值。

我对 iOS 7 的 SQlite 数据库进行了哪些更改? 或者某些方法被贬低了..? 或 .. 查询中是否有任何特殊字符不适用于 iOS 7..?

请帮忙

【问题讨论】:

  • 首先检查参数了吗?
  • 是的,我已经检查过了..如果参数不存在..那么它一定不能在 iOS6 中工作。
  • 您是如何使用设备 UDID 的?查询前检查tempDic
  • 它返回正确的值。我正在使用 [[UIDevice currentDevice] uniqueIdentifier]
  • 不,你不是——它在 IOS7 上不存在,并且即使你在旧应用程序中调用它,它也不起作用

标签: ios ipad sqlite ios7


【解决方案1】:

原因是 UIDevice.uniqueIdentifier 已从 iOS 7 中的 UIDevice 类中删除。

改用此类的identifierForVendor 属性或ASIdentifierManager 类的advertisingIdentifier 属性

更多详情,请前往this link.

【讨论】: