Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

anim510

macrumors newbie
Original poster
Oct 20, 2008
15
0
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
 
Thanks !

Look at the Reachability sample...

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.
 
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.