Hi,
I have tried it with getting the result into a BOOL, but the compilation gives the same warning message. Do I overlook something here?
Here is my code. If anybody can help.
NSString *docsDirectory = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0];
NSString *path = [docsDirectory stringByAppendingPathComponent: Name];
NSFileManager *fileManager = [NSFileManager defaultManager];
NSError *error = [[NSError alloc] init];
[fileManager removeItemAtPath:path error:&error];
NSURL *url = [NSURL URLWithString:@"http://www.szrt.hu/xls/luxor.csv"];
NSMutableURLRequest *liveRequest = [[NSMutableURLRequest alloc] initWithURL:url];
[liveRequest setCachePolicy:NSURLRequestReloadIgnoringCacheData];
[liveRequest setValue:@"headervalue" forHTTPHeaderField:@"headerfield"];
NSURLResponse *response;
NSData *myData = [NSURLConnection sendSynchronousRequest:liveRequest returningResponse:&response error:&error];
NSString *myString=[[NSString alloc] initWithData:myData encoding:NSASCIIStringEncoding];
[myString writeToFile:path automatically:YES encoding:NSASCIIStringEncoding];
[myData release];
[myString release];
return true;
The warnings are the followings.
/Users/endre/Documents/Luxor/Classes/LuxorFile.m:48:0 /Users/endre/Documents/Luxor/Classes/LuxorFile.m:48: warning: 'NSString' may not respond to '-writeToFile:automatically:encoding:'
/Users/endre/Documents/Luxor/Classes/LuxorFile.m:48:0 /Users/endre/Documents/Luxor/Classes/LuxorFile.m:48: warning: (Messages without a matching method signature
/Users/endre/Documents/Luxor/Classes/LuxorFile.m:48:0 /Users/endre/Documents/Luxor/Classes/LuxorFile.m:48: warning: initialization makes integer from pointer without a cast
/Users/endre/Documents/Luxor/Classes/LuxorFile.m:48:0 /Users/endre/Documents/Luxor/Classes/LuxorFile.m:48: warning: unused variable 'writeResult'
/Users/endre/Documents/Luxor/Classes/LuxorFile.m:68:0 /Users/endre/Documents/Luxor/Classes/LuxorFile.m:68: warning: 'NSString' may not respond to '-writeToFile:atomically:encoding:'
Thanks in advance for any help.