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


ピックアップ記事

supplied argument is not a valid MySQL result resource

2009年11月27日 過去Blog
supplied argument is not a valid MySQL result resource 直前に記述したSQLクエリに問題があるということ。 たとえば、存在しないフィールドを指定していたり・・・。 私の場合は、なぜか全角スペースが入っていて気付かないままでした・・・。(_ _。)・・・シュン atlanta life insurance…
「supplied argument is not a valid MySQL result resource」をはてなブックマークに追加

PHP POSTチェック

2011年05月15日 過去Blog
http://www.sakura-pc.jp/php/02020000.shtml
「PHP POSTチェック」をはてなブックマークに追加

NSAssert,NSAssert2

2011年04月13日 過去Blog
NSAssert 指定した条件が間違っていればlogに文字列を書き込む NSAssert2 指定した条件が間違っていればlogに引数2つの文字列を書き込む http://www.oomori.com/cocoafw/Foundation/NSAssert2/NSAssert2.html free raspberry ketones…
「NSAssert,NSAssert2」をはてなブックマークに追加

PHP での SimpleXML 処理>>RSS取得

2009年12月05日 過去Blog
phpでrssの情報を抜き出したい場合は、titleやlinkの要素は以下の通りで抜き出せます。 <?php // Load and parse the XML document $rss = simplexml_load_file('http://partners.userland.com/nytRss/nytHomepage.xml'); $title = $rss->channel->title; ?> …
「PHP での SimpleXML 処理>>RSS取得」をはてなブックマークに追加

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ソース内からメールアドレスを抽出」をはてなブックマークに追加
© graffiti on the web . All rights reserved. WordPress Theme by comfy