iOS 4.2 sdkのABGroupAddMemberにバグ
ABAddressBookに関するアプリを勉強していたのですが、ABGroupAddMember が機能せず、困っていました。
日本語サイトでは情報が見当たらなかったので、いろいろ海外のサイトを調べていると同じように困っている方が大勢いるようでした。

PR : ホームページテンプレートなら、テンプレートモンスター
PHP プログラム配布
ABAddressBookに関するアプリを勉強していたのですが、ABGroupAddMember が機能せず、困っていました。
日本語サイトでは情報が見当たらなかったので、いろいろ海外のサイトを調べていると同じように困っている方が大勢いるようでした。
またまた、i.softbank.jpのメールでエラーが出ました。
以下のようなアラートが表示され、送信済メッセージが削除出来ません。
メッセージの移動ができません
このメッセージはメールボックス”ゴミ箱”へ移動できません。
http://www.edumobile.org/iphone/iphone-programming-tutorials/tabbarcontroller-with-navigationcontroller-and-tableview-in-iphone/
http://iphone-app-developer.seesaa.net/article/130194298.html
- (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;
}
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;
もともと入っている電話アプリなんかは、タブバーを選択すると連絡先が表示されるようになっていますが、それを実装するために、いろいろ試行錯誤してみましたが、以下のようにすることで、実装出来ました。
この件に関しては、あまり、情報がなかった(モーダルビューにpickerを表示させる例は多々ありましたが・・・)ので、スマートな方法かどうかは不明ですので、もし、もっとスマートな方法をご存知の方がいらっしゃいましたら、是非コメントください。 続きを読む…
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
[self.navigationController presentModalViewController:picker animated:NO];
[picker release];
実機でアプリをテストする際にデバッガ上に以下のようなエラーが頻発します。
原因を調べてみるとどうやら、無視して良いエラーのようですが、どうも気持ちが悪いですね。。
warning: Unable to read symbols for /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.2.1 (8C148)/Symbols/usr/lib/info/dns.so (file not found).
以下のサイトがApple Developer Forum内の上記エラーに関する書き込みですが、アップルの方が、無視して良いと返答したようです。(人物アイコンの右にリンゴマークがついているのがアップルの人なのかな?)
参考サイト:http://twitter.com/#!/Seasons/status/9125395651624960
最近のコメント