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


ピックアップ記事

htmlソース内からメールアドレスを抽出

2010年05月20日 過去Blog
//mailto:が使用されているメールアドレス preg_match_all("/mailto:(.+?)"/s", $html2, $matches); //mailto:は使用されておらず、@を基準に判別 preg_match_all('/[-.w/]+@[-._[:lower:]d]+.[[:lower:]]{2,4}/s', $html2, $matches); …
「htmlソース内からメールアドレスを抽出」をはてなブックマークに追加

iPhone CoreLocation で位置情報、方位情報の取得

2011年04月28日 過去Blog
http://www.bright-sys.co.jp/blog/iphone-corelocation-1/ http://www.bright-sys.co.jp/blog/iphone-corelocation-2/ divorce lawyers san diego…
「iPhone CoreLocation で位置情報、方位情報の取得」をはてなブックマークに追加

外部のサイトから画像をサーバに取得(コピー)

2009年12月06日 過去Blog
$img_path // 取得する画像のパス(URL) $path = "ここは保存先のパス";  //  /home/ドメイン/public_html/imagesなど $img = file_get_contents($img_path) ;//画像を取得 $fullpath = $path.basename($img_path);//画像の保存フルパス file_put_conten…
「外部のサイトから画像をサーバに取得(コピー)」をはてなブックマークに追加

SQLite で Limit や ORDER BY RANDOM()など

2010年12月16日 過去Blog
SQLite で抽出データを並び替え SELECT * FROM テーブル名 ORDER BY フィールド1 DESC, フィールド2 DESC, フィールド3 ASC ; 上記のようにすることで、「テーブル名」という名前のテーブルの全てのデータを「フィールド1」の降順で並べ、「フィールド1」が同値の場合、次の「フィールド2」を降順に並べ、さらに「フィールド2」も同値の場合、「フィールド3」を基準に昇順に並び替えます。 ASC は結果が昇順に並びかえ、 DESC はそれが降順に並ぶかえることを表します。そのどちらも指定されていない場合、 ASC で並び替えられます。 SQLite でランダムにデータを抽出する まず、SQLite でランダムにデータを取り出す方法 SELECT * FROM entry ORDER BY RANDOM(); SQLite で行数指定(LIMIT)でデータを抽出する SELECT文では、WHERE句などを指定した場合でも条件に一致する全てのデータを取得します。この取得する件数を制限したい場合にはLIMIT句を使います。書式は以下の通りです。 SELECT カラム名, ... FROM テーブル名 LIMIT 行数; …
「SQLite で Limit や ORDER BY RANDOM()など」をはてなブックマークに追加

PHP 配列の要素を指定し、キーを取り出す

2010年04月14日 過去Blog
配列の要素の値から、そのキーを取り出す場合。 <?php $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red'); $key = array_search('green', $array); // $key = 2; $key = array_search('red', $array); // $key = …
「PHP 配列の要素を指定し、キーを取り出す」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy