0
나는 초보자입니다. 나는 NSMatrix에 문제가있다. NSMatrix를 여러 개 만들었지 만 첫 번째로로드하고 싶습니다. 확인하지 않았습니다. 이 코드를 사용하여 생성했지만 항상 확인했습니다.코코아에서 라디오 버튼을 선택 해제하는 방법
prototype= [[NSButtonCell alloc] init];
[prototype setTitle:@""];
[prototype setButtonType:NSRadioButton];
NSRect matrixRect = NSMakeRect(400, textfield_Y, 50, 20);
myMatrix = [[NSMatrix alloc] initWithFrame:matrixRect
mode:NSRadioModeMatrix
prototype:(NSCell *)prototype
numberOfRows:1
numberOfColumns:1];
[myMatrix setTag:300+i];
//[myMatrix setAction:@selector(radioButtonClicked:)];
[myMatrix setTarget:self];
NSArray *cellArray = [myMatrix cells];
[[cellArray objectAtIndex:0] setTag:0];
[guiView addSubview:myMatrix];
[prototype release];
[myMatrix release];
아이디어가 있으십니까? 감사합니다 NSButtonCell에 많은
나는 코드를 시도했지만 여전히 확인. – user2656381
다른 설정이 작동합니까 (예 : 제목)? 코드의 3 번째 줄에 NSRadioButton 설정이있을 수 있습니다. 라디오 버튼을 사용할 때는 항상 하나를 선택해야합니다. 대신에'NSSwitchButton'을 시도해 주시겠습니까? –