小编Rah*_*hur的帖子

成员'计数'含糊不清

将当前的Xcode(v 7.0.1)项目迁移到Xcode 7.1.1时出现以下错误

  • 成员'计数'含糊不清
  • 无法下标'Array'类型的值

知道如何解决上述错误吗?

我的代码如下

  var arrOfRewardDetail : Array = [Dictionary<String, String>]()
  func tableView(tableView: UITableView, numberOfRowsInSection section: Int) ->  Int {
    return arrOfRewardDetail.count //Ambiguous reference to member 'count'
}

 if self.arrOfRewardDetail[indexPath.row]["KEY"] == "Promotion By : "{} // Cannot subscript a value of type 'Array'
Run Code Online (Sandbox Code Playgroud)

立即更新获取以下错误

  • 对成员'indexOf'的模糊引用 let indexOfEnum : Int = self.arrPromitionDetailEnum.indexOf(dictRewardInfo["r_promotion_detail_type"]!)!
  • 也是这一个 let indexOfEnum : Int = self.arrPromitionDetailEnum.indexOf(dictInfo["r_promotion_detail_type"]!)! // Cannot subscript a value of type 'Array'

arrays xcode ios swift swift2

4
推荐指数
1
解决办法
1万
查看次数

WatchKit中的核心蓝牙在苹果手表中?

我希望我的配对iPhone识别我的手表应用程序.我正在使用CoreBluetooth Framework来实现这一点.我正在从我的手表应用程序传输蓝牙信号,并尝试在我的iPhone应用程序中接收信号.我使用的是与苹果在示例代码中显示的相同的概念(https://developer.apple.com/library/ios/samplecode/BTLE_Transfer/Introduction/Intro.html#//apple_ref/doc/uid/DTS40012927),唯一的区别是我的发射器是手表应用程序.

问题 我无法在iPhone中检测到手表应用程序.我确保所有硬件都配置正确,我正在配置Core蓝牙委托方法.我也怀疑这种方法是否适用于iPhone和Apple手表.

所有建议表示赞赏.提前致谢

iphone bluetooth objective-c apple-watch watchkit

1
推荐指数
1
解决办法
1573
查看次数

标签 统计

apple-watch ×1

arrays ×1

bluetooth ×1

ios ×1

iphone ×1

objective-c ×1

swift ×1

swift2 ×1

watchkit ×1

xcode ×1