5

I have been told to do the following:

Implement contact add view like below and let him store in SQL table, contacts will have Name, phone no of mobile, work , fax, email . view should look like below:

enter image description here

My question: Can you clarify me, should I use Addressbook or simply a custom view and a sql database to save data from that custom view? I mean both the options are open here?

user735682
  • 135
  • 7
  • yes, both options are available to you. Question is whether you want the new contact to be saved to the phone's address book, or simply stored to a DB managed by the application itself? – Andrew Little Aug 26 '11 at 19:49
  • I want new contact to be stored to DB managed by the application itself. I am sure it can be done if I use custom view, but if I use AdressbookUI is it possible to save to my application's managed DB? Another question the AdressBook UnknownPerson's UI's fields are lil bit different, instead of title there is Company, can the fields be customised of the AddressbookUI? If yes how? – user735682 Aug 26 '11 at 20:03

1 Answers1

1

You can not use address book to create custom content in your application. So you should implement your custom view to collect information to store in your database (sqlite?)

If you are creating contact / modifying existing contact information, you can use address book framework.


Answer for the question in comment (how to go about for this kinda UI)

Yes, Have the grouped table view to get the desired background

Among the many possible solutions, here is the simplest one perhaps:

  • Have 2 sections in your table.
    • First section has a special kinda cell. Only one row in this section. You can use Interface Builder to create the cell contents or you could build from code.
    • Second section contains similar cells. It can contain as many as the fields you need. Just specify UITableViewCell's style to be UITableViewCellStyleValue2 and specify the values accordingly
prakash
  • 58,901
  • 25
  • 93
  • 115
  • "You can not use address book to create custom content in your application." -- Custom content means like a view in above screenshot, can that be created by addressbookUI? "If you are creating contact / modifying existing contact information" -- Here custom content is a view to take input to create new contact information. And if I use Adressbook Framework will the information will be saved in SQLIte? – user735682 Aug 26 '11 at 19:54
  • If you want to modify/add contacts to existing contacts list, you can use Addressbookframework. Please refer the sample "CocoaPeoplePicker" for mode info. You have to roll your own logic to store in your sqlite database – prakash Aug 26 '11 at 20:07
  • I have seen that sample app and "http://developer.apple.com/library/ios/#samplecode/QuickContacts/Introduction/Intro.html#//apple_ref/doc/uid/DTS40009475" this one too. The AdressBook UnknownPerson's UI's fields are lil bit different, instead of title there is Company, can the fields be customised of the AddressbookUI? If yes how? – user735682 Aug 26 '11 at 20:11
  • No, You can not customize address book UI. – prakash Aug 27 '11 at 08:03
  • If I want to create a custom view of my own like the screenshot, I guess I should take a grouped table view and every cell should be a UITextield. But how can I give look and feel of that cell like Addressbok? In summary how can I design that kind of UI? – user735682 Aug 29 '11 at 02:17
  • The add button and First, Last & Title rows will be included within the first cell? If add photo button is excluded from the first row, then the width of the row will be differed from other cells below it. Is it possible in a single tableview that indivitual cells have different width? I have seen cells can have different heights, can they have different width too? – user735682 Aug 30 '11 at 12:23
  • @Prakash The Address Book Programming Guide for iOS, Building Blocks: Working with Records and Properties, under the header titled "Records," reads: "Even though records are usually part of the Address Book database, they can also exist outside of it." This makes them a useful way to store contact information your application is working with." Which is a bit unclear but suggests that it could be possible to use the AddressBookUI with objects not stored in the device address book. – Jack Lawrence Mar 13 '12 at 17:41
  • @Prakash Furthermore, the reference documentation for ABPerson states in the Overview: "Person records don’t necessarily have to be stored in the Address Book database. You can use person records as a way to group contact information in memory and present it to the user through, for example, a person view controller". Though on the other hand, it looks like creating `ABPerson` instances without committing them to the database could be problematic. – Jack Lawrence Mar 13 '12 at 17:45
  • Sorry for all the comments, I keep seeing more stuff after the 5 minute window is up. This'll do it: http://stackoverflow.com/questions/6236820/show-custom-contact-information – Jack Lawrence Mar 13 '12 at 17:53