gpt4 book ai didi

sorting - 如何在 swift 中使用 "ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering"?

转载 作者:行者123 更新时间:2023-11-28 07:12:44 25 4
gpt4 key购买 nike

在以下函数中将什么作为参数“sortOrdering”的值传递?

let temp = ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBook: self.objAddressBook, source: sourceOfAddressBook, sortOrdering: .......)

我有“addressBook”和“source”的值

我传递的是“kABPersonSortByFirstName”,它给我以下错误!

Cannot convert the expression's type '(addressBook: @lvalue ABAddressBook!, source: @lvalue Unmanaged!, sortOrdering: Int)' to type '$T5'

虽然它在 Objective C 中工作!

最佳答案

let temp = ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering(addressBook: self.objAddressBook!, source: sourceOfAddressBook!, sortOrdering: ABPersonGetSortOrdering())

显示人员记录

ABPersonGetSortOrdering

Returns the user’s sort-ordering preference for lists of persons.

Declaration SWIFT

func ABPersonGetSortOrdering() -> ABPersonSortOrdering

Return Value

The user’s sort ordering preference

ABPersonGetSortOrdering

关于sorting - 如何在 swift 中使用 "ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27738215/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com