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


ピックアップ記事

preg_match

2010年03月24日 過去Blog
自分用メモ $html = ブログから抜き出したソース; preg_match("/抜き出すパターン/", $html); 最初は正規表現が間違っているのかと思い、いくつか正規表現のパターンを変えてテストしてみましたが、手ごたえなし(´;ω;`)ウッ… 正規表現以外の問題だと思い、さらに基本的なことを調べてみると・・・ 「検索対象の文字列が1行か、複数行か。」 ここが問題だったようです…
「preg_match」をはてなブックマークに追加

/etc/hosts ファイルの変更を反映させる

2009年12月05日 過去Blog
hostsファイルの設定を変えた場合は、 # /etc/rc.d/init.d/network resatart または、 # /etc/rc.d/init.d/network reload で反映させる。
「/etc/hosts ファイルの変更を反映させる」をはてなブックマークに追加

.htaccess の落とし穴

2010年04月14日 過去Blog
落とし穴ってほとではありませんが、少しハマってしまったので、恥ずかしながらメモ・・・。 あるサイトをつくっていたのですが、トップページを表示するたびにベーシック認証の画面が表示されるので、おかしいなぁと思い、それを解決しようとサーバ内を調べていました。 もともと .htaccess を置く必要がないディレクトリなので、サーバ上には、そんなファイルはありませんでした。 絶対に認証は、かけていない!…
「.htaccess の落とし穴」をはてなブックマークに追加

MACで使えるSQLite管理ツール

2010年12月06日 mac過去Blog
以前の記事でターミナルを使ってSQLiteのデータベースを作成する方法について触れましたが、phpMyAdminのようなツールがあれば、簡単にデータベースを触れると思い探してみると、「The SQLite Sorcerer」なるソフトが見つかりました。 The SQLite Sorcerer Macで使えるので、試してみましたが、phpMyAdminほどではないにしても、The SQL…
「MACで使えるSQLite管理ツール」をはてなブックマークに追加

PHP 配列から空白要素を削除する

2010年02月20日 過去Blog
配列 $array_exampleの要素のなかで、空白のものを削除。 $array_example = array_filter($array_example, 'strlen');
「PHP 配列から空白要素を削除する」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy