2011年01月17日 過去Blog
– (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @”Cell”; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } //ref of Addressbook ABAddressBookRef book = ABAddressBookCreate(); //Count of Addressbook //CFIndex cnt = ABAddressBookGetPersonCount(book); //NSLog(@”addressbook count is %d “,cnt); //AllRecords of Addressbook CFArrayRef records = ABAddressBookCopyArrayOfAllPeople(book); //record at index=i ABRecordRef person = CFArrayGetValueAtIndex(records,indexPath.row); NSString *firstName = (NSString *)ABRecordCopyValue(person, kABPersonFirstNameProperty); NSString *lastName = (NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty); if (firstName == nil) { firstName = @””; } if (lastName == nil) { lastName = @””; } cell.textLabel.text = [NSString stringWithFormat:@”%@ %@”,lastName,firstName]; return cell; }

この投稿へのコメント

コメントはまだありません。

コメントを残す

メールアドレスが公開されることはありません。

次のHTML タグと属性が使えます。
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

CAPTCHA


ピックアップ記事

PHP 要素Aが配列Bの中に存在するか調べる in_array

2010年06月11日 過去Blog
要素Aが配列Bの中に存在するか調べるには in_array を使う。 以下の例では、配列Bの中に要素Aが存在するので「Got elementA」が出力されます。 $arrayB = array("elementA", "NT", "Irix", "Linux"); if (in_array("elementA", $arrayB)) { echo "Got elementA"; }
「PHP 要素Aが配列Bの中に存在するか調べる in_array」をはてなブックマークに追加

php 配列の要素から重複を削除し、添え字を再配布する

2009年12月07日 過去Blog
$example_array= array( "green", "red", "green", "blue", "red"); phpで上記のような配列から、重複要素を削除するには $example_array = array_unique($example_array); とすることで重複要素は削除されます。 …
「php 配列の要素から重複を削除し、添え字を再配布する」をはてなブックマークに追加

PHP 現在表示中のドメイン名、ファイル名取得

2010年07月15日 過去Blog
//絶対パス echo __FILE__ . ''; //ディレクトリパス echo dirname(__FILE__) . ''; //スクリプト名 echo basename(__FILE__) . ''; echo $_SERVER["SERVER_NAME"]; echo $_SERVER["SCRIPT_NAME"]; echo '?'; echo $_SERVER["QUERY_…
「PHP 現在表示中のドメイン名、ファイル名取得」をはてなブックマークに追加

UIViewControllerのインスタンスメソッドとタイミング

2011年01月13日 過去Blog
どのタイミングに実行されるメソッドなのかを調べるには、以下のようにすれば、デバッガにNSLogが出力されるタイミング(メソッドが実行されるタイミング)を調べることが出来ます。 - (void)loadView { [super loadView]; NSLog(@"loadView"); } - (void) viewWillAppear:(BOOL)animated { NSLog(@…
「UIViewControllerのインスタンスメソッドとタイミング」をはてなブックマークに追加

PHPでPING送信を実装する

2010年03月28日 過去Blog
[php]<?php require_once('XML/RPC.php'); function Ping_Send($blog_title,$blog_url){ $ping = array( 'ping.rss.drecom.jp' => '/', 'api.my.yahoo.co.jp' => '/RPC2', 'blog.goo.n…
「PHPでPING送信を実装する」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy