Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
path=@\"toto.html\"; (physically located in the Resources Rep, included in Xcode project) html = [[NSString alloc] initWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&error];
Anybody know why at runtime (simulator), I got a "file does not exist" msg?
should I work with path? Should I put the file somewhere else?
If you don't specify a full path to the file, then the program will look for it in the root of your harddrive. Most people, myself included, have made the mistake of thinking that the file paths are relative to the location of the executable....especially if you come from the Windows world and are used to MSVC++. This isn't the case. You'll have to specify the full path of the file.
Replies
html = [[NSString alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"toto" ofType:@"html"] encoding:NSUTF8StringEncoding error:&error];
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome