Data saving code is working on simulator but not on iphone
<pre><code>+(NSString*)pathoffile2{

    NSArray *path2 = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
    NSString *documentfolder2 = [path2 objectAtIndex:0];
    return [documentfolder2 stringByAppendingFormat:@"myuserlist"];
    }

-(IBAction)buttonpressed:(id)sender{

NSString *str = [[NSString alloc]init];

str = txt1.text;

NSArray *arr = [[NSArray alloc]initWithObjects:str, nil];

NSString *filepath = [Test4 pathoffile2];

[arr writeToFile:filepath atomically:YES];

NSLog(@"arr is %@",arr);

}
</code></pre>

<p>This code is running well in simulator, it saves data and retrieve data in simulator but not working on actual iPhone, actually directory is created in actual device but not saving data in device ,It saves null value, What is the problem, I can't understand, everything is ok but not working on device. My Xcode version is 4.3 and device iOS is 4.3.3 is their </p>
