반응형

Objective-C 3

Objective-C에서 @synchronized 잠금/잠금 해제 방법은 무엇입니까?

Objective-C에서 @synchronized 잠금/잠금 해제 방법은 무엇입니까? @synchronized는 상호 배제를 위해 "잠금"과 "잠금 해제"를 사용하지 않습니까?그럼 어떻게 잠금/잠금 해제가 되나요? 다음 프로그램의 출력은 "Hello World"뿐입니다. @interface MyLock: NSLock @end @implementation MyLock - (id)init { return [super init]; } - (void)lock { NSLog(@"before lock"); [super lock]; NSLog(@"after lock"); } - (void)unlock { NSLog(@"before unlock"); [super unlock]; NSLog(@"after unlock")..

source 2023.04.22

사용되지 않는 크기의 대체With Font: iOS 7?

사용되지 않는 크기의 대체With Font: iOS 7? 7의 경우 iOS 7의 경우sizeWithFont:을 사용하다 방법 「UIFont」에입니까?sizeWithAttributes:sizeWithAttributes: 「」, 「」를 합니다.NSDictionary을 지어 UITextAttributeFont글꼴 오브젝트는 다음과 같습니다. CGRect rawRect = {}; rawRect.size = [string sizeWithAttributes: @{ NSFontAttributeName: [UIFont systemFontOfSize:17.0f], }]; // Values are fractional -- you should take the ceil to get equivalent values CGSize..

source 2023.04.17

UITableView, 설정 장소 구분 색상

UITableView, 설정 장소 구분 색상 추가했습니다.UITableViewIB에서 "대리점"과 "데이터 소스"를 설정하면 모든 것이 정상적으로 작동합니다.다음으로 세퍼레이터 색상을 변경하고 싶었지만, 이 방법을 찾을 수 있는 유일한 방법은 대리인 콜백 중 하나에 메서드를 추가하는 것입니다.이걸 더 좋은 위치에 둘 수 있을까요? 지금은 가지고 있지 않지만 컨트롤러에서 'iVar'를 추가하여UITableViewIB에서 세퍼레이터 색상을 설정합니다.viewDidload? -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { [tableView setSeparatorColor:[UIColor..

source 2023.04.17
반응형