To better understand the intricacies of charging Apple products: https://learn.adafruit.com/minty-boost/icharging
To try to clarify-
I was thinking about using a voltage divider for that.
Yes, voltage dividers on the D+ and D- are required for charging.
Also, i tried connecting pin 2 to pin 4 with 10k potentiometer.
No, you must use the proper inductor if you want the chip to work as designed.
The LM2575 Is fairly easy to use as long as you use the right inductor (L1)- NOT a resistor. A Schottky diode is important as well (fast switching with high current), but selecting the right inductor is crucial
to the stability of the circuit and accuracy of the voltage regulation. The datasheet for the LM2575 should include a fairly detailed explanation of exactly what part is required. Read that datasheet! Power inductors aren't like simple resistors where any which one will do, and I would think it unlikely that you're friend would stock them, (unless of course he has built this circuit before.) The three main variables associated with selecting the inductor are the inductance, current capability, and resistance, the most important of which being the inductance value and current capability. The resistance corresponds to http://en.wikipedia.org/wiki/Q_factor
of the inductor and determines how efficient and accurate the circuit is.
Things are much more complicated than i expected
Since it is a switching regulator, it is not as simple as say-a 7805. But it doesn't need to be overly complicated as long as you pay attention to the important bits in the datasheet.