iPhone compass not being affected by current As you probably know, electrical current and magnetic fields are close friends.
In an iPhone there is a compass, however there are also lots of cables and in all of them, or at least in most of them passes a current. How come the current doesn't drive the compass away (and far) from the real north?
 A: *

*If current flows one way in one wire, there's probably current flowing oppositely in a nearby wire.  Engineers can arrange those wires next to each other, so magnetic fields cancel (mostly) except very close to the pair.  For even better cancellation, they can use a twisted pair.

*Even better, some cables could be coax - a core wire and a conductive outer shell.  Currents flow in opposite ways through core and shell, cancelling even better than a close pair.

*The currents in a smartphone or tablet are small.  You're not making toast or illuminating the room with it, are you?  Signals are probably microamps to milliamps, and power conductors maybe a few hundred milliamps typically when in use, at times an over one amp.  To match the strength of the Earth's magnetic field, a loop of wire 1cm^2 area and 1cm away has to carry roughly one Amp or so current.  Engineers try to place the magnetometer far from the heaviest current-carrying conductors.

*The currents are varying at RF frequencies, CPU frequencies, $I2C$ frequencies, Bluetooth frequencies, audio frequencies, etc. anything but slow.  The magnetometer doesn't respond to such fast changes - or least, such stray signals that are picked up, are snuffed out with a low-pass filter.  Only the average magnetic field over, say, 100ms or one second, is measured.  
About point #3: Try plugging numbers into this online magnetic field calculator:
http://hyperphysics.phy-astr.gsu.edu/hbase/magnetic/curloo.html#c2
The Earth's magnetic field in places where Humans can be found, at least the non-astronauts, is about 1/4 to 1/2 Gauss.  
In the final analysis, yes, the magnetometer is influenced by nearby circuitry, but steps are taken to reduce it, and just how much accuracy do we expect?  The disturbance is within specs, whatever those specs are exactly.  I wouldn't use a cell phone for life-or-death purposes, navigating huge sea vessels, etc.
Additional reading: "Understanding Smart Phone Sensor Performance: Magnetometer" http://www.sensorplatforms.com/understanding-smart-phone-sensor-performance-magnetometer-2/ 
