[array writeToFile:[documentsDirectory stringByAppendingPathComponent:@"data.plist" atomically:YES];
this line gives error that method -stringByAppendingPathComponent not found. whats the issue
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSArray *array = [[NSArray alloc]initWithObjects:@"First", @"Second", @"Third", nil];
[array writeToFile:[documentsDirectory stringByAppendingPathComponent:@"data.plist" atomically:YES]];
And then
If it is still not creating the plist then check whether your array or dictionary must be empty.