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


ピックアップ記事

[4]:View間での移動について

2010年11月30日 過去Blog
今回は、あるviewから他のviewへ移動させる方法を実装します。UINavigationController を利用し、以前の記事で制作済のコードを利用します。 以前の記事(とても簡単です。)をまだ読まれてない方は、そちらを読んでから、この記事をご覧ください。 今回学ぶこと: 新規ビューの追加 ビューコントローラを追加する ビューを移動するための設定 ビューとコードを接続 戻るボタンを設置 …
「[4]:View間での移動について」をはてなブックマークに追加

tabBar内にABPeoplePickerNavigationControllerを表示させる

2011年01月17日 過去Blog
もともと入っている電話アプリなんかは、タブバーを選択すると連絡先が表示されるようになっていますが、それを実装するために、いろいろ試行錯誤してみましたが、以下のようにすることで、実装出来ました。 この件に関しては、あまり、情報がなかった(モーダルビューにpickerを表示させる例は多々ありましたが・・・)ので、スマートな方法かどうかは不明ですので、もし、もっとスマートな方法をご存知の方がいらっしゃいましたら、是非コメントください。…
「tabBar内にABPeoplePickerNavigationControllerを表示させる」をはてなブックマークに追加

UITableView のcellの複数選択を実装する

2011年01月25日 過去Blog
//セルが選択された際に呼び出される - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { //選択されたセルを取得 UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath]; /…
「UITableView のcellの複数選択を実装する」をはてなブックマークに追加

PHPでサイトのタイトルを取得

2010年03月30日 過去Blog
参照元:http://creazy.net/2008/05/php_get_page_title_sample.html how to cure depression…
「PHPでサイトのタイトルを取得」をはてなブックマークに追加

UTCと日本時間

2010年03月24日 過去Blog
UTCの0時を日本の時間に変換すると朝の九時(UTC + 9時間)。 UTC Wednesday, 24 March 2010, 00:00:00 ↓↓↓↓↓↓ Kyoto (Japan) Wednesday, 24 March 2010, 09:00:00 UTC+9 hours
「UTCと日本時間」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy