Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Mac OS X Development

Reply
 
LinkBack Thread Tools Display Modes
Old 09-21-2011, 05:14 AM   #1 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: India
Posts: 3
iPhoneSne is on a distinguished road
Default How can i display image in NSTableView when my data comes from .dict file?

Hello everyone,

I am creating a tableview and using NSDictionaryController.
My data comes from case.dict file
I am using this code:

Code:
@interface MyClass : NSWindowController{

    IBOutlet NSTableView *tableView;
    IBOutlet NSDictionaryController *dictController;
    IBOutlet NSArrayController *peopleList;
    NSDictionary *currentPerson;
}

@property (retain) NSDictionary *currentPerson;
MyClass.m file

Code:
- (void)windowDidLoad
{
    [super windowDidLoad];

    NSBundle *bundle = [NSBundle mainBundle];
    NSString *path = [bundle pathForResource: @"case" ofType: @"dict"];
    NSArray *listFromFile = [NSArray arrayWithContentsOfFile: path];

    [tableView setSortDescriptors:[NSArray arrayWithObject:[[[NSSortDescriptor alloc] initWithKey:@"icon" ascending:YES] autorelease]]];

    [peopleList addObserver:self forKeyPath:@"selectionIndexes" options:NSKeyValueObservingOptionNew context:nil];

 if (listFromFile != nil)
{
    [peopleList addObjects:listFromFile];
}
[peopleList setSelectionIndex:0];

[dictController bind:NSContentDictionaryBinding toObject:self withKeyPath:@"currentPerson" options:nil];

}
It works fine and table gives me image names which are stored in case.dict file at index 0(ZERO).
Now can any one explain me how i get all images but not their names in table?
I am new to cocoa development.

If there is any other way to do this then also tell me. But i want my data from file only..
Please help me to solve this
Any help will be appreciated..!!

Thanks..!!

Edit : this can give u more detail about my problem http://stackoverflow.com/questions/7...active#tab-top

Last edited by iPhoneSne; 09-21-2011 at 05:18 AM. Reason: Edit detail
iPhoneSne is offline   Reply With Quote
Old 09-21-2011, 05:49 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: India
Posts: 3
iPhoneSne is on a distinguished road
Default

Anyone???
iPhoneSne is offline   Reply With Quote
Old 09-22-2011, 03:05 AM   #3 (permalink)
Registered Member
 
Join Date: Jul 2011
Location: India
Posts: 3
iPhoneSne is on a distinguished road
Exclamation

Anyone..??? Helloooo
iPhoneSne is offline   Reply With Quote
Reply

Bookmarks

Tags
mac dev, nsarray, nstableview, xcode 4

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 375
10 members and 365 guests
Creativ, Emy, husthlj, illogical, LegionMD, LunarMoon, Murphy, padsoftware, stanny, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,677
Threads: 94,127
Posts: 402,916
Top Poster: BrianSlick (7,990)
Welcome to our newest member, husthlj
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 07:17 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0