Arraycontroller and CoreData

2013-09-12 Thread Benjamin Rindt
Hey guys, I'm really confused with the array controller and core data. I don't know what I have to use to get what I want. My program has for now a CollectionView which is populated by a core data fetch request. If I use an arrayController, I don't have to make this fetch do I?

Re: Arraycontroller and CoreData

2013-09-12 Thread Keary Suska
On Sep 12, 2013, at 9:11 AM, Benjamin Rindt wrote: > I'm really confused with the array controller and core data. I don't know > what I have to use to get what I want. > My program has for now a CollectionView which is populated by a core data > fetch request. > >

Re: ArrayController cannot sort

2012-10-01 Thread Gerriet M. Denkmann
On 2 Oct 2012, at 11:10, Ken Thomases wrote: > On Oct 1, 2012, at 10:20 PM, Kyle Sluder wrote: > >> On Mon, Oct 1, 2012, at 07:56 PM, Gerriet M. Denkmann wrote: >>> So: how do I instruct my ArrayController to use localizedCompare: ? >> >> -[NSTable

Re: ArrayController cannot sort

2012-10-01 Thread Ken Thomases
On Oct 1, 2012, at 10:20 PM, Kyle Sluder wrote: > On Mon, Oct 1, 2012, at 07:56 PM, Gerriet M. Denkmann wrote: >> So: how do I instruct my ArrayController to use localizedCompare: ? > > -[NSTableColumn setSortDescriptorPrototype:] > > <https://developer.apple.com/li

Re: ArrayController cannot sort

2012-10-01 Thread Kyle Sluder
On Mon, Oct 1, 2012, at 07:56 PM, Gerriet M. Denkmann wrote: > So: how do I instruct my ArrayController to use localizedCompare: ? -[NSTableColumn setSortDescriptorPrototype:] <https://developer.apple.com/library/mac/#documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableColumn

ArrayController cannot sort

2012-10-01 Thread Gerriet M. Denkmann
I have a TableView and an ArrayController (no DataSource) and everything works fine. Clicking on a column header sorts my table ascending or descending. But the order of the rows is totally wrong. It seems that the ArrayController uses compare: to sort my strings. The documentation rightly says

Re: Choosing correct ArrayController depending on active TableView

2012-02-23 Thread Mike Abdullah
The windows's first responder will tell you if one of the table views has focus. If there are other UI elements in the window which can have focus though, this won't be good enough. Instead you'll have to start tracking the first responder yourself and recording which table had it last Sent fro

Choosing correct ArrayController depending on active TableView

2012-02-22 Thread Mikael Wämundson
Hi, I have two ArrayControllers in IB, ArrayControllerA and ArrayControllerB, who's content are setup to show in two TableViews, TableViewA and TableViewB. Pressing a button in the interface will perform some actions on the selected objects from TableViewA or TableViewB. I can of course select

Re: A button, an arrayController and a tableView....

2011-10-28 Thread Jens Alfke
On Oct 26, 2011, at 7:02 PM, R wrote: > If I don't pre-select the row, it takes two clicks of the button to > register the correct object. The first click will register the > previously selected row. It's like the button is at a higher priority > than the selected row. Sounds like the button’s

A button, an arrayController and a tableView....

2011-10-28 Thread R
I've got a column of buttons in a tableView. I don't allow multiple row selections. A click of the button fires a method which says. id obj; obj=[[anArrayController selectedObjects] objectAtIndex:0]; NSLog(@"the object: %@",obj); If I don't pre-select the row, it takes two clicks of the but

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Ben Golding
t it was a team effort here -- nice work. Note that I used: popupButton.contentValues -(Transformer)-> [arrayController].arrangedObjects That said, I do think it's inconsistent with the way that I expected the pop-up button bindings to work. I'll put together a simple example and send it

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Ken Thomases
On Apr 20, 2011, at 4:00 AM, Quincey Morris wrote: > On Apr 20, 2011, at 01:41, Ken Thomases wrote: > >> I'd call it a bug, but there's probably little chance of it being changed >> now. File one, anyway, if you feel strongly enough. > > No, it's not a bug, it's correct behavior, as I pointed

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Joanna Carter
Hi Quincey > Your value transformer, if you insist on doing it that way, should be coded > to expect this, and should transform an entire array of strings, not single > strings. I got the impression that the array in question could hold unprintable characters (tab, etc) and that the transforme

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Quincey Morris
On Apr 20, 2011, at 01:41, Ken Thomases wrote: > Hmm. That was so surprising that it prompted me to experiment. Well, that's four of us now who were prompted to experiment. :) > I'd call it a bug, but there's probably little chance of it being changed > now. File one, anyway, if you feel stro

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Quincey Morris
On Apr 20, 2011, at 00:25, Ben Golding wrote: > On 20/04/2011, at 15:41, Ken Thomases wrote: > >> On Apr 19, 2011, at 8:46 PM, Ben Golding wrote: >> >>> I should have been more specific. What I have looks like: >>> >>> popupButton.content -(Tra

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Ken Thomases
On Apr 20, 2011, at 2:25 AM, Ben Golding wrote: > On 20/04/2011, at 15:41, Ken Thomases wrote: > >> You can pretend the former case is more like the latter by using a model key >> path like "description" or even "self", although the latter case still tends >> to be more amenable to bindings. >

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Joanna Carter
Hi Ben > Trouble is that what I'm trying to model really is an array of strings. > > To put this problem into context, what I'm trying to offer the user through > the pop-up button is which character to use as a field separator when reading > a CSV file. The value transformer is something that

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-20 Thread Ben Golding
On 20/04/2011, at 15:41, Ken Thomases wrote: > On Apr 19, 2011, at 8:46 PM, Ben Golding wrote: > >> I should have been more specific. What I have looks like: >> >> popupButton.content -(Transformer)-> [arrayController].arrangedObjects >> popupButton.s

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Ken Thomases
On Apr 19, 2011, at 8:46 PM, Ben Golding wrote: > I should have been more specific. What I have looks like: > > popupButton.content -(Transformer)-> [arrayController].arrangedObjects > popupButton.selectedIndex --> [arrayController].selectionIndex >

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Ben Golding
button. I like to use a syntax like this: > > popupButton.content --(CapitalizeTransformer)--> > [arrayController].arrangedObjects I should have been more specific. What I have looks like: popupButton.content -(Transformer)-> [arrayController].arrangedObjects popupButton.selectedIndex --> [arrayCon

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Quincey Morris
On Apr 19, 2011, at 06:20, Ben Golding wrote: > What I'd found was that the documentation doesn't indicate what the > ValueTransformer indicated is passed. It seems to be a controller object, > not the pop-up button item's title which is the only thing that seems to make > sense in the context

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Kyle Sluder
ex:0]). > > I've also tried binding to contentValues which was unsuccessful too. It might help to be a bit more precise. Enumerate all the configured bindings on your popup button. I like to use a syntax like this: popupButton.content --(CapitalizeTransformer)--> [arra

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Ben Golding
On 19/04/2011, at 18:19, Quincey Morris wrote: > On Apr 19, 2011, at 00:41, Ben Golding wrote: > >> I am a bit stumped. I have an array controller which I have hooked up to a >> pop-up button and that works quite well. The members of the array are >> NSStrings but I would like to reformat th

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Quincey Morris
On Apr 19, 2011, at 00:41, Ben Golding wrote: > I am a bit stumped. I have an array controller which I have hooked up to a > pop-up button and that works quite well. The members of the array are > NSStrings but I would like to reformat them when they're displayed by the > pop-up button. Seem

Re: ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Citizen
On 19 Apr 2011, at 08:41, Ben Golding wrote: > I am a bit stumped. I have an array controller which I have hooked up to a > pop-up button and that works quite well. The members of the array are > NSStrings but I would like to reformat them when they're displayed by the > pop-up button. Seem

ArrayController vs Pop-up button vs Transformer -- three way tag team death match!

2011-04-19 Thread Ben Golding
I am a bit stumped. I have an array controller which I have hooked up to a pop-up button and that works quite well. The members of the array are NSStrings but I would like to reformat them when they're displayed by the pop-up button. Seems fairly straightforward, I thought I'd just write a l

Re: TableView / ArrayController sorting not updating the tableview

2011-03-20 Thread Quincey Morris
On Mar 19, 2011, at 16:17, Darren Wheatley wrote: > I have the default out-of-the-box sorting working, but when I click one of > the column headers to sort the table I have problems. Looks like you didn't get any takers on this yet. TBH, I have no idea what "default out-of-the-box sorting" means

TableView / ArrayController sorting not updating the tableview

2011-03-19 Thread Darren Wheatley
Hi, I have an NSTableView bound to a core-data-backed NSArrayController by binding individual columns to arraycontroller.arrangedObjects. I have the default out-of-the-box sorting working, but when I click one of the column headers to sort the table I have problems. Basically the display of the

Re: NSTableView with ArrayController bindings not updating?

2011-01-02 Thread Keary Suska
On Jan 1, 2011, at 5:13 PM, Ben Golding wrote: > Controller key selection This binding is wrong in your case. Refer to the examples in the Bindings Programming Topics document: http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaBindings/CocoaBindings.html, espec

NSTableView with ArrayController bindings not updating?

2011-01-01 Thread Ben Golding
I feel like I must be doing something silly but I can't see it. I am writing a crossword setting application. I have a Crossword class which has two instance variables, grid and clues each of which is a custom class (Grid and Clues). My problem relates to the Clues class which has two instanc

Re: Removing Object form ArrayController without managedObjectContext

2010-03-30 Thread Gustavo Pizano
IT WORKS AHHH SUCH A RELIEF! Thans a lot, guys, you made me see the problem I was having, so I set up the Set Content binding of the ItemXInvoice Array controller to be _newInvoice.toItemsXInvoice properly set the relation in the add and addPredifiened methods, and it did work!. OMG

Re: Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Gustavo Pizano
Keary Hello On Mar 30, 2010, at 2:18 AM, Keary Suska wrote: > >> Item * newItem = [NSEntityDescription >> insertNewObjectForEntityForName:@"Item" inManagedObjectContext:[self >> managedObjectContext]]; >> ItemXInvoice * newItemXInvoice = [NSEntityDescription >> insertNewObjectForEnti

Re: Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Keary Suska
On Mar 29, 2010, at 3:29 PM, Gustavo Pizano wrote: > I have, Invoice < ->> ItemXInvoice << > Invoice, the Array controller I set > up with ItemXInvoice entity, and when I click an add button I do: Whenever possible, manipulate relationships directly. Perhaps you do this, but the code isn't sh

Re: Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Gustavo Pizano
Keary Hi. On Mar 29, 2010, at 10:22 PM, Keary Suska wrote: > On Mar 29, 2010, at 1:43 PM, Gustavo Pizano wrote: > >> My guess was that when removing the objects form the array controller, these >> were being removed form the MOC, and therefore I couldn't see them in the >> consultation mode,

Re: Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Quincey Morris
On Mar 29, 2010, at 13:22, Keary Suska wrote: > On Mar 29, 2010, at 1:43 PM, Gustavo Pizano wrote: > >> My guess was that when removing the objects form the array controller ... >> Now I need to be able to clean the table after saving, otherwise I can't >> create more items unless I restart the

Re: Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Keary Suska
On Mar 29, 2010, at 1:43 PM, Gustavo Pizano wrote: > My guess was that when removing the objects form the array controller, these > were being removed form the MOC, and therefore I couldn't see them in the > consultation mode, only after restarting the app when the MOC fetch again the > data.

Removing Object form ArrayController without managedObjectContext

2010-03-29 Thread Gustavo Pizano
Hello all. before this email I had a problem with a to-many relationship, that after saving the other view wasn't showing the invoice details, I found the error, but I can't find the solution. So what was happening, was that after saving I was clearing the data of the NSArraycontroller that wa

Re: Better Way to Add an Entity to an ArrayController

2010-01-23 Thread vincent habchi
gt; manually add a track the user presses the add button which runs the "add:" > selector of the arrayController. Right now, to programmatically add a track > I do: > > [arrayController performSelector:@selector(add:) withObject:nil > afterDelay:0.0]; &g

Better Way to Add an Entity to an ArrayController

2010-01-23 Thread cocoa-dev
the "add:" selector of the arrayController. Right now, to programmatically add a track I do: [arrayController performSelector:@selector(add:) withObject:nil afterDelay:0.0]; That doesn't feel right to me. I want to create a new Track entity and add it to the CD attribute tra

Re: NSTextView font problem using arraycontroller

2010-01-20 Thread Jens Alfke
On Jan 20, 2010, at 5:27 AM, Grant Christensen wrote: > I have an array controller that is feeding a NSTableView on a window. Also > on the window are a few text fields showing the contents of the selected row > (shows more than table). One of the fields is an NSTextView. What property of th

NSTextView font problem using arraycontroller

2010-01-20 Thread Grant Christensen
Hi all, I have an array controller that is feeding a NSTableView on a window. Also on the window are a few text fields showing the contents of the selected row (shows more than table). One of the fields is an NSTextView. I am having a problem with fonts in the text view (google searches show

Creating a 'complex' ArrayController based view.

2009-06-24 Thread Brian Bruinewoud
All, I'm ok with creating a special view for a simple value - that is, a single item. I'm not sure what the best way is to design a view that displays items from an array. For the single item view, the view is based on three values that are bound to the view. (eg: width, height, colour) F

Re: Using an arraycontroller for different object classes

2009-05-16 Thread Ken Thomases
On May 15, 2009, at 11:47 PM, Gideon King wrote: In the mini example, yes I would want the object array for weight to have the full array, and the object array for the tyre size to have the filtered array, and as you say, this could be accomplished with separate controllers. However, this m

Re: Using an arraycontroller for different object classes

2009-05-15 Thread Gideon King
Thanks for the suggestion Ken, but I don't think that would help. In the mini example, yes I would want the object array for weight to have the full array, and the object array for the tyre size to have the filtered array, and as you say, this could be accomplished with separate controllers

Re: Using an arraycontroller for different object classes

2009-05-14 Thread Ken Thomases
On May 14, 2009, at 7:07 PM, Gideon King wrote: Hi, I have a situation where I have an array of objects that I want to bind to so I can use them in an inspector, but the objects are of different classes, and I want the inspector to only see the objects that have the key that I am binding to

Using an arraycontroller for different object classes

2009-05-14 Thread Gideon King
Hi, I have a situation where I have an array of objects that I want to bind to so I can use them in an inspector, but the objects are of different classes, and I want the inspector to only see the objects that have the key that I am binding to. For example, if I have an array of vehicles, a

Re: Select tablecell on creation through arrayController

2009-02-26 Thread Ron Lue-Sang
Chances are you're calling add: on the arrayController and then assuming that the newly added object is added to the array immediately. I'm pretty sure the documentation says that that's an incorrect assumption. If the value absolutely positively has to be there right away

Re: Select tablecell on creation through arrayController

2009-02-25 Thread Quincey Morris
On Feb 25, 2009, at 19:12, Walker Argendeli wrote: The code is now this, which works- kindof: [notebookController add:sender]; [notebookTableView editColumn:0 row:[notebookTableView selectedRow] withEvent:nil select:YES]; Only problem is, for the second line, I actually have to kick off a

Re: Select tablecell on creation through arrayController

2009-02-25 Thread Walker Argendeli
The code is now this, which works- kindof: [notebookController add:sender]; [notebookTableView editColumn:0 row:[notebookTableView selectedRow] withEvent:nil select:YES]; Only problem is, for the second line, I actually have to kick off a timer...: [NSTimer scheduledTimerWithTimeInterval:.

Re: Select tablecell on creation through arrayController

2009-02-25 Thread Corbin Dunn
On Feb 25, 2009, at 2:11 PM, Walker Argendeli wrote: I have a table with one column, that's bound to an array controller. It calls add: on the array controller when I hit a plus button. Problem is, I want the textFieldCell to be selected on creation. I rewired the plus button to call a

Re: Select tablecell on creation through arrayController

2009-02-25 Thread Kyle Sluder
On Wed, Feb 25, 2009 at 5:11 PM, Walker Argendeli wrote: > I have a table with one column [...snip...] > [tableView editColumn:1 row:[tableView selectedRow] withEvent:nil > select:YES]; You are aware that arrays are 0-indexed, right? --Kyle Sluder __

Select tablecell on creation through arrayController

2009-02-25 Thread Walker Argendeli
I have a table with one column, that's bound to an array controller. It calls add: on the array controller when I hit a plus button. Problem is, I want the textFieldCell to be selected on creation. I rewired the plus button to call a method in a custom class. The first thing the custom

Should you unbind an ArrayController for performance reasons?

2008-07-31 Thread Kenny Carruthers
ArrayController had a binding with an NSTableView I started to wonder if the performance hit was actually caused by all the UI updating that needed to happen. Sure enough it was. If I unbind the ArrayController before I update all the managed objects, then rebind the ArrayController afterwards, then

Re: Quick problem with arraycontroller

2008-07-19 Thread Jason Cox
I fixed it, I had the bindings set up perfectly. My challenge was in my Project object my NSMutableArray was setup wrong: @property (readwrite, assign) NSMutableArray *projectInfo; should have been @property (readwrite, copy) NSMutableArray *projectInfo; with that change it works perfectly. O

Quick problem with arraycontroller

2008-07-18 Thread Jason Cox
I have 2 array controllers. the 1st manages an array of Project objects. within the project object there is an NSMutableArray of ProjectInfo objects. Here is an image of my Interface Builder setup for the 2 controllers: http://www.design-factor.com/jason/bindings.jpg The Projects array contr

Re: ArrayController

2008-07-12 Thread mmalc Crawford
On Jul 12, 2008, at 12:29 PM, Ashley Perrien wrote: when I click the add button which calls a method in MyDocument it ultimately does a [array addObject: newobject] and the arraycontroller is not being notified that the array is being updated so it's not redrawing the table. Any ti

Re: ArrayController

2008-07-12 Thread I. Savant
On Jul 12, 2008, at 3:29 PM, Ashley Perrien wrote: Click the add button to add a line, click through the table and fill in the fields to get the data in. Instead what I want is to have several textfields in the view, fill those out, click add, it performs all the necessary operations with

ArrayController

2008-07-12 Thread Ashley Perrien
I'm having another go at trying to figure out array controllers and having problems. I can create a model and a view and use an ArrayController to tie the two together without much problem. But In that case, all the editing is done in the table. Click the add button to add a line,

Re: ObjectController and ArrayController tutorials

2008-06-14 Thread Erik Buck
Ashley, As it happens, I have written a chapter in "Cocoa Design Patterns" about "why" NSArrayController and friends exist and how to use them. I am interested in feedback on the chapter. Contact me privately if you want to see if we can arrange some way for you to review the chapter.

ObjectController and ArrayController tutorials

2008-06-14 Thread Ashley Perrien
oller) are, how they work or how to configure them in IB. Bindings I get and don't have a problem with. Creating my own controller object I have no problem creating and getting to work. But the black box of NSObject or ArrayController I just can't figure out. I've also tri

Re: ArrayController Out of Bounds

2008-06-07 Thread Gerriet M. Denkmann
On 4 Jun 2008, at 21:50, Shawn Erickson wrote: On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: When this table contains some rows and I click on the table column header I always get: *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5) where 5 is the

Re: ArrayController Out of Bounds

2008-06-04 Thread Keary Suska
6/4/08 8:50 AM, also sprach [EMAIL PROTECTED]: >> When this table contains some rows and I click on the table column header I >> always get: >> *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5) >> where 5 is the correct number of rows displayed. >> >> What am I doing wrong? >> This is

Re: ArrayController Out of Bounds

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 7:50 AM, Shawn Erickson <[EMAIL PROTECTED]> wrote: > On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann > <[EMAIL PROTECTED]> wrote: > >> When this table contains some rows and I click on the table column header I >> always get: >> *** -[NSCFArray objectAtIndex:]: index (-1)

Re: ArrayController Out of Bounds

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann <[EMAIL PROTECTED]> wrote: > When this table contains some rows and I click on the table column header I > always get: > *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5) > where 5 is the correct number of rows displayed. > > What am

ArrayController Out of Bounds

2008-06-04 Thread Gerriet M. Denkmann
SValidatesImmediately = 0; NSValueTransformer = ; NSValueTransformerName = ; }; } [ arrayController infoForBinding: @"contentArray" ] --> NSObservedKeyPath = "query.results"; NSObservedObject = ; NSOptions = { NSAlwaysPre

Re: How to remove a fetched predicate from an ArrayController?

2008-03-19 Thread Dave Hersey
Set the filter predicate to nil to remove any predicates from the array controller. - d On Mar 20, 2008, at 12:36 AM, WiFiFun wrote: I have added filtering buttons (Like those at the top XCode's documentation window) to my bindings and core data learning application I have been working on. I

How to remove a fetched predicate from an ArrayController?

2008-03-19 Thread WiFiFun
I have added filtering buttons (Like those at the top XCode's documentation window) to my bindings and core data learning application I have been working on. I have the buttons linking to an action that creates a predicate and sets the fetched predicate to the array controller. This all works great

Re: Force arrayController to remove immediately?

2008-02-26 Thread Justin Hawkwood
Thanks, but I used Ben's suggestion of The UndoManager's groups to solve this issue. On Feb 26, 2008, at 11:51 AM, Dave Hayden wrote: On Feb 16, 2008, at 12:31 PM, Justin Hawkwood wrote: I have an array controller bound in the NIB to a Core Data Entity, and a function to remove the selecte

Re: Force arrayController to remove immediately?

2008-02-26 Thread Dave Hayden
On Feb 16, 2008, at 12:31 PM, Justin Hawkwood wrote: I have an array controller bound in the NIB to a Core Data Entity, and a function to remove the selected item (from tableview) through that array controller. The problem is that I want to rescan the array controller to set some other var

Re: bind tableview to arraycontroller

2008-02-23 Thread Adam Gerson
> columns! > > My conclusion therefore: obviously am I doing something wrong in the > interaction between the tableview and the arraycontroller. The > controller apparently has received new content but not signalled that > to the tableview; the latter changing when prodded i

bind tableview to arraycontroller

2008-02-23 Thread Hans van der Meer
licking in the first column did not update the view, though I cannot see a difference in binding with the other columns! My conclusion therefore: obviously am I doing something wrong in the interaction between the tableview and the arraycontroller. The controller apparently has received