Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
iOS Development
Sorting the Address Book database problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="terrychu01" data-source="post: 1380343" data-attributes="member: 242158"><p>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. </p><p></p><p>I facing a little problem where Xcode show as i colour in silver - method in protocol not implement. </p><p></p><p>that is no error is this problem i just couldn't found where is my error. hope any expert can assist me. </p><p> </p><p></p><p>#import "ViewController.h"</p><p></p><p>@interface ViewController ()</p><p></p><p>@end</p><p></p><p><span style="color: Silver">@implementation ViewController</span></p><p></p><p>- (void)viewDidLoad</p><p>{</p><p> [super viewDidLoad];</p><p> // Do any additional setup after loading the view, typically from a nib.</p><p>}</p><p></p><p>- (void)viewDidUnload</p><p>{</p><p> [super viewDidUnload];</p><p> // Release any retained subviews of the main view.</p><p>}</p><p></p><p>- (BOOL)shouldAutorotateToInterfaceOrientation<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />UIInterfaceOrientation)interfaceOrientation</p><p>{</p><p> return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);</p><p>}</p><p></p><p>- (IBAction)adbook<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown :(" loading="lazy" data-shortname=":(" />id)sender </p><p>{</p><p> ABAddressBookRef addressBook = ABAddressBookCreate();</p><p> CFArrayRef people = ABAddressBookCopyArrayOfAllPeople(addressBook);</p><p> CFMutableArrayRef peopleMutable = CFArrayCreateMutableCopy(kCFAllocatorDefault, CFArrayGetCount(people), people);</p><p> </p><p> CFArraySortValues(peopleMutable,</p><p> CFRangeMake(0, CFArrayGetCount(peopleMutable)), </p><p> (CFComparatorFunction)ABPersonComparePeopleByName,</p><p> (void*)ABPersonGetSortOrdering());</p><p> </p><p> CFRelease(addressBook);</p><p> CFRelease(people);</p><p> CFRelease(peopleMutable);</p><p> </p><p> </p><p>}</p><p>@end</p></blockquote><p></p>
[QUOTE="terrychu01, post: 1380343, member: 242158"] 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 [COLOR="Silver"]@implementation ViewController[/COLOR] - (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)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown); } - (IBAction)adbook:(id)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 [/QUOTE]
Verification
Post reply
Forums
macOS & iOS Developer Playground
iOS Development
Sorting the Address Book database problem
Top