cozzin
코찐 기술 블로그
cozzin
전체 방문자
오늘
어제
  • 분류 전체보기
    • Kotlin
    • 백엔드
    • iOS
      • Swift
      • SwiftUI
      • Combine
      • Architecture
    • 개발환경
    • 세미나
    • 생각정리
    • 스터디
    • CS
      • Refactoring
      • OS

블로그 메뉴

  • 홈
  • 태그
  • 방명록
  • LinkedIn
  • 강의

공지사항

인기 글

태그

  • SwiftUI
  • multicast
  • Combine
  • 컴퓨터공학
  • 워닝제거
  • 운영체제
  • WWDC21
  • Warning
  • Swift
  • 디자인패턴
  • darkmode
  • os
  • ios
  • slide-over
  • CS
  • Ribs
  • 테스트
  • WWDC
  • 리팩토링
  • XCode

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
cozzin

코찐 기술 블로그

워닝 제거하기: ld: warning: method '{methodName}' in category from {file build path}.o conflicts with same method from another category
iOS

워닝 제거하기: ld: warning: method '{methodName}' in category from {file build path}.o conflicts with same method from another category

2021. 1. 29. 18:53
반응형

이번에도 워닝 제거하기 시리즈인데요.

이런 에러를 만났습니다.

 

ld: warning: method '{methodName}' in category from {file build path}.o conflicts with same method from another category

 

objective-c에서 카테고리를 통해 method를 확장한 케이스 입니다.

두개의 카테고리에서 동일한 이름을 쓰는 method를 발견할 수 있었습니다.

조금 이상한 것은 다른 클래스명을 가지고 있었는데도 워닝이 뜨고 있는 점 입니다.

 

알고보니 해당 method는 팩토리 메소드로 사용하고 있었고

카테고리를 구현하는 .m 파일 안에서 중복된 2개의 구현부가 있었습니다.

 

예를 들어보면 이런식 입니다.

// MyClass+CategoryName.h

@interface MyClass (CategoryName)
- (void)templaeMethodName;
@end
// MyClass+CategoryName.m

@implementation MyClass (CategoryName)
- (void)templaeMethodName {
    // something
}

- (void)templaeMethodName {
    // something
}
@end

 

이렇게 구현 하는 method가 2개나 있었던 겁니다... ㄷㄷ;;;

다양한 이유로 이 이슈가 뜨는 것 같은데 또 발견되면 포스팅하겠습니다.

반응형
저작자표시 (새창열림)

'iOS' 카테고리의 다른 글

@testable import로 연결한 모듈에서 Undefined symbol이 발생하는 이슈 대응  (0) 2021.04.17
Could not insert new outlet connection 이슈 대응  (0) 2021.02.04
워닝 제거하기: Skipping duplicate build file in Compile Sources build phase  (0) 2021.01.29
워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift  (0) 2021.01.29
[iOS] grouped style tableView에서 위아래 여백 제거하기  (0) 2021.01.28
    'iOS' 카테고리의 다른 글
    • @testable import로 연결한 모듈에서 Undefined symbol이 발생하는 이슈 대응
    • Could not insert new outlet connection 이슈 대응
    • 워닝 제거하기: Skipping duplicate build file in Compile Sources build phase
    • 워닝 제거하기: Implicit import of bridging header '{YourApp}-Bridging-Header.h' via module '{YourApp}' is deprecated and will be removed in a later version of Swift
    cozzin
    cozzin
    Software Engineer

    티스토리툴바