• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problems with addition of the resource
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with addition of the resource


  • Subject: Re: Problems with addition of the resource
  • From: Tommy Nordgren <email@hidden>
  • Date: Sun, 1 Mar 2009 02:24:30 +0100


On Mar 1, 2009, at 12:57 AM, Steve Wart wrote:

Also make sure your app starts up in a different directory from where you have your data files. If this is a resource you can do something like this to keep from worrying about absolute path names:

NSBundle *appBundle = [NSBundle mainBundle];
NSString *nspath = [appBundle pathForResource:@"image" ofType:@"bmp"];
char *cpath = [nspath cStringUsingEncoding:NSASCIIStringEncoding];


	This should be cpath = [nspath fileSystemRepresentation];

    fopen(fp, cpath, "r");

Steve

On Sat, Feb 28, 2009 at 3:34 PM, Luke the Hiesterman <email@hidden > wrote:
Not an Xcode issue, but I'd look up the error code and verify permissions on the file.


Luke


On Feb 28, 2009, at 3:31 PM, <email@hidden> wrote:

Hello,
I create a project, add GLUT and OpenGL frameworks, but I can't load an image using by fopen( fp, "data/image.bmp", "r" ); in fact the image is in 'date', but function shows error message: printf( "fopen can not open the file"). Under Linux that works. Have you got any ideas?


best regards
Ariel

PS: sorry for my English

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
@apple.com


This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

-----------------------------------
See the amazing new SF reel: Invasion of the man eating cucumbers from outer space.
On congratulations for a fantastic parody, the producer replies : "What parody?"


Tommy Nordgren
email@hidden




_______________________________________________ Do not post admin requests to the list. They will be ignored. Xcode-users mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Problems with addition of the resource (From: email@hidden)
 >Re: Problems with addition of the resource (From: Luke the Hiesterman <email@hidden>)
 >Re: Problems with addition of the resource (From: Steve Wart <email@hidden>)

  • Prev by Date: Re: variable viewing in gdb window
  • Next by Date: Java project - warning message - catch 22
  • Previous by thread: Re: Problems with addition of the resource
  • Next by thread: Re: Problems with addition of the resource
  • Index(es):
    • Date
    • Thread