我目前正在实施应用内购买机制,有三件事我不完全理解。
在下表中查看我是否使用单例类从app风暴中检索产品,有三件事我不确定他们究竟做了什么...
as! SKProduct
做了什么?
localizedTitle
和localizedDescription
做了什么?
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: .Subtitle, reuseIdentifier: "reuseIdentifier")
// what does `as! SKProduct` do
let product = IAPManager.sharedInstance.products.objectAtIndex(indexPath.row) as! SKProduct
// what does localizedTitle do?
cell.textLabel!.text = product.localizedTitle
// what does localizedDescription do?
cell.detailTextLabel!.text = product.localizedDescription
return cell
}
答案 0 :(得分:0)
感谢你rmaddy
指出我正确的方向,我正在查看错误的文档...... https://developer.apple.com/reference/foundation/nserror/1414418-localizeddescription
localizedTitle和localizedDescription: https://developer.apple.com/library/ios/documentation/StoreKit/Reference/SKProduct_Reference/#//apple_ref/occ/instp/SKProduct/localizedDescription
为: https://developer.apple.com/swift/blog/?id=23
由于