Question about a new SplitView Application

Discussion in 'iPhone/iPad Programming' started by ulbador, Jul 22, 2010.

  1. macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #1
    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. Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #2
    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. thread starter macrumors 68000

    ulbador

    Joined:
    Feb 11, 2010
    #3
    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)

    Thanks!
     

Share This Page