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


ピックアップ記事

Word Pressの自動アップグレードに失敗する

2011年01月12日 過去Blog
ルートディレクトリが見つかりません ディレクトリが見つからない関連のエラーは以下のように、「wp-config.php」に追加すれば、直るようです。 参考:「wp-config.php_の編集」 define('FTP_BASE', '/path/to/wordpress/'); define('FTP_CONTENT_DIR', '/path/to/wordpress/wp-content/'…
「Word Pressの自動アップグレードに失敗する」をはてなブックマークに追加

iPhone UILabel 高さをテキストの量で決める

2011年04月30日 過去Blog
http://www.hirano-dept.com/blog/2011/01/iphone-uilabel.html NSString *str = @"sample string"; CGSize size = [str sizeWithFont:[UIFont boldSystemFontOfSize:13] constrainedToSize:CGSizeMake(5…
「iPhone UILabel 高さをテキストの量で決める」をはてなブックマークに追加

macでhostsファイルの切り替え

2010年12月08日 過去Blog
以前、macでのhostsファイルの編集方法を紹介しましたが、hostsの切り替えに便利なツールがありましたので、それを紹介します。 hoster このソフトを使えば、ターミナル上から、hostsファイルを編集する必要がなく、GUIの操作だけでhostsを変更することが可能です。頻繁にhostsの設定を変更する必要がある方にとっては、とても重宝するのではないでしょうか。…
「macでhostsファイルの切り替え」をはてなブックマークに追加

ABPeoplePickerNavigationControllerのキャンセルボタンを無効にし、新規追加ボタンを実装する

2011年01月17日 過去Blog
viewController内に以下のようにインターフェースを宣言します。 @interface ABPeoplePickerNavigationController (Expose) @property (nonatomic, assign) BOOL allowsCancel; @property (nonatomic, assign) BOOL allowsCardEditing; @end 同じファイル内に、以下のように設定します。 ABPeoplePickerNavigationController *contactsNavController = [[ABPeoplePickerNavigationController alloc] init]; contactsNavController.tabBarItem.title = @"連絡先"; contactsNavController.allowsCancel = NO; contactsNavController.allowsCardEditing = YES; contactsNavController.peoplePickerDelegate=self; …
「ABPeoplePickerNavigationControllerのキャンセルボタンを無効にし、新規追加ボタンを実装する」をはてなブックマークに追加

iPhoneからWordPressへの画像のアップロードに失敗する

2011年01月12日 過去Blog
Wi-Fi環境でエラーが連続したので、3Gにしてみると、一定のサイズまでは正常にアップロードされ、サイズが少し大きくなると途中でエラーになります。 Word Press側の問題なのか、なんなのか切り分け出来なかったので、いろいろ調べていると、Word Press 本体のバージョンアップをすれば、直るという記事を見つけたので、一度、試してみようと、WP管理画面上から、自動アップグレードを実行すると…
「iPhoneからWordPressへの画像のアップロードに失敗する」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy