EDIT: This will not work for network URLs (see comments)
As of iOS 5, there is a new NSURL instance method:
- (BOOL)checkResourceIsReachableAndReturnError:(NSError **)error
Point it to the website you care about or point it to apple.com; I think it is the new one-line call to see if the internet is working on your device.