??途W(wǎng) iOS 題 66-89

牛客網(wǎng) iOS 題 66-89

66.NSURL 的構造函數(shù)有?

  1. + requestWithURL:
  2. - initWithURL
  3. + URLWithString
  4. - initWithString

答案:<font color=“LightYellow”>3,4</font>

1是 URLRequest 的構造函數(shù)
2是 其他很多類的初始化方法
3,4是構造 URL 的:

  • [NSURL URLWithString:@"..."];
  • [[NSURL alloc] initWithString:@"..."];

67.iOS 應用導航模式有哪些?

  1. 平鋪導航模式
  2. 標簽導航模式
  3. 樹形結構導航模式
  4. 模態(tài)視圖

答案:<font color=“LightYellow”>1,2,3</font>

68.在樹形結構導航模式中,會有兩個視圖控制器:

  • 一個是應用程序根視圖控制器,它是 UINavigationController 的實例,通過 self.window.rootViewController 屬性指定;
  • 一個是導航控制器根視圖控制器,通過 UINavigationController 的構造方法 initWithRootViewController 指定,用于提供和呈現(xiàn)導航控制器的一級視圖,即我們看到的第一個界面。

答案:<font color=“LightYellow”>1</font>

69.三種導航模式(平鋪,標簽,樹形結構)和模態(tài)視圖可以同時使用。

70.本地化目錄中 en-US.Lproj 中,en 是語言代號,US 是國家或地區(qū)代號。

71.使用 genstring 工具可以掃描的宏有:

  1. CFCopyLocalizedString
  2. CFCopyLocalizedStringFromTable
  3. CFCopyLocalizedStringFromTableBundle
  4. CFCopyLocalizedStringWithDefaultValue
  5. NSLocalizedString
  6. NSLocalizedStringFromTable
  7. NSLocalizedStringFromTableBundle
  8. NSLocalizedStringWithDefaultValue

genstring 命令行工具,可以掃描 .m 或 .mm 文件中的宏,去除字符串并輸出到本地文件中。

72.genstrings 命名的基本語法:

genstrings [-a][-q][-o <outputDir>] sourcefile

73.表視圖的相關類有哪些?

  1. UITableView
  2. UITableViewController
  3. UITableViewDelegate
  4. UITableViewDataSource

答案:<font color=“LightYellow”>1,2</font>

3 是代理協(xié)議
4 是數(shù)據(jù)源協(xié)議

74.表視圖的組成有哪些?

  1. Cells(單元格)
  2. Section(節(jié))
  3. TableHeaderView(表頭)
  4. TableFooterView(表腳)

答案:<font color=“LightYellow”>1,2,3,4</font>

75.下列屬于表視圖內置的拓展視圖常量如下:

  1. UITableViewCellAccessoryNone
  2. UITableViewCellAccessoryDisclosureIndicator
  3. UITableViewCellAccessoryDetailDisclosureButton
  4. UITableViewCellAccessoryCheckmark

76.參照73

77.下面哪些屬于 TableViewDelegate 協(xié)議的方法?

  1. tableView: cellForRowAtIndexPath:
  2. tableView: numberOfRowsInSection:
  3. tableView: didSelectRowAtIndexPath:
  4. numberOfSectionInTableView:

答案:<font color=“LightYellow”>3</font>

1,2,3 是 dataSource 方法
代理的作用是用來完成指定的某種動作,所以必須是動作性的操作而不是數(shù)據(jù)性的操作。

78.NSURLConnectionDelegate 協(xié)議中的 connection: didReceiveData:方法是請求成功,開始接收數(shù)據(jù),如果數(shù)據(jù)量很多,它會被多次調用

答案:<font color=“LightYellow”>1</font>

79.NSURLConnectionDelegate 協(xié)議中的 connection: didFailWithError: 是加載數(shù)據(jù)出現(xiàn)異常

答案:<font color=“LightYellow”>1</font>

80.NSURLConnectionDelegate 協(xié)議中的 connection: didFinishLoading:是成功完成加載數(shù)據(jù),在connection: didReceiveData:方法后執(zhí)行

答案:<font color=“LightYellow”>1</font>

81.NSURLRequest 的構造函數(shù)有?

  1. + requestWithURL
  2. - initWithURL
  3. + requestWithURL: cachePolicy: timeoutInterval:
  4. - initWithURL: cachePolicy: timeoutInterval:

答案:<font color=“LightYellow”>1,2,3,4</font>

82.Objective-C 的內存管理方法:

  1. MRR(Manual Retain Release):MRC 的官方名字
  2. MRC(Manual Reference Counting)
  3. ARC(Automatic Reference Counting)
  4. GC(Garbage Collection):垃圾回收,在 macOS 中使用

83.AddressBook 框架中常用類?

  1. ABAddressBook
  2. ABPerson
  3. ABGroup
  4. ABRecord

答案:<font color=“LightYellow”>1,2,3,4</font>

這個框架在 iOS9.0 后被棄用,改用 Contacts 框架

84.AddressBookUI 框架中的視圖控制器?

  1. ABPeoplePickerNavigationController
  2. ABPersonViewController
  3. ABNewPersonViewController
  4. ABUnknownPersonViewController

答案:<font color=“LightYellow”>1,2,3,4</font>

只要是 UIViewController 都是視圖控制器

85.判斷:從通訊錄數(shù)據(jù)庫查詢聯(lián)系人數(shù)據(jù),可通過 ABAddressBookCopyArrayOfAllPeople 和 ABAddressBookCopyPeopleWithName 函數(shù)獲得。

答案:<font color=“LightYellow”>1</font>

86.創(chuàng)建聯(lián)系人使用的函數(shù)有哪些

  1. ABPersonCreate
  2. ABRecordSetValue
  3. ABMultiValueCreateMutable
  4. ABAdressBookSave

答案:<font color=“LightYellow”>1,2,3,4</font>

87.修改聯(lián)系人涉及的函數(shù)有哪些

  1. ABPersonCreate
  2. ABRecordSetValue
  3. ABAddressBookGetPersonWithRecordID
  4. ABAdressBookAddRecord

答案:<font color=“LightYellow”>2,3</font>

修改聯(lián)系人使用的函數(shù)有:

  1. ABAddressBookGetPersonWithRecordID
  2. ABRecordSetValue
  3. ABAdressBookSave

88.刪除聯(lián)系人使用的函數(shù)有哪些

  1. ABPersonCreate
  2. ABRecordSetValue
  3. ABAddressBookGetPersonWithRecordID
  4. ABAdressBookRemoveRecord

答案:<font color=“LightYellow”>3,4</font>

先查找到,再刪除

89.AddressBook 高級 API 是在 AdressBookUI 框架中定義的,它為我們訪問通訊錄數(shù)據(jù)提供了 UI 界面。該框架提供了哪些視圖控制器和委托協(xié)議?

  1. ABPeoplePickerNavigationController
  2. ABPersonViewController
  3. ABUnknownPersonViewController
  4. ABNewPersonViewController

答案:<font color=“LightYellow”>1,2,3,4</font>

?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容