No netwrok alert?

Discussion in 'iOS Programming' started by anim510, Oct 26, 2008.

  1. anim510 macrumors newbie

    Joined:
    Oct 20, 2008
    #1
    hi all,

    Is everyone konw about the "No Network api"?

    I mean, the "No Network api" is just like the Safari show the alert message when the network is broken.

    Is these the api support this function ?

    kind regards,
    Neil
     
  2. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
  3. anim510 thread starter macrumors newbie

    Joined:
    Oct 20, 2008
    #3
    Thanks !

    Thanks guys, i can get the internetConnectionStatus that is euqal "2" when the network is ok, get 0 when the network is break.

    I just add Reachability.h Reachability.m into the xcode, and there is a lot of code that i don't use it.
     
  4. robbieduncan Moderator emeritus

    robbieduncan

    Joined:
    Jul 24, 2002
    Location:
    London
    #4
    I wouldn't worry about the extra code: if it's never called I think the compiler will strip it out...
     
  5. anim510 thread starter macrumors newbie

    Joined:
    Oct 20, 2008
    #5
    Thanks !

    :) Thanks buddy !
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    Code:
    I wouldn't worry about the extra code: if it's never called I think the compiler will strip it out...
    Actually the gcc linker isn't very smart about this. It does dead-code stripping on a per file basis. If there's nothing in a .o file that's used the whole file will be dead-stripped. If some is used and some isn't then none will be dead stripped. Also, the dynamic nature of Objective-C can make it difficult to dead-strip very well.

    I do wrap debugging code in #if DEBUG so it's commented out in the final builds and in some cases I will also wrap code that I know isn't used in #if NOT_USED.

    In the end though the success or failure of a product isn't going to be determined by its code size.
     

Share This Page