私はObjective-Cの変換オブジェクトC
NSFetchRequest *fetchRequest = [NSFetchRequest fetchRequestWithEntityName:@"Doctor"];
[fetchRequest setPredicate:[NSPredicate predicateWithFormat:@"id != nil"]];
fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"distance" ascending:YES], [NSSortDescriptor sortDescriptorWithKey:@"lastname" ascending:YES]];
のコードを持っていると私はスウィフト
var fetchRequest: NSFetchRequest = NSFetchRequest(entityName: "Doctor")
fetchRequest.predicate = NSPredicate(format: "id != nil")
let disctanceSortDescriptor = NSSortDescriptor(key:"distance",ascending: true)
let lastNameSortDescriptor = NSSortDescriptor(key:"lastname",ascending: true)
fetchRequest.sortDescriptors = NSSortDescriptor(key:"distance",ascending: true), NSSortDescriptor(key:"lastname",ascending: true)
どうスウィフト
へのObjective-Cに変換fetchRequest.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"distance" ascending:YES], [NSSortDescriptor sortDescriptorWithKey:@"lastname" ascending:YES]];
問題点を教えてください。 –
fetchRequest.sortDescriptors = @ [[NSSortDescriptor sortDescriptorWithKey:@ "距離"昇順:はい]、[NSSortDescriptor sortDescriptorWithKey:@ "姓"昇順:はい]]を変換する方法はわかりません。このコードでSwift –
申し訳ありませんが、私はまだあなたの問題を取得していない! –