2013-08-07 3 views
0

내 프로그램에서 내 프로그램에 연락처를 표시하는 데이 기능을 사용하고 있습니다. 그러나 abpersonview의 필드를 클릭해도 아무 일도 일어나지 않습니다.ABPersonViewController 내에서 클릭 이벤트를 처리합니다. 클릭에 응답하지 않음

- (BOOL)personViewController:(ABPersonViewController *) personViewControllershouldPerformDefaultActionForPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier 
     { 
      NSLog(@"IN"); 
       return YES; 
     } 

내 클래스는 아래에있는 내 클래스 정의

#import <UIKit/UIKit.h> 
    #import <CoreFoundation/CoreFoundation.h> 
    #import<AddressBookUI/AddressBookUI.h> 




     @interface ContactTable : UIViewController<UITableViewDataSource,UISearchBarDelegate,UITableViewDelegate,ABNewPersonViewControllerDelegate,UIAlertViewDelegate,ABPersonViewControllerDelegate> 

     @property CFMutableArrayRef filteredData; 

      @property CFArrayRef contactAdd; 

      @property ABRecordRef person; 

      @property ABAddressBookRef addressBook; 

      @property ABPersonViewController *currentPersonView; 

      @property (weak, nonatomic) IBOutlet UISearchBar *contactSearchBar; 

      @property (weak, nonatomic) IBOutlet UITableView *contactTableView; 

      @end 

내가

self.currentPersonView=[[ABPersonViewController alloc]initWithNibName:@"ContactTable.h" bundle:nil]; 

     if(isFiltered) 

      self.person=CFArrayGetValueAtIndex(self.filteredData,indexPath.row); 

     else 

      { 
      NSLog(@"%ld index:%d", CFArrayGetCount(self.contactAdd),indexPath.row); 
      self.person=(ABRecordRef)CFArrayGetValueAtIndex(self.contactAdd,indexPath.row); 
      } 

     self.currentPersonView.displayedPerson=&(*self.person); 


     self.currentPersonView.allowsEditing=YES; 

     self.currentPersonView.allowsActions=YES; 

     [self.navigationController pushViewController:self.currentPersonView animated:YES]; 

으로이 Currentpersonview을 사용하고하지만 난이 기능에 어떤 respose을 얻을 어차피, AbPersonView의 객체를 가지고 ABPersonView를 클릭하면 .....

무엇이 문제일까요 ??

self.currentPersonView.personViewDelegate = self;//or some other class... 

및 대리자 클래스의 대응 대리자 메서드를 구현 :

– personViewController:shouldPerformDefaultActionForPerson:property:identifier: 

도이 클래스의 인터페이스 선언해야을

답변

0

나는 당신이 대리자를 설정해야 가정합니다.

관련 문제