The Apple iPhone displays a "No Service" error message whenever the device has difficult processing information from its SIM card. If your iPhone suddenly begins displaying this error message, several potential problems could be to blame. Troubleshoot "No Service" errors before taking the iPhone into Apple or AT&T for repairs.
Walk several yards away and see if the "No Service" message disappears. If it appears only in a specific geographical area, you have discovered a cellular dead spot, which has nothing to do with your device.
Hold down the iPhone's "Home" and "Lock" buttons until the Apple logo appears on its screen. Wait for the device to reboot and see if the "No Service" error message is still there.
Insert an unfolded paper clip into the hole next to the SIM card tray, which sits on top of the iPhone 3G and iPhone 3Gs, and on the right side of the iPhone 4. Push in gently until the tray pops out and remove the SIM card. Blow gently on the SIM card to remove any debris, then reinsert the SIM card face down and replace they tray. Wait for the "No Service" error message to disappear.
Tap the iPhone's "Settings" button, then tap "General" and "Reset." Tap the red "Reset Network Settings" button to reset the iPhone's network. Reseting the iPhone's network settings clears out its memory, which removes any device-related errors that could cause a SIM read error.
Contact AT&T if you determine your iPhone is not the cause of the error. Inquire about a replacement SIM card, as a damaged or defective SIM card is the most likely cause at this point.
If you insert a non-AT&T SIM card into an iPhone you purchased from AT&T, there is no authorised way to make the "No Service" error message disappear. Although it is possible to "unlock" the iPhone to use with any carrier's SIM card, doing so voids its Apple warranty and violates AT&T's "Terms of Service."