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


ピックアップ記事

WHOIS pending delete から 取得可能になるまで

2010年03月24日 過去Blog
中古ドメインを探す際、whois の pending delete 表示から取得可能になるまでの期間は5日間? …
「WHOIS pending delete から 取得可能になるまで」をはてなブックマークに追加

全試合を見る方法!2010 FIFA 南アフリカ ワールドカップ W杯 インターネット TV オンライン中継 ストリーミング放送

2010年06月18日 過去Blog
サッカーのワールドカップ(2010 FIFA 南アフリカ ワールドカップ)が開幕して一週間ほど経ちましたが、TV中継が無い試合が見たい!という方も多いのではないでしょうか。 残念ながら「ドイツ - オーストラリア」、「ブラジル - 北朝鮮」など日本のテレビでは中継されない試合は多いですよね。 私自身、見たい試合があるのに、日本では日本のテレビ局が放送しない試合は見る方法が無いので困っていました…
「全試合を見る方法!2010 FIFA 南アフリカ ワールドカップ W杯 インターネット TV オンライン中継 ストリーミング放送」をはてなブックマークに追加

[11] NSUserDefaults を使ってデータを保存・取り出し

2010年12月20日 過去Blog
このチュートリアルでは、各種データをNSUserDefaultsを使って、保存、抽出する方法について説明します。 NSUserDefaults は、データベースの知識を必要としないので、SQLite3のようなデータベースを必要としない(ゲームのハイスコア、ログイン情報、アプリの設定など)、小規模のデータを扱う場合には便利で簡単です。 今回は、例として、初回時にアプリを起動し、名前を入力すると、保存され、次回以降の起動時には、保存された名前が自動的に名前が表示されるアプリケーションを作成します。 …
「[11] NSUserDefaults を使ってデータを保存・取り出し」をはてなブックマークに追加

テーブルの背景を設定する

2010年12月14日 過去Blog
iPhoneアプリに設置されているテーブルの背景色を変更する方法です。 //テーブルの背景色 self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; 文字列の設定と同様に、以下のような記述も可能です。 self.view.backgroundColor = [UIColor colorWithRed:0.0 gre…
「テーブルの背景を設定する」をはてなブックマークに追加

[10] UITabBar での view の切り替え

2010年12月20日 過去Blog
今回は、UITabBar と UITabBarItem の使い方についてです。 UITabBar を使い、UITabBarItems や view を追加する方法です。 1. UITabBar テンプレート を使ってプロジェクトを作成 まず、タイトルの通りに XCode の UITabBar テンプレートを使って、プロジェクトを作成します。 …
「[10] UITabBar での view の切り替え」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy