Re: insert a plist in a NSTableView using a NSDictionary
Re: insert a plist in a NSTableView using a NSDictionary
- Subject: Re: insert a plist in a NSTableView using a NSDictionary
- From: NSTask <email@hidden>
- Date: Wed, 26 Sep 2007 09:14:16 +0200
Hi Deepak,
First debugging I would suggest you to do is to nslog plistDictionary
contents. It looks like your dictionary
is empty. Can you paste sample of your file contents.
/S.
On 9/25/07, deepak gopal <email@hidden> wrote:
>
> Hi
>
> I am using NSArrayController to load two columns of a table View and the
> Method I am using is
>
> - (void)loadArrayController {
>
> NSDictionary *plistDictionary = [NSDictionary
> dictionaryWithContentsOfFile:kPlistPath];
>
> NSMutableDictionary *newDictionary = [NSMutableDictionary dictionary];
>
> [newDictionary setValue:[plistDictionary allKeys] forKey:@"Methods"];
>
> [newDictionary setValue:[plistDictionary allValues] forKey:@"Address"];
>
> [tableViewController_ addObject:newDictionary];
>
> }
>
> and I am getting only brakets in both the fields.
> What am I doing wrong? or how else should I do this?
>
> Thank you
> DG
> PS: Attached is a screenshot of my tableView
>
>
> ----- Original Message ----
> From: NSTask <email@hidden>
> To: email@hidden; email@hidden
> Sent: Sunday, 23 September, 2007 1:20:36 PM
> Subject: Re: insert a plist in a NSTableView using a NSDictionary
>
> Deepak may be this sample code link can help you.
>
> http://nsstring.blogspot.com/2007/09/binding-in-objective-c.html
>
> Try this and tell me, if you need help.
>
> /S
>
>
> >
> > On 9/23/07, deepak gopal <email@hidden> wrote:
> > >
> > > I am really confused now.
> > > I don't know how to bind the dictionary to
> > > NSArrayController.
> > > What did you mean?
> > >
> > > DG
> > > --- NSTask <email@hidden> wrote:
> > >
> > > > >
> > > > >
> > > > > I am trying to insert a plist on to a NSTableView.
> > > > So
> > > > > I have two columns in tableView, one for Key and
> > > > the
> > > > > other for Value.
> > > > >
> > > > > plistDictionary_ = [NSDictionary
> > > > > dictionaryWithContentsOfFile:kPlistPath];
> > > > >
> > > > > How will I load this NSDictionary onto the
> > > > > NSTableView?
> > > > >
> > > > > What should be the return value in
> > > > >
> > > > > - (id)tableView:(NSTableView *)tableView
> > > > > objectValueForTableColumn:(NSTableColumn
> > > > > *)tableColumn
> > > > > row:(int)row {
> > > >
> > > >
> > > >
> > > > You don't need this, just bind the table column with
> > > > nsarraycontroller and
> > > > your dictionary
> > > > to nsarray controller as an object.
> > > > _______________________________________________
> > > >
> > > > 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
> > > >
> > >
> > >
> > >
> > > Bring your gang together - do your thing. Go to
> > > http://in.promos.yahoo.com/groups
> > >
> >
> >
> _______________________________________________
>
> 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
>
>
> ------------------------------
> Bring your gang together - do your thing. Start your group.<http://in.rd.yahoo.com/tagline_groups_2/*http://in.promos.yahoo.com/groups>
>
>
_______________________________________________
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