Crash during file save
Crash while generating temporarly files
the logged path is /Users/admin/Desktop/.temp/animal.rtf
i also have tried this
i know that the NSData is fine because this code worked earlier, then i messed with the path stuff and it stopped working
when i go and look in .temp there is nothing in it
Code:
NSString *path = [@"~/Desktop/.temp" stringByExpandingTildeInPath];
path = [NSString stringWithFormat:@"%@/%@", path, [[source objectAtIndex:selected] name]];
NSLog(path);
[tempData writeToFile:path atomically:NO];the logged path is /Users/admin/Desktop/.temp/animal.rtf
i also have tried this
Code:
NSString *path = [@"~/Desktop/.temp" stringByExpandingTildeInPath];
path = [NSString stringWithFormat:@"\"%@/%@\"", path, [[source objectAtIndex:selected] name]];
NSLog(path);
[tempData writeToFile:path atomically:NO];i know that the NSData is fine because this code worked earlier, then i messed with the path stuff and it stopped working
when i go and look in .temp there is nothing in it
Did you run a fileExistsAtPath: to verify that it is correctly finding the directory.
Try something of this nature, it sounds like the path isnt working for you.
NSFileManager *manager = [NSFileManager defaultManager];
if(![manager fileExistsAtPath: path])
{//Failed
}
This should help you understand what is failing a little better
Try something of this nature, it sounds like the path isnt working for you.
NSFileManager *manager = [NSFileManager defaultManager];
if(![manager fileExistsAtPath: path])
{//Failed
}
This should help you understand what is failing a little better
Crash info (backtrace, failed assertions, and the like) are very useful too. Are you sure that you have no null pointers lying around? Also, NSLog(path) is bad practice - what if you have a path with a % symbol in it? You should NSLog(@"%@",path) instead.
Did you ever wonder why we had to run for shelter when the promise of a brave new world unfurled beneath the clear blue sky?
werid. i left the house came back 2 hours later and ALL the stuff it used to crash on (spaces in name, spaces in file) are gone it works regardless......
no code changes at all.....
no code changes at all.....
that happens to me a lot. i have so much source code on this computer
i have so many duplicates of the same projects, and copies and etc 
I need source control
i have so many duplicates of the same projects, and copies and etc 
I need source control
Possibly Related Threads...
| Thread: | Author | Replies: | Views: | Last Post | |
| save data of the app, and not loose them if i update the app | sefiroths | 2 | 2,006 |
Oct 16, 2012 12:01 PM Last Post: sefiroths |
|
| can photoshop save a png with only alpha channel? | sefiroths | 8 | 8,831 |
Jan 20, 2011 01:49 AM Last Post: sefiroths |
|

