Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
Thanks for above code, but i am still not able to add contact in iphone address book database. i have write above code in a function which is called by rightBarbutton, i have three textField in page which value i have to add in address Book database.
can you plz help me where and how to write the code, or if possible mail me the project folder at [email]smarti_vns@yahoo.co.in[/email]
hey its working, thanks a lot.... now i have to add contacts details after 5 pages, so i have to fetch all the details of 4 page at 5th page. can you give me any suggestion how to fetch that values in 5th page.
what do you mean by 'pages' "contacts details after 5 pages,"
i have to create a contact wizard, which consist the following details 1st page= 3 text field (first name, last name, middle name) 2nd page= 1 picker view+ 1 text field and 2 more pages and at the last 5th page, there is a save button on which i have to write a function to save all the details in address book database.
means i have to save the value of all pages and fetch those in 5th page.
or simply can say "code for fetch value of a TextField of view1 into a NSString of view2".
i have to create a contact wizard, which consist the following details 1st page= 3 text field (first name, last name, middle name) 2nd page= 1 picker view+ 1 text field and 2 more pages and at the last 5th page, there is a save button on which i have to write a function to save all the details in address book database.
means i have to save the value of all pages and fetch those in 5th page.
or simply can say "code for fetch value of a TextField of view1 into a NSString of view2".
working great. I added phone number, website, email etc also and its saving everything :)
hey everyone, i know this thread is old, but i am having the same problem , and been trying to figure it out for 2 days, can you pls send me the project or post the code if u still have it. i can paste in what i have as well instead, maybe someone can help me with debugging that.
thx for that code, i am really new to obj c and mac programming, so i am still confused as to how to implement this, i have all those fields displayed in a textfeild right now and i want the user to be able to edit those fields and save it back to the address book. here is what i have so far in my implementation file:
Replies
Code is
[HTML]
fName = @"some Text";
lName = @"some Text";
phone = @"0123456789";
ABMutableMultiValueRef phoneNumberMultiValue = ABMultiValueCreateMutable(kABPersonPhoneProperty);
ABMultiValueAddValueAndLabel(phoneNumberMultiValue ,phone,kABPersonPhoneMobileLabel, NULL);
ABRecordSetValue(newPerson, kABPersonLastNameProperty,lName,&anError);
ABRecordSetValue(newPerson, kABPersonFirstNameProperty,fName,&anError);
ABRecordSetValue(newPerson, kABPersonPhoneProperty, phoneNumberMultiValue, &anError);
ABAddressBookAddRecord(addressBook, newPerson, &anError);
ABAddressBookSave(addressBook, &anError)[/HTML]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomedon't forget add AddressBook.Framework
Ref: AddressBookProgrammingGuideforiPhone.pdf
The Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThanks for above code,
but i am still not able to add contact in iphone address book database.
i have write above code in a function which is called by rightBarbutton,
i have three textField in page which value i have to add in address Book database.
can you plz help me where and how to write the code, or if possible mail me the project folder at [email]smarti_vns@yahoo.co.in[/email]
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomem working that..
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethanks a lot....
now i have to add contacts details after 5 pages,
so i have to fetch all the details of 4 page at 5th page.
can you give me any suggestion how to fetch that values in 5th page.
once again thank u very much.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome1st page= 3 text field (first name, last name, middle name)
2nd page= 1 picker view+ 1 text field
and 2 more pages
and at the last 5th page, there is a save button on which i have to write a function to save all the details in address book database.
means i have to save the value of all pages and fetch those in 5th page.
or simply can say "code for fetch value of a TextField of view1 into a NSString of view2".
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeIt would be better start new thread for new topic
The Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI am stuck with same problem can you please send me the code of source code to add contact in address book database.
[email]Chaitanyakv@live.com[/email]
Thanks in advance.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeI added phone number, website, email etc also and its saving everything :)
Vaibhav Saran | Software Engineer
Neo Sypher Systems Pvt. Ltd.
New Delhi | India
Websites:
<font color="
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomethx
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeHere username, usercontact, usercompany, useremail, userwebsite etc are NSString variables...
Vaibhav Saran | Software Engineer
Neo Sypher Systems Pvt. Ltd.
New Delhi | India
Websites:
<font color="
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome#import "DetailViewController.h"
#import "RootViewController.h"
@implementation DetailViewController
@synthesize firstName;
@synthesize lastName;
@synthesize addresslabel;
@synthesize myemail;
@synthesize mobile;
@synthesize homephone;
@synthesize birthday;
@synthesize iphone;
@synthesize toolbar;
@synthesize detailDescriptionLabel;
@synthesize detailItem;
@synthesize popoverController;
- (IBAction)showPicker:(id)sender {
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self presentModalViewController:picker animated:YES];
[picker release];
}
- (void)peoplePickerNavigationControllerDidCancel:(ABPeoplePickerNavigationController *)peoplePicker {
[self dismissModalViewControllerAnimated:YES];
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
NSString * fname = [[[NSString alloc] init] autorelease];
NSString * lname = [[[NSString alloc] init] autorelease];
fname = (NSString *)ABRecordCopyValue(person,kABPersonFirstNameProperty);
lname = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
ABMultiValueRef multi = ABRecordCopyValue(person, kABPersonPhoneProperty);
mobile.text = (NSString*)ABMultiValueCopyValueAtIndex(multi, 0);
ABMultiValueRef emails = ABRecordCopyValue(person, kABPersonEmailProperty);
if (emails && ABMultiValueGetCount(emails) == 1) {
NSString *email = (NSString*)ABMultiValueCopyValueAtIndex(emails, 0);
NSString * addy = [[[NSString alloc] init] autorelease];
ABMutableMultiValueRef addresses = ABRecordCopyValue(person, kABPersonAddressProperty);
for (CFIndex addyIndex = 0; addyIndex < ABMultiValueGetCount(addresses); addyIndex++) {
NSString * addyType = (NSString *) ABMultiValueCopyLabelAtIndex(addresses, addyIndex);
NSRange addySearchRange = [addyType rangeOfString:@"home" options:NSCaseInsensitiveSearch]; //specify what kind of address you're looking
if (addySearchRange.length){
CFDictionaryRef AddyRef = ABMultiValueCopyValueAtIndex(addresses, addyIndex);
CFStringRef addyStreet = CFDictionaryGetValue(AddyRef, kABPersonAddressStreetKey);
if ([(NSString *)addyStreet length]){
addy = [addy stringByAppendingFormat:(NSString *)addyStreet];
}
CFStringRef addyCity = CFDictionaryGetValue(AddyRef, kABPersonAddressCityKey);
if ([(NSString *)addyCity length]){
addy = [addy stringByAppendingFormat:(NSString *)@", "];
addy = [addy stringByAppendingFormat:(NSString *)addyCity];
}
CFStringRef addyState = CFDictionaryGetValue(AddyRef, kABPersonAddressStateKey);
if ([(NSString *)addyState length]){
addy = [addy stringByAppendingFormat:(NSString *)@", "];
addy = [addy stringByAppendingFormat:(NSString *)addyState];
}
CFStringRef addyZip = CFDictionaryGetValue(AddyRef, kABPersonAddressZIPKey);
if ([(NSString *)addyZip length]){
addy = [addy stringByAppendingFormat:(NSString *)@", "];
addy = [addy stringByAppendingFormat:(NSString *)addyZip];
}
CFStringRef addyCountry = CFDictionaryGetValue(AddyRef, kABPersonAddressCountryKey);
if ([(NSString *)addyCountry length]){
addy = [addy stringByAppendingFormat:(NSString *)@", "];
addy = [addy stringByAppendingFormat:(NSString *)addyCountry];
}
CFRelease(AddyRef);
}
}
self.firstName.text = fname;
self.lastName.text = lname;
self.addresslabel.text = addy;
self.myemail.text = email;
[self dismissModalViewControllerAnimated:YES];
return NO;
}
}
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
shouldContinueAfterSelectingPerson:(ABRecordRef)person
property:(ABPropertyID)property
identifier:(ABMultiValueIdentifier)identifier {
}
any suggestions, thank you for your quick response
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesomeemail, company name ..?
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeThe Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeChange the method by passing the arguments as NSString or in a NSDictionary.
And can call this method from your action method.
The Lord's holy name be praised.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome