My iPhone (4, 16gb) ran out of battery yesterday so i plugged it in to charge on the usb socket on my laptop, it turned on and charged, but then started flashing between the lock screen and the charge screen as if i was plugging and unplugging it, over time it came to be spending more time on lock screen than charge and began effectively draining itself by lighting up and making a noise every time a tiny bit of charge trickled in every few minutes. I tried plugging it in to the wall instead and got the same problem, then i got an error saying that the device i've connected is not optimised for iPhone (or words to that effect), this was even coming up when it wasn't plugged in, and also an error saying charging is not supported by this accessory, which all seems really strange seeing as the 'device/accessory' that doesn't support charging and isn't optimised for iPhone is an official Apple iPhone charger. I've tried blowing/gently brushing the connector on the cable and on the phone to no avail. The cable is fine as it charges an iPad, which I assume draws more current. I have no way of checking whether the cable works for transferring of data or not as the computer I have doesn't have Mac OS or Windows on it and I can't seem to get any decent 3rd party apps that work, thereforee any solutions along the lines of plug it in to your pc/mac and reinstall the OS are completely useless to me, i've had the 'charging not supported' error come up before but it was when the cable i was using was damaged, i'm really at a loss as to what it could be