File IO, iOS

I have this code for the function call when making a new game to store the game data.

function SaveGame(){
	var sw : StreamWriter = new System.IO.StreamWriter(Application.persistentDataPath);

it works fine on android, but it gives me this error on iOS.

UnauthorizedAccessException: Access to
the path
is denied. at
(System.String path, FileMode mode,
FileAccess access, FileShare share,
Int32 bufferSize, Boolean anonymous,
FileOptions options) [0x00000] in

any ideas why? I’ve also tried (Application.presistentDataPath + “Testfile.txt”) and i get the same error but at a different file path.

Changed it to this and it worked like a charm.

var sw : StreamWriter = new System.IO.StreamWriter(Application.persistentDataPath + "/Testfile.txt");