Re: bind imageView data to NSArrayController objectAtIndex:
Re: bind imageView data to NSArrayController objectAtIndex:
- Subject: Re: bind imageView data to NSArrayController objectAtIndex:
- From: "ad veloper" <email@hidden>
- Date: Tue, 14 Aug 2007 19:23:12 +0100
>
> It would be useful to know what ad veloper is trying to achieve, what
> objects contain the image data, and how they are managed.
>
This is a coredata app.
The arrayController's contentSet is bound to another arrayController's
selection. Drag and drop into the imageCell performs this action:
- (IBAction)imageDropped:(id)sender {
(assume I have obtained the index of the sender and the
arraycontroller is ascending order sorted to match) then ..
[[[arrayController arrangedObjects] objectAtIndex:indexOfImageCell]
setValue:[image TIFFRepresentation] forKey:@"imageData"]];
}
This is a convenience at this stage. I intend to follow mmalc's
example regarding the storing of images using CoreData using URL's
instead.
I think if I implement an observer for the other arrayControllers
selectionIndexes and then populate the image cell's in the observer
method using:
NSImage *image = [[NSImage alloc] initWithData:[[[arrayController
arrangedObjects] objectAtIndex:index] valueForKey:@"imageData"]];
NSImageView *imageView = [imageViewArray objectAtIndex:index]
[imageView setImage:image];
I think this approach covers all the exits, as far as I can see.
Thanks for the help.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden