Question about a new SplitView Application

Discussion in 'iOS Programming' started by ulbador, Jul 22, 2010.

  1. ulbador macrumors 68000


    Feb 11, 2010
    When you create a new Split-View Application in XCode, I am trying to get a handle on something.

    I am completely not understanding a bit in the DetailViewController.h/.m.

    Of course in the .h file, it has the expected:

    @interface DetailViewController : UIViewController ......

    But in the .m file it also has:

    @interface DetailViewController ()

    and then another method and property declaration. I have never seen code like this in the .m file.

    I can't get my brain around it...
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    It's an anonymous category allowing for a truly private interface to be added. Basically it allows that property and method to exist and be visible to all methods in the class but not visible outside the class as they are not part of the public .h file.
  3. ulbador thread starter macrumors 68000


    Feb 11, 2010
    Ahh, that makes total sense! I suppose something like this would be required since objective C seems to lack the ability to make private methods (in the traditional sense)


Share This Page