ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • [OSX] Xcode에서 자동 생성한 주석 __MyCompanyName__ 값 바꾸기
    기술 관련/OSX 2010. 2. 25. 11:46
    XCode에서 Class를 생성하면 다음과 같은 주석이 자동으로 추가되는 것을 볼 수 있다.


    //
    //  Song.h
    //  Terminal
    //
    //  Created by J.S.Hong on 10. 2. 24..
    //  Copyright 2010 __MyCompanyName__. All rights reserved.
    //

    그런데, 이 주석을 살펴보면 생성자는 내 이름으로 되어 있는데, 아래 __MyCompanyName__ 에 대한 값은 정의하는 부분이 없다. 인터넷을 살펴 보니 다음과 같은 방법으로 해결 한다고 한다.

    $ defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions -dict ORGANIZATIONNAME "회사이름" 

    혹은 다음과 같이 해도 된다.

    $ defaults write com.apple.Xcode PBXCustomTemplateMacroDefinitions ‘{”ORGANISATIONNAME” = “회사이름”;}’

    근데 defaults write라는 명령이 뭐하는 건지 궁금해서 osx man page를 찾아 봤더니 다음과 같았다.

    Defaults allows users to read, write, and delete Mac OS X user defaults
        from a command-line shell. Mac OS X applications and other programs use
        the defaults system to record user preferences and other information that
        must be maintained when the applications aren't running (such as default
        font for new documents, or the position of an Info panel). Much of this
        information is accessible through an application's Preferences panel, but
        some of it isn't, such as the position of the Info panel. You can access
        this information with defaults

    대충 해석 하자면 Mac OS X 응용 프로그램이나 다른 프로그램이 user preferences나 application이 실행 되지 않더라도 관리되어야 할 정보등을 기록할 때 사용하는 것이라고 한다. MS윈도우즈의 경우 registry 와 같은 기능으로 보인다.

    위의 __MyCompanyName__의 경우도 기본적으로는 Xcode에서 사용하는 거니까 Xcode에서 설정하는게 맞을 텐데, 이걸 궂이 command line에서 하도록 했을까라는 생각이 든다.

    '기술 관련 > OSX' 카테고리의 다른 글

    맥에서 gradle 설치하기  (0) 2021.08.25
    [MacOS] Snow Leopard용 MacVIM  (0) 2009.12.30
    [MacOS] Snow leopard에서 Expose 단축 키가 동작하지 않으면?  (0) 2009.12.17
    Mac Port  (0) 2009.07.18

    댓글

Designed by Tistory.