good evening,
today i start programming of my first macOS program in swift.
unfortunately i find no tutorial which can solve my issue.
i have a view controller with an "abpeoplepickerview".
this shows me successfully my mac address book contacts.
now i would like to select an person an get all details of this person which i would like to fill into textfields.
but i don't know how.
can everybody helps me (please step by step)
thank you very much :)
You get selected contacts with ABPeoplePickerView.selectedRecords.
Then you iterate through it with foreach. You may want to check if the record is ABPerson before casting the record to it. After that you read the properties from ABPerson and display them in the text fields.
Related
I want to make an iPhone app just like a questionnaire/Quize, and want to store all questions in sqlite database , i need to have One question that can be a label and 4 radio buttons for answers, user will select the option and will go for the next question, questions and answers will be saved in sqlite and at the end user will come to know how many he made correct or wrong choices.
Please suggest me any tutorial or anything that can be help full for me,please guise i will be grateful to u for this kindness in advance.
Just make a database with a table with columns like so : id, question, answer1,answer2,answer3,answer4,correct answer, did answer correct;
If you don't know SQL just use a wrapper like FMDB
After that just us use the built in function to get from database the question with a certain id (i.e. question number) and pass that to your question-asking class . When the user presses on an answer, check if it's correct and modify "did answer correct" columns.
Break your project into set of questions:
1. How to create GUI in iPhone?
2. How to connect to database in iPhone?
3. How to create label, radio buttons in iPhone?
4. How to submit form in iPhone?
Etc.
Then search the web for each of these. Perform these examples individually, test them and combine them.
Voila you've got a brand new questionnaire application :)!!!
I am looking for a control, class or nib file looks like "SMS or Email writing window".
In order to do my job, it should have these particular functions.
Has to look for the people in Addressbook.
When person is selected, it should return person's name and placed in the UITextField.
Has to be searched by person's surname or firstname.
If you see this screen capture, you will understand more easily.
But I am a new user in this web site, and I cannot upload the picture that I wanna show you guys.
Can anyone give me some clue how to solve this out?
Thanks in advance.
You're never going to get something that perfectly fits your very specific needs like that. To get the user info you'll want to look into Address Book Framework. To get the SMS view, here are two classes to get you started:
SSMessagesViewController
AcaniChat
You will probably have to interact with the Address Book UI Framework.
I am able to add contact to address book now after adding i see details of contact.I do not want edit button to edit contact. (i want it in only read mode). and also do't want use ABUnknownPersonViewController. How can i do this?
Please help me.
Thanks,
Vilas979
The Quick Contacts sample code from the Apple documents library provides a good idea how to use ABUnknownPersonViewController. Specifically, look for QuickContactsViewController.m and the pragma mark Add data to an existing person
I would like to create a view like contacts info in new ios4.
I've been looking for a document, source code(this is better) or something else but I wasn't lucky.
Please if somebody can help me I will be very very happy, I need to show a picture, some fields like textbox and description field.
Thanks in advance
I think you're talking about the Address Book APIs? Here is a link to the Apple Developer site that should get you started:
http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/100-Introduction/Introduction.html
It goes over both how to integrate with the Address Book database, and how to just use an Address Book-like view for listing contact information.
Controllers: http://developer.apple.com/iphone/library/documentation/ContactData/Conceptual/AddressBookProgrammingGuideforiPhone/400-UI_Controllers/UI_Controllers.html#//apple_ref/doc/uid/TP40007744-CH5-SW1
Use tableView:viewForHeaderInSection: for your first table section, and point it to a UIView you've designed in IB. Take a look at this tutorial.
I want to open detail view of contact and then. i want to save in adress book. please give me a hint.
Hint 1: Address Book Programming Guide for iPhone OS.
Hint 2: ABPersonViewController.
That is all you need to read and save data from the Apple address book, and present a reasonable UI to display the data. See the QuickContacts sample if you need code examples.