Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 2, 2007, 10:41 PM   #1
Spike099
macrumors regular
 
Join Date: Feb 2007
Location: Canada
Can't Cache Image Error Message

Hey guys,

I am simply trying to display an image and can't figure out the issue.

In my appController.m

Code:
person = [personController objectAtIndex:x];
NSImage *portrait = [[NSImage alloc] init];
portrait = [person valueForKey:@"portrait"];
		
NSSize size = [portrait size]; // testing purposes
NSLog(@"Image Size \n	X:%f\n	Y:%f", size.width, size.height);
			
[imageView setImage:portrait];
[imageView setNeedsDisplay:YES];

In the Person.m file.

Code:
- (void)setPortrait:(NSImage *)newImage
{	
	[newImage retain];
	[portrait release];
	portrait = newImage;
}
- (NSImage *)portrait
{
	return portrait;
}
So... I've been trying to solve this one for awhile now. Just can't do it. The log shows the following.

2007-07-02 23:32:31.183 ImageApp[869] Image Size
X:128.000000
Y:192.000000
2007-07-02 23:32:31.184 ImageApp[869] Can't cache image

It appears the image is there as it shows the dimensions.
__________________
MacBook 4GBRam 320GBHDD
iMac 20" 4GBRam 1TBHDD
iPhone 16GB
Cocoa Developer
Spike099 is offline   0 Reply With Quote
Old Jul 2, 2007, 11:13 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
Is imageView connected in Interface Builder? Try a NSLog(@"%@", imageView); and see if that comes out null.
kainjow is offline   0 Reply With Quote
Old Jul 3, 2007, 07:01 AM   #3
Spike099
Thread Starter
macrumors regular
 
Join Date: Feb 2007
Location: Canada
Ooooh!!! I got it. The Can't Cache Image was due to me trying to reflect the wrong image. Aswell, I had not incremented my counter in my while loop, so it was constantly trying to display when x=0. But an error would get generated in that while loop so it would stop which made it look as though there was no loop problem.

Thanks kainjow, this issue was more me been a messy programmer while I learn. Gonna have to clean up my code and do some commenting before I continue now.
__________________
MacBook 4GBRam 320GBHDD
iMac 20" 4GBRam 1TBHDD
iPhone 16GB
Cocoa Developer
Spike099 is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
RSS reader with Image Cache for Offline viewing? jman995x Mac Applications and Mac App Store 0 May 28, 2013 02:25 PM
Why am I getting this error message? AstralShane App Store Business, Legal and Marketıng 2 Jan 30, 2013 02:01 PM
Error message: Should be image alone Iphone4sinwhite MacBook Pro 3 Sep 12, 2012 08:29 AM
error message, please help bob2131 OS X 2 Aug 21, 2012 06:48 PM
Image capture notification .501 / cache.db - can't clear? JeremyGSU iMac 4 Jul 27, 2012 10:27 AM

Forum Jump

All times are GMT -5. The time now is 04:36 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC