1
I have a structure in Core Data thus:
Cliente
--- id = inteiro
--- dados = Pessoa
Pessoa
--- nome = string
PessoaFisica < Pessoa
--- cpf = string
PessoaJuridica < Pessoa
--- cnpj = string
How can I filter Client based on documents depending on the type of person? For example, seeking a customer according to the Cpf.
If I do it like this, he doesn’t understand the inheritance and says he didn’t find it Cpf in Person:
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"dados.cpf = %@", cpf];
I needed a kind of "casting" of dice for Personal. Any suggestions?