【问题标题】:view controller for dictionary/defining words in iOS 5iOS 5 中字典/定义词的视图控制器
【发布时间】:2012-01-11 17:53:38
【问题描述】:

几周前我看到 iOS 5 中有一个用于字典的视图控制器,我们可以传入一个单词,它会提供它的定义。我似乎无法在苹果文档中再次找到文档,有人知道名字是什么吗?

【问题讨论】:

  • 通过文档链接和有关如何使用它的示例代码检查我的答案。

标签: iphone objective-c ios ipad ios5


【解决方案1】:

您正在尝试使用UIReferenceLibraryViewController提供的字典服务

// Create the view controller
UIReferenceLibraryViewController *reference = 
  [[[UIReferenceLibraryViewController alloc] initWithTerm:@"Word"] autorelease];

[self presentModalViewController:reference animated:YES];
}

【讨论】:

  • +1。在创建和显示UIReferenceLibraryViewController 的实例之前,使用+dictionaryHasDefinitionForTerm: 来确定字典是否甚至有该术语的定义也是一个好主意。
猜你喜欢
  • 1970-01-01
  • 2012-01-26
  • 1970-01-01
  • 1970-01-01
  • 2012-05-19
  • 1970-01-01
  • 2015-08-11
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多