牛客網(wǎng) iOS 題 66-89
66.NSURL 的構造函數(shù)有?
+ requestWithURL:- initWithURL+ URLWithString- initWithString
答案:<font color=“LightYellow”>3,4</font>
1是 URLRequest 的構造函數(shù)
2是 其他很多類的初始化方法
3,4是構造 URL 的:
[NSURL URLWithString:@"..."];[[NSURL alloc] initWithString:@"..."];
67.iOS 應用導航模式有哪些?
- 平鋪導航模式
- 標簽導航模式
- 樹形結構導航模式
- 模態(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 工具可以掃描的宏有:
CFCopyLocalizedStringCFCopyLocalizedStringFromTableCFCopyLocalizedStringFromTableBundleCFCopyLocalizedStringWithDefaultValueNSLocalizedStringNSLocalizedStringFromTableNSLocalizedStringFromTableBundleNSLocalizedStringWithDefaultValue
genstring 命令行工具,可以掃描 .m 或 .mm 文件中的宏,去除字符串并輸出到本地文件中。
72.genstrings 命名的基本語法:
genstrings [-a][-q][-o <outputDir>] sourcefile
73.表視圖的相關類有哪些?
UITableViewUITableViewControllerUITableViewDelegateUITableViewDataSource
答案:<font color=“LightYellow”>1,2</font>
3 是代理協(xié)議
4 是數(shù)據(jù)源協(xié)議
74.表視圖的組成有哪些?
- Cells(單元格)
- Section(節(jié))
- TableHeaderView(表頭)
- TableFooterView(表腳)
答案:<font color=“LightYellow”>1,2,3,4</font>
75.下列屬于表視圖內置的拓展視圖常量如下:
UITableViewCellAccessoryNoneUITableViewCellAccessoryDisclosureIndicatorUITableViewCellAccessoryDetailDisclosureButtonUITableViewCellAccessoryCheckmark
76.參照73
77.下面哪些屬于 TableViewDelegate 協(xié)議的方法?
tableView: cellForRowAtIndexPath:tableView: numberOfRowsInSection:tableView: didSelectRowAtIndexPath: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ù)有?
+ requestWithURL- initWithURL+ requestWithURL: cachePolicy: timeoutInterval:- initWithURL: cachePolicy: timeoutInterval:
答案:<font color=“LightYellow”>1,2,3,4</font>
82.Objective-C 的內存管理方法:
- MRR(Manual Retain Release):MRC 的官方名字
- MRC(Manual Reference Counting)
- ARC(Automatic Reference Counting)
- GC(Garbage Collection):垃圾回收,在 macOS 中使用
83.AddressBook 框架中常用類?
- ABAddressBook
- ABPerson
- ABGroup
- ABRecord
答案:<font color=“LightYellow”>1,2,3,4</font>
這個框架在 iOS9.0 后被棄用,改用 Contacts 框架
84.AddressBookUI 框架中的視圖控制器?
- ABPeoplePickerNavigationController
- ABPersonViewController
- ABNewPersonViewController
- 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ù)有哪些
- ABPersonCreate
- ABRecordSetValue
- ABMultiValueCreateMutable
- ABAdressBookSave
答案:<font color=“LightYellow”>1,2,3,4</font>
87.修改聯(lián)系人涉及的函數(shù)有哪些
- ABPersonCreate
- ABRecordSetValue
- ABAddressBookGetPersonWithRecordID
- ABAdressBookAddRecord
答案:<font color=“LightYellow”>2,3</font>
修改聯(lián)系人使用的函數(shù)有:
- ABAddressBookGetPersonWithRecordID
- ABRecordSetValue
- ABAdressBookSave
88.刪除聯(lián)系人使用的函數(shù)有哪些
- ABPersonCreate
- ABRecordSetValue
- ABAddressBookGetPersonWithRecordID
- ABAdressBookRemoveRecord
答案:<font color=“LightYellow”>3,4</font>
先查找到,再刪除
89.AddressBook 高級 API 是在 AdressBookUI 框架中定義的,它為我們訪問通訊錄數(shù)據(jù)提供了 UI 界面。該框架提供了哪些視圖控制器和委托協(xié)議?
- ABPeoplePickerNavigationController
- ABPersonViewController
- ABUnknownPersonViewController
- ABNewPersonViewController
答案:<font color=“LightYellow”>1,2,3,4</font>