cost 223 ms
如何使用Swift按字母順序將表視圖數據划分為多個部分? (重寫)

[英]How can I divide my table view data in sections alphabetically using Swift? (rewritten)

我有這種形式的數據源: 其他屬性在此階段將不起作用,因此讓我們保持簡單。 我將ViewController和TableViewDataSource分為兩個單獨的文件。 這是數據源代碼: class CountryDataSource: NSObject, UITableView ...

在 Swift 4.2 中使用 UILocalizedIndexedCollat​​ion 創建 tableView 部分索引時出現錯誤“無法識別的選擇器發送到實例”

[英]Getting error "unrecognized selector sent to instance" while using UILocalizedIndexedCollation to create tableView section Indexes in Swift 4.2

我正在嘗試構建一個以 iPhone 的通訊錄應用為模型的應用。 在這個過程中,我試圖將部分索引放在我的聯系人 tableView 的右側。 Apple 的 doc Table View Programming Guide for iOS 建議使用 UILocalizedIndexedCollat​ ...

UILocalizedIndexedCollat​​ion.current()。section(for:collat​​ionStringSelector:#selector(getter:UIPreviewAction.title))無法識別的選擇器

[英]unrecognized selector with UILocalizedIndexedCollation.current().section(for:collationStringSelector:#selector(getter: UIPreviewAction.title))

我在表視圖上與索引功能一起使用的這段代碼正在生成運行時錯誤: 錯誤發生在上面我的代碼的第二行。 錯誤提示: 2017-10-03 01:41:40.997296-0500 MailToText [6504:13026014]-[MailToText.TSS聯系人標題]:無法識 ...

Swift 2.2字符串文字選擇器

[英]Swift 2.2 string literal selector

在更新之前,我的代碼工作正常: 但是現在,由於不再使用字符串文字選擇器,因此代碼中斷了。 我試圖將字符串文字選擇器更改為Selector(“ lastName”),但“索引”始終返回為-1。 而且我沒有任何解決方案。 此排序方法采用給定對象的屬性名稱。 而Person類確 ...

UILocalizedIndexCollat​​ion上的`sectionForSectionIndexTitleAtIndex`如何工作? (帶有自定義欄目標題的Esp)它總是返回相同的數字

[英]How does `sectionForSectionIndexTitleAtIndex` on UILocalizedIndexCollation work? (Esp with custom section titles) It always returns the same number

在不同的地區這有區別嗎? 我完全不理解什么點sectionForSectionIndexTitleAtIndex方法上UILocalizedIndexCollation是。 我傳遞的每個索引都將返回相同的索引。 該文檔根本不是很有幫助,而且我似乎找不到任何實例,該實例返回的數字與我提供 ...

使用UILocalizedIndexedCollat​​ion sectionForObject:collat​​ionStringSelector的動態選擇器

[英]Dynamic selector using UILocalizedIndexedCollation sectionForObject:collationStringSelector

使用UILocalizedIndexedCollat​​ion時,我需要動態設置選擇器。在我的應用中,我有以下代碼: mainTitle是myObject中許多屬性之一。 但是,我希望選擇器以任何字符串顯示。 我從該站點獲得了提示: UILocalizedIndexedCollat​ ...

UILocalizedIndexedCollat​​ion UITableView索引列表排序

[英]UILocalizedIndexedCollation UITableView Indexed List Sort

我正在創建帶有用戶聯系人列表的UITableView 。 我已成功導入聯系人列表,並將其存儲在數組中作為包含每個聯系人的姓,名和ID參考的字典。 我正在嘗試實現UITableView's索引列表功能。 嘗試將數組划分為表的索引UILocalizedIndexedCollation的不同 ...

功能上的簡單錯誤

[英]simple mistake on the function

我想在表格視圖上顯示一個索引欄,其中所有歌曲均按字母順序排序,而#中的外語歌曲則與iOS中的iPod音樂一樣。 但是我得到了一個錯誤 任何評論都非常感謝,謝謝。 // viewDidLoad ...

UILocalizedIndexedCollat​​ion語言環境不同於英語

[英]UILocalizedIndexedCollation locale different than English

我正在使用帶有UILocalizedIndexedCollat​​ion的Tableview在右側顯示索引,但是手機上的語言是瑞典語(svenska),因此我在AZ之后看到一些特定於瑞典語的特殊字符,例如åäö。 在AZ中,有些字符缺失,例如Q,X等,我相信在Sweidsh語言環境中不存在。 ...

NSFetchedResultsController,帶有索引的UITableViewController和UILocalizedIndexedCollat​​ion

[英]NSFetchedResultsController with indexed UITableViewController and UILocalizedIndexedCollation

我有一個使用NSFetchedResultsController的表。 這會給我一個帶有標題的索引 但我想使用UILocalizedIndexCollat​​ion來獲取完整的字母。 如何將這些方法連接到NSFetchedResultsController? 我想我需要從當 ...

日語的UILocalizedIndexedCollat​​ion為聯系人/音樂應用程序提供不同的排序

[英]UILocalizedIndexedCollation for Japanese giving different ordering to contacts/music apps

UILocalizedIndexedCollat​​ion似乎在日本iOS設備上返回的結果與內置的Contacts / Music應用程序中的結果不同。 請注意,這不是關於日語在索引中根本不顯示的常見問題。 我正在獲取日語假名部分,但與聯系人等相比,索引的順序不正確。 這是屏幕 - ...

排序規則與對象

[英]Collation sort with object

我有一個列表視圖,想要對數組進行排序,以便每個名稱都在正確的UILocalizedIndexCollation部分下。 這是正在傳遞的部分的片段。我想通過name進行排序,但是我也想保持對象不變,以便可以使用其他數據。 划分 調用分區 我需要保持對象完整,但要按名稱排序 ...

NSFetchedResultsController與UILocalizedIndexedCollat​​ion

[英]NSFetchedResultsController v.s. UILocalizedIndexedCollation

我正在嘗試使用具有混合語言數據的FRC並希望有一個節索引。 似乎從文檔中你應該能夠覆蓋FRC 然后使用UILocalizedIndexedCollat​​ion來獲得本地化的索引和節。 但遺憾的是,這不起作用,並不是打算使用的:( 有沒有人能夠使用帶有UILocalized ...


 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM