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 配列を展開する foreach

2010年06月08日 過去Blog
foreachで、配列を展開する foreach ($array as $key => $val) { echo $key ; echo $val; }
「PHP 配列を展開する foreach」をはてなブックマークに追加

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

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

IE・FireFoxで使えるお気に入りボタン(ブックマークボタン)

2009年12月09日 過去Blog
<script type="text/javascript"> <!-- if(navigator.userAgent.indexOf("MSIE") > -1){ //Internet Explorer document.write('<!-'+'-[if IE]>'); document.write('<input type="button" valu…
「IE・FireFoxで使えるお気に入りボタン(ブックマークボタン)」をはてなブックマークに追加

html、CSS テキストの自動折り返しを禁止する

2010年04月16日 過去Blog
<strong>white-space</strong> normal 標準 (初期値) nowrap 自動的な折り返しを禁止する prozac and alcohol…
「html、CSS テキストの自動折り返しを禁止する」をはてなブックマークに追加

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 現在表示中のドメイン名、ファイル名取得」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy