- Joined
- Mar 9, 2012
- Messages
- 3
- Reaction score
- 0
- Points
- 1
Hi I just started xcoding 2 weeks time ago and recently I had try to write a simple app which to sorting the entire Address Book database from iPhone.
I facing a little problem where Xcode show as i colour in silver - method in protocol not implement.
that is no error is this problem i just couldn't found where is my error. hope any expert can assist me.
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientationUIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)adbookid)sender
{
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy(kCFAllocatorDefault, CFArrayGetCount(people), people);
CFArraySortValues(peopleMutable,
CFRangeMake(0, CFArrayGetCount(peopleMutable)),
(CFComparatorFunction)ABPersonComparePeopleByName,
(void*)ABPersonGetSortOrdering());
CFRelease(addressBook);
CFRelease(people);
CFRelease(peopleMutable);
}
@end
I facing a little problem where Xcode show as i colour in silver - method in protocol not implement.
that is no error is this problem i just couldn't found where is my error. hope any expert can assist me.
#import "ViewController.h"
@interface ViewController ()
@end
@implementation ViewController
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
}
- (BOOL)shouldAutorotateToInterfaceOrientationUIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
- (IBAction)adbookid)sender
{
ABAddressBookRef addressBook = ABAddressBookCreate();
CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);
CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy(kCFAllocatorDefault, CFArrayGetCount(people), people);
CFArraySortValues(peopleMutable,
CFRangeMake(0, CFArrayGetCount(peopleMutable)),
(CFComparatorFunction)ABPersonComparePeopleByName,
(void*)ABPersonGetSortOrdering());
CFRelease(addressBook);
CFRelease(people);
CFRelease(peopleMutable);
}
@end