• 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: NSMatrix of NSImageCells er help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix of NSImageCells er help!


  • Subject: Re: NSMatrix of NSImageCells er help!
  • From: Mike Abdullah <email@hidden>
  • Date: Sun, 18 Feb 2007 12:59:51 +0000

Tom, I wasn't able to figure exactly what was causing the problem here, but two things:

1.

NSLog(@"input:");
NSLog([objects className]);

this is rather bad practice. Although -className is fairly harmless this sort of call could return something nasty that crashes NSLog. Do this instead:

NSLog(@"input: %@", [objects className]);


2.
Trying to bind your gallery controller straight to an NSDictionary isn't the greatest plan in the world. Instead, create a new class called "Gallery" and give it these methods:


- (NSArray *)images;
- (void)setImages:(NSArray *)images;
- (NSArray *)imageURLs;
- (void)setImageURLs:(NSArray *)URLS;

Then in your controller when building the gallery do something like:

Gallery *gallery = [[Gallery alloc] init];
[gallery setImages: images];
[gallery setURLs: urls];

[galleryController bind: @"arrangedObjects" toObject: gallery withKeyPath: @"images" options: nil];


After that I'm still not sure if your matrix is bound right, but this is a better starting for testing it.


Mike.


On 18 Feb 2007, at 11:52, Tom Medhurst wrote:

Hi Guys

I am a Microsoft .NET developer with 5 years experience, who has decided to delve into Cocoa development, I like to learn a new language every year, last year was Ruby and this year it is Objective-C.

I am finding the whole experience amazing, it is truly an amazing framework, however coming from a Microsoft background, I am surprised at the small amount of online resources there are on Cocoa development (I reckon web sites covering problems with the .net framework probably cover more of the net than porn! :p)

I am having a little trouble with taking an array of NSImages, binding them to an NSArrayController and binding this to an NSMatrix of NSImageCells. It seems that the NSArrayController is working as expected and the array is being bound to the NSMatrix correctly, however it seems that the NSMatrix isn't properly distributing the images to the underlying NSImageCells.

I have written more details, attached the code and lots of screen- shots on my web site (address below) if anyone has any ideas how to fix this I would be most greatful.

Thanks Guys! Here is the link: <http://www.tmedhurst.me.uk/ wordpress/?p=46>
Kind Regards


Tom Medhurst
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
40mikeabdullah.net


This email sent to email@hidden

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


References: 
 >NSMatrix of NSImageCells er help! (From: Tom Medhurst <email@hidden>)

  • Prev by Date: Re: Toolbar icon highlighting
  • Next by Date: Re: Removing / inserting Menuitems in Mainmenu
  • Previous by thread: NSMatrix of NSImageCells er help!
  • Next by thread: NSNumberFormatter localization leaks on translation nibs
  • Index(es):
    • Date
    • Thread