ios - Import contacts from address book -
i following tutorial in access address book, let user select contacts , store them core data. after stored in core data, modal view controller address book contacts dismissed.
however, have strange problem after dismissed, when @ contacts, tableview shows new contact name not display. not tableview not updated @ all. show new contact. doesn't show name. if go edit contact (in detail view) name there getting stored in database. if go tableview, name still missing.
only when save edited version--even if leave same--does name show in tableview.
this not seem delegate issue tableview showing new entry not show first , last names.
happy show code if wants, not sure code relevant.
thanks suggestions.
edit:
problem seem in cellforrowatindexpath method. best name prints out null although first , last name ok. best name concatenation work normally. not sure why not working here.
contacts *contact = [self.fetchedresultscontroller objectatindexpath:indexpath]; //get best name nsstring *bestname = [contact.title stringbyappendingformat:@" %@", contact.first]; bestname = [bestname stringbyappendingformat:@" %@", contact.last]; nslog(@"the best name is: %@", bestname); // prints null nslog(@"the first name is: %@",contact.first);//prints bob nslog(@"the last name is: %@",contact.last);//prints jones
in contacts object, contact, check contact.title isn't nil.
Comments
Post a Comment