- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我目前正在实现应用内购买机制,但有三件事我没有完全理解。
在下面的 tableView 中,我使用单例类从应用 Storm 中检索产品,有三件事我不确定它们到底做了什么......
什么是 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
}
最佳答案
谢谢 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
谢谢
关于ios - 了解 TableView 中的 localizedTitle 和 localizedDescription,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38862639/
我的应用程序中有应用程序内购买。我正在使用日本商店中的测试帐户测试 Japanase 语言设备。我在应用购买标题和描述中同时使用英语和日语。 无论我做什么,SKProduct 的 localizedT
我正在实现应用程序内商店并成功地从应用程序商店获取 SKProducts。 SKProducts 中的价格信息和描述都很好,但我所有的 localizedTitles 都是零。在 iTunes Con
我正在使用 Xcode v7.2 和 Obj-c。我正在向现有的 iOS 应用程序添加不同的语言。主要问题是 SKProduct localizedTitle(iTC 上的显示名称)总是以英文返回。
我正在使用 Apples Photos Framework 将 PHAssetCollections 加载到我的应用程序中。我总是得到智能收藏的英文名称。例如,我得到的是“收藏夹”而不是“收藏夹”(瑞
我想在我的应用程序中更改专辑名称。 if ([collection canPerformEditOperation:PHCollectionEditOperationRename] == YES)
我有 1 个 IAP 已提交给该应用以供审核。 当我检索可用的产品列表(此时只有 1 个)时,我确实看到了提交的 IAP 产品。到目前为止一切顺利。 现在归结为显示产品(在 UITableView 中
我目前正在实现应用内购买机制,但有三件事我没有完全理解。 在下面的 tableView 中,我使用单例类从应用 Storm 中检索产品,有三件事我不确定它们到底做了什么...... 什么是 as! S
我是一名优秀的程序员,十分优秀!