0

2 개의 NSTableView를 포함하는 splitview를 사용하는 OS X 앱이 있습니다. 하나의 테이블 뷰에서 값을 변경하면 두 번째 테이블에서 관련된 값이 변경되지만 이는 발생하지 않습니다.두 바인딩 된 테이블 뷰 중 하나가 다른 테이블의 변경 사항으로 업데이트되지 않았습니다.

접착제 코드가 아닌 데이터 바인딩을 사용하는 CoreData를 사용합니다. 각 TableView에 대해 NSArrayController가 있습니다. 두 번째 (오른쪽있는 TableView)에 나타납니다 미국 여행 책

American Travel <-- selected 
Browse All 
Fiction 
Science Fiction 

해당 데이터, 여행 도서 을, 즉리스트 : 초기 화면 은 첫 번째 (왼쪽의 TableView)의 예상 데이터를 함께 제공 이는 두 번째 컨트롤러의 콘텐츠 세트가 다음과 같이 설정 되었기 때문입니다.

leftController.selection.books 

즉, 올바른 데이터에 바인딩 된 TableColumns가 있습니다. 첫 번째 TableView에서 새로운 선택에 이어 두 번째 TableView를 업데이트하지 못하는 문제와 관련된 경고가 표시되지 않습니다. Observer가 시스템에 의해 자동으로 으로 설정되어 있고, 왼쪽 ArrayController에서 선택 사항 인 이 변경되었다고 생각합니다. 검사 모두 ArrayController에 대한 특성 Inspector에서

은 다음과 같습니다

Avoid Empty Selection 
Preserve Selection 
Select Inserted Objects 
Auto Rearrange Content 

값이 RightController의 단일 TableColumn의 바인딩 - bookList

Bind to : RightController 
Controller Key : arranged Objects 
ModelKey Path : name 

내 질문 :

내가 가진 문제는 그입니다 오른쪽/초/book_names의 데이터 왼쪽/첫 번째/북 타입에서 선택을 변경하면 변경되지 않습니다.
TableView. 이 문제를 해결하려면 어디에서보아야합니까? 나는 그것이 매우 작은 것임을 알고있다. 작은 체크 박스와 같다. 나는 그것을 찾을 수 없다!

/// Begin Category.h 
@class Book; 

@interface Category : NSManagedObject { 
} 
@property (nonatomic, retain) NSSet * books; 
@property (nonatomic, retain) NSString * name;// name of book_category 

...... 

더 많은 정보 ADDED 2011년 4월 13일

I have added a button which is connected an action in the 

LeftArrayController(Category) namely, selectNext: . When I click 

the button, the selection in the CATEGORY TableView does not 

visibly change, but the TableView on the right (Books) does change, 

as the list of books on the Right continually changes. 

If I click the TableView with the mouse, no selection change is done 

either in effect on the RightTableView or in the visible 

sense on the Left TableView. Why is the mouseClick not effecting a 

visible change int the TableViewColumn? That is, why is the mouse 

unable to change selection, whereas the button is able to. 

There is only one column in the TableView. In Attributes Inspector I have 

tried all combination of Empty,Column and Type Select for this single selection 

Table. Is there no way around using NSTableView Delegate methods to set selection? 

답변

0

이것은 사용자 오류의 사건이었다. 내 DataModel에 오류가있었습니다. 엔티티는 클래스 NSSet * 속성의 독립형으로 관계를가집니다. 이러한 관계 중 하나는 1에서 1로 설정되었고 1에서 다수 필요했습니다. 두 테이블은 이제 작동 중 !! 대단히 고맙습니다. 나는 어떤 의견을받지 못했을 때 나는 멍청한 실수를 저질렀다는 것을 알았다. . 나는 이것이 미래에 누군가를 돕기를 바랍니다.

마크