- Joined
- Dec 8, 2009
- Messages
- 453
- Reaction score
- 10
- Points
- 18
- Location
- The same as Sheldon Cooper - East Texas
- Your Mac's Specs
- iMac 2014 i5 5k 32gb 1tb fusion, second TB display, 2014 MBA
With the frequent and major changes that Apple makes to Xcode, I don't see how any code shop manages to stay on schedule.
Anyway, I am finally getting back into Xcode and, of course, the current version is 4. In version 3, you put any file you wanted to access into the Debug folder, which does not exist now. So, where does external data belong?
Here are two snippits that just load a jpg and dump it into a NSImageView. Both are supposed to be working examples.
//This has a path hard coded and works.
NSString *inFilePath = @"/Users/home/Programming/test/picture.jpeg";
NSImage *testImage = [[[NSImage alloc] initWithContentsOfFile:inFilePath] autorelease];
[imageView setImage:testImage];
//This is an example on several tutorial web sites and doesn't work
NSImage *testImage = [NSImage imageNamed"picture.jpeg"];
[imageView setImage: testImage ];
In the second example, no matter where I put the image, the code doesn't find it. Normally, I would assume that the code was in error, but as I said, I have found this example on numerous web sites.
Thanks, any.
Anyway, I am finally getting back into Xcode and, of course, the current version is 4. In version 3, you put any file you wanted to access into the Debug folder, which does not exist now. So, where does external data belong?
Here are two snippits that just load a jpg and dump it into a NSImageView. Both are supposed to be working examples.
//This has a path hard coded and works.
NSString *inFilePath = @"/Users/home/Programming/test/picture.jpeg";
NSImage *testImage = [[[NSImage alloc] initWithContentsOfFile:inFilePath] autorelease];
[imageView setImage:testImage];
//This is an example on several tutorial web sites and doesn't work
NSImage *testImage = [NSImage imageNamed"picture.jpeg"];
[imageView setImage: testImage ];
In the second example, no matter where I put the image, the code doesn't find it. Normally, I would assume that the code was in error, but as I said, I have found this example on numerous web sites.
Thanks, any.