• 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
NSMatrix NSImageCell binding
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMatrix NSImageCell binding


  • Subject: NSMatrix NSImageCell binding
  • From: Nicolas Berloquin <email@hidden>
  • Date: Sat, 24 Dec 2005 23:03:01 +0100

Hi !

After reading all the discussions around thumbnail matrices, I decided to try to implement it with bindings.
I have in my myDocument (fileOwner) a mutable array of dictionaries, with one key 'image' which holds
an NSImage.
I created an arrayController that binds to fileOwner._thumbsArray (the array of dictionaries).
My NSMatrix's content is bound to the controler with the model key path set to 'image'.

I load each NSImage with [[NSImage alloc] initWithContentsOfFile: curFile]

then, create a dictionary, add that image to it, then add the dico to the array :

NSImage *tmpImage = [[NSImage alloc] initWithContentsOfFile: curFile];
NSMutableDictionary *newDico = [NSMutableDictionary dictionaryWithObjectsAndKeys:tmpImage, @"image", newCell, @"cell", nil];
[self insertObject: newDico in_thumbsArrayAtIndex:[self countOf_thumbsArray]];

but, as soon as I do the insertObject, I get the following error :
NSImageCell's object value must be an NSImage.

I logged everythings, and the image is really an NSImage.
(The reason I put the image inside a dictionary is because I read a hint here about kvc compliance and
dictionaries, I tried with a 'pure' array of NSImages and I had the same errors).

I really don't see what I'm doing wrong !

any help would be appreciated ^_^ thanks !

PS I also read about reducing the image's size for thumbs, but I keep this for when the first part works...

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

This email sent to email@hidden
  • Prev by Date: Re: Crash in objc_msgSend_rtp when calling add action of NSArrayController (SOLVED)
  • Next by Date: Fwd: Drawing in custom views
  • Previous by thread: Re: Two table views - which has "focus"?
  • Next by thread: Fwd: Drawing in custom views
  • Index(es):
    • Date
    • Thread