How to include Doxygen method description in Xcode's autocomplete popup?

前端 未结 3 1221
眼角桃花
眼角桃花 2020-12-07 21:21

Using Xcode , I want to have the Doxygen description of my method below the autocomplete option, like alloc:

3条回答
  •  臣服心动
    2020-12-07 21:44

    Good news everyone! Xcode 5 now has built-in support for DOxygen style comments. So, you can comment your methods like this:

    /*!
     * Provides an NSManagedObjectContext singleton appropriate for use on the main 
     * thread. If the context doesn't already exist it is created and bound to the 
     * persistent store coordinator for the application, otherwise the existing 
     * singleton contextis returned.
     * \param someParameter You can even add parameters
     * \returns The a shared NSManagedObjectContext for the application.
     */
    + (NSManagedObjectContext *)sharedContext;
    


    Inline help will look like this:

    inline help



    Quick help will look like this:

    quick help



    And sidebar help will look like this:

    sidebar help

    Here's a handy code snippet you can add the your Xcode Code Snippet library to make method documentation simple:

    /**
     <#description#>
     @param <#parameter#>
     @returns <#retval#>
     @exception <#throws#>
     */
    

    doxygen code snippet

    Now, you can just type "doxy" and poof! You have your doxygen template.

提交回复
热议问题