Re: NSPredicate and custom sort selector

2014-05-31 Thread Trygve Inda
A string is a string - the user's input will have the ratioValue property available. Up to you to sanity check the user input of course. Kirk Kerekes (iPhone) On May 30, 2014, at 4:56 PM, Trygve Inda cocoa...@xericdesign.com wrote: Create a property-styled category on NSString

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: I have an array of objects. One property of this object is a ratio stored as a string (e.g. 5:8, 9:4, 21:2) etc. I have a category on NSString: -(NSComparisonResult)compareAspectString:(NSString *)aString This does the division and

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection operations.

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection

Re: NSPredicate and custom sort selector

2014-05-30 Thread Trygve Inda
Create a property-styled category on NSString that returns the numeric value of a ratio-string -- call it ratioValue perhaps. Then you can have a predicate format of the form: @self.ratioValue %@.ratioValue -- or whatever. The same category would be useful in KVC collection

Re: NSPredicate and custom sort selector

2014-05-30 Thread Kirk
A string is a string - the user's input will have the ratioValue property available. Up to you to sanity check the user input of course. Kirk Kerekes (iPhone) On May 30, 2014, at 4:56 PM, Trygve Inda cocoa...@xericdesign.com wrote: Create a property-styled category on NSString that

NSPredicate and custom sort selector

2014-05-29 Thread Trygve Inda
to do this. My Predicate says: Printing description of predicate: aspectRatio [cd] 4:3 But it is just doing straight string comparison. How can I get the predicate to use by comparison method? The columns in my NSTableView are able to use this custom sort function... Seems a predicate should

Re: NSPredicate and custom sort selector

2014-05-29 Thread Ken Thomases
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: I have an array of objects. One property of this object is a ratio stored as a string (e.g. 5:8, 9:4, 21:2) etc. I have a category on NSString: -(NSComparisonResult)compareAspectString:(NSString *)aString This does the division and

Re: NSPredicate and custom sort selector

2014-05-29 Thread Trygve Inda
On May 29, 2014, at 2:52 PM, Trygve Inda wrote: I have an array of objects. One property of this object is a ratio stored as a string (e.g. 5:8, 9:4, 21:2) etc. I have a category on NSString: -(NSComparisonResult)compareAspectString:(NSString *)aString This does the division and

Re: NSFetchedResultsController sort on synthesized property?

2014-03-16 Thread Mike Abdullah
On 27 Feb 2014, at 21:20, Rick Mann rm...@latencyzero.com wrote: Thanks, Sixten. I had hoped that if it couldn't translate a sort descriptor in to SQL, that it would apply it after fetching. The problem with doing that is it would require faulting all the objects into memory at once, which

Re: NSFetchedResultsController sort on synthesized property?

2014-03-16 Thread Rick Mann
It would only need to load the sort attributes. Maybe using keyPathsForValuesAffectingKey or some such. Sent from my iPhone On Mar 16, 2014, at 12:55, Mike Abdullah mabdul...@karelia.com wrote: On 27 Feb 2014, at 21:20, Rick Mann rm...@latencyzero.com wrote: Thanks, Sixten. I had hoped

Re: NSFetchedResultsController sort on synthesized property?

2014-02-27 Thread Sixten Otto
The fetched results controller needs to be able to do its sorting in the database (assuming a SQLite store). The section keypath itself doesn't necessarily need to be a persistent property, as long as its values match the ordering of the sort descriptors. (For instance: a table that sections

Re: NSFetchedResultsController sort on synthesized property?

2014-02-27 Thread Rick Mann
Thanks, Sixten. I had hoped that if it couldn't translate a sort descriptor in to SQL, that it would apply it after fetching. On Feb 27, 2014, at 06:14 , Sixten Otto hims...@sfko.com wrote: The fetched results controller needs to be able to do its sorting in the database (assuming a SQLite

NSFetchedResultsController sort on synthesized property?

2014-02-26 Thread Rick Mann
It seems that I can't sort on a read-only synthesized property in my NSManagedObject subclass. I'd like to sort a bunch of stuff into some sections, but the definition of a section is somewhat complex, depending on multiple other properties. So, I defined a property section like

Core Data and localized sort on iOS

2013-01-03 Thread Fritz Anderson
iOS 6 I have (or will have) a Core Data store, one entity of which has an attribute that is a French word. French collates differently than English or a naïve Unicode sort would. My application will have both English and French localizations. It is next-to-nonnegotiable that the word lists I

Re: Core Data and localized sort on iOS

2013-01-03 Thread Kyle Sluder
On Jan 3, 2013, at 8:49 AM, Fritz Anderson fri...@manoverboard.org wrote: iOS 6 I have (or will have) a Core Data store, one entity of which has an attribute that is a French word. French collates differently than English or a naïve Unicode sort would. My application will have both

Core Data and localized sort on iOS

2013-01-03 Thread Matt Neuburg
. m. On Jan 3, 2013, at 12:00 PM, cocoa-dev-requ...@lists.apple.com wrote: Message: 1 Date: Thu, 03 Jan 2013 10:49:15 -0600 From: Fritz Anderson fri...@manoverboard.org To: Cocoa-Dev Cocoa-Dev cocoa-dev@lists.apple.com Subject: Core Data and localized sort on iOS Message-ID: 202d147a-95b8

Re: Core Data and localized sort on iOS

2013-01-03 Thread Fritz Anderson
On 3 Jan 2013, at 2:08 PM, Matt Neuburg m...@tidbits.com wrote: What I do in my Core Data-based Latin and Greek vocabulary list iOS apps is maintain extra fields (attributes) that contain transliterations of the Greek/Latin terms into the English alphabet in such a way that sorting

Re: Core Data and localized sort on iOS

2013-01-03 Thread Matt Neuburg
On Jan 3, 2013, at 12:49 PM, Fritz Anderson wrote: A simple transliteration I didn't say the transliteration was simple. I had to devise a code (properly called a beta code) that would yield the correct result. To give a simple example, if you want a-accent-aigu to sort before a-accent-grave

Re: Core Data and localized sort on iOS

2013-01-03 Thread Kyle Sluder
On Thu, Jan 3, 2013, at 02:54 PM, Matt Neuburg wrote: I didn't say the transliteration was simple. I had to devise a code (properly called a beta code) that would yield the correct result. To give a simple example, if you want a-accent-aigu to sort before a-accent-grave, you might

Re: Core Data and localized sort on iOS

2013-01-03 Thread Matt Neuburg
, if you want a-accent-aigu to sort before a-accent-grave, you might transliterate them as a1 and a2. Or, just the other way round, if you want them to sort indifferently, you might transliterate them both as a. By the same token, I lowercased everything because I didn't want case to be significant

NSTableView how to sort rows after modify datasource array

2012-10-12 Thread Евсеев Алексей
sorry for my english I have a form with NSTableView and two button add and remove Add button add's item into datasource array. And new row will show only after restart program. Remove button remove item from array. While select another rows deleted rows will empty but visible. how i may

Re: NSTableView how to sort rows after modify datasource array

2012-10-12 Thread Peter
Am 02.10.2012 um 11:56 schrieb Евсеев Алексей: sorry for my english I have a form with NSTableView and two button add and remove Add button add's item into datasource array. And new row will show only after restart program. Remove button remove item from array. While select another

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: 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:]

Re: ArrayController cannot sort

2012-10-01 Thread Gerriet M. Denkmann
On 2 Oct 2012, at 11:10, Ken Thomases k...@codeweavers.com 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: ? -[NSTableColumn setSortDescriptorPrototype:]

predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread davelist
I have a fetch request with sort descriptors that was sorting on a many-one relationship (i.e., I'm fetching Entity A which has a relationship to one entity B and I was trying to get back the array of A entities sorted on an attribute of B). This doesn't work using sort descriptors; however

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Keary Suska
On Dec 14, 2011, at 9:46 AM, davel...@mac.com wrote: I have a fetch request with sort descriptors that was sorting on a many-one relationship (i.e., I'm fetching Entity A which has a relationship to one entity B and I was trying to get back the array of A entities sorted on an attribute

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Dave Reed
On Dec 14, 2011, at 12:32 PM, Keary Suska wrote: On Dec 14, 2011, at 9:46 AM, davel...@mac.com wrote: I have a fetch request with sort descriptors that was sorting on a many-one relationship (i.e., I'm fetching Entity A which has a relationship to one entity B and I was trying to get

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread Keary Suska
On Dec 14, 2011, at 11:07 AM, Dave Reed wrote: Here's my sorting scenario with a few more details. Entity A (the one I'm fetching) has a to-one relation to Entity B with attribute b. Let's call the relation tob so my sort descriptor said withKey:@tob.b and it results of the fetch request

Re: predicates and sort descriptors for NSFetchRequest - documentation is a bit vague

2011-12-14 Thread David Reed
On Dec 14, 2011, at 2:05 PM, Keary Suska wrote: On Dec 14, 2011, at 11:07 AM, Dave Reed wrote: Here's my sorting scenario with a few more details. Entity A (the one I'm fetching) has a to-one relation to Entity B with attribute b. Let's call the relation tob so my sort descriptor said

How do I update re-sort the fetch results associated with an NSFetchedResultsController instance?

2011-07-25 Thread Michael Crawford
I have an fetched-results-controller (FRC) that returns entities that are sorted by name. After I get Core Location callbacks up and running, I need to update the sort order of the same result set but by distance (another attribute/property of the same entity). It just so happens

sort array of dictionaries by multiple critera

2011-04-27 Thread Martin Batholdy
Hi, I have an array of dictionaries. One dictionary-entry looks like this: { ID = 34; counter = 2; date = 2011-04-19 15:43:52 +0200; title = test.pdf; type = file; } Now I would like to sort my array of dictionaries first by type and then (within the type-dictionaries

Re: sort array of dictionaries by multiple critera

2011-04-27 Thread Dave DeLong
In that array of sort descriptors, you'd need to pass two of them. The first to sort by type and the second to sort by date. The second sort descriptor would only be used if two objects are sorted as equal by the first descriptor. Dave Sent from my iPhone On Apr 27, 2011, at 6:59 AM, Martin

Re: sort array of dictionaries by multiple critera

2011-04-27 Thread Steve Christensen
Batholdy wrote: I have an array of dictionaries. One dictionary-entry looks like this: { ID = 34; counter = 2; date = 2011-04-19 15:43:52 +0200; title = test.pdf; type = file; } Now I would like to sort my array of dictionaries first by type and then (within

Re: sort array of dictionaries by multiple critera

2011-04-27 Thread Graham Cox
On 27/04/2011, at 11:59 PM, Martin Batholdy wrote: [bookmarks sortUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]]; but how can I first group the dictionaries by type and then within the types sort them by date? (so use two sorting-criteria with a different priority) Note

NSFetchedResultsController: different sort descriptors for different sections

2010-12-05 Thread WT
a *single* fetched results controller that sorts different sections differently? From reading the docs for NSFetchedResultsController, in a situation with several sections, the first sort descriptor is responsible for splitting the data into sections. Fine, by I can't seem to think of a way

Re: sort an nstablecolumn to button cell state?

2010-09-17 Thread Keary Suska
On Sep 16, 2010, at 2:09 PM, Michael Hanna wrote: I have an NSTableColumn in an NSTableView that has only an NSButtonCell(checkbox). When the user clicks the table column header I'd like it to sort the table items according to whether or not the checkbox is selected. so the end result

sort an nstablecolumn to button cell state?

2010-09-16 Thread Michael Hanna
I have an NSTableColumn in an NSTableView that has only an NSButtonCell(checkbox). When the user clicks the table column header I'd like it to sort the table items according to whether or not the checkbox is selected. so the end result is that all checked items are grouped together(and all

case-insensitive but case-ordered sort

2010-07-20 Thread Roland King
I want to sort some NSStrings in such a way that words group case insensitively, but within that group lowercase comes first, effectively I want the sort order of letters to be aAbBcCdDeEfF .. etc with everything outside the letter space sorting 'naturally' and coming after the letters (I

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Wim Lewis
do what I want but I've failed to convince myself that actually works. I think that would work; it's the approach I'd use at least... QA1159 mentions the -localizedStandardCompare: method on NSString, and the UCCompareTextDefault() C function, but I think both of those sort the wrong way around

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Charlie Dickman
You should be able to accomplish what you want using NSPredicate. You can also use the C functions topper and tolower to detect and distinguish case differences. On Jul 20, 2010, at 1:39 PM, Roland King wrote: I want to sort some NSStrings in such a way that words group case insensitively

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Kyle Sluder
On Tue, Jul 20, 2010 at 11:04 AM, Charlie Dickman 3tothe...@comcast.net wrote: You should be able to accomplish what you want using NSPredicate. NSPredicate will just wind up falling through to the same sorting methods Roland can call directly. You can also use the C functions topper and

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Keary Suska
do what I want but I've failed to convince myself that actually works. This approach will not provide overall lower-before-capital sorting, so I expect it won't work. Consider the following: aClass AAClass Will sort, using the method you describe, to AAClass aClass Because A comes before C

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Deborah Goldsmith
never be case- or diacritic-insensitive, as correct sorting in many languages depends on case- and diacritic-sensitivity. Note that for a localized sort, being case-sensitive does *not* mean you’ll get: ABCDabcd That’s code-point order, which is not at all the same thing. What case-sensitive means

RE: case-insensitive but case-ordered sort

2010-07-20 Thread Jeff Laing
aAbBcCdDeEfF .. etc with everything outside the letter space sorting 'naturally' and coming after the letters (I actually don't care too much about the last bit honestly they can go where they like as long as it's outside the alphabet range). so myClass comes before

Sort ordering and custom cells

2010-07-13 Thread Gideon King
for that row. When I sort the table, the buttons are not sorted - they just stay in the row they were in. Ditto for when I add new rows. What's a good way to fix this? Thanks Gideon ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: Sort ordering and custom cells

2010-07-13 Thread Keary Suska
button cell (or sometimes nil) depending on the data for that row. When I sort the table, the buttons are not sorted - they just stay in the row they were in. Ditto for when I add new rows. What's a good way to fix this? If I were to hazard a guess--which is what I have to do since you have

Re: Sort ordering and custom cells

2010-07-13 Thread Gideon King
. When I sort the table, the buttons are not sorted - they just stay in the row they were in. Ditto for when I add new rows. What's a good way to fix this? If I were to hazard a guess--which is what I have to do since you have given us very little to go on--I would say that you need

Re: Sort ordering and custom cells [fixed]

2010-07-13 Thread Gideon King
I found the problem. It was that I was looking in my source array using objectAtIndex:row, which is the actual row in the table as displayed. Seeing as my array is not sorted - it just has sort descriptors applied, I was getting the wrong value from my data array. I resolved the issue

NSTableView sort with a data source (silly question ?)

2010-05-03 Thread vincent habchi
Hi, this might be a silly question but, before doing any further implementation, and having found no definite answer, I dare ask it. Is there a way to sort the contents of a NSTableView whose data is provided by a data source, besides sorting at the source itself (via a suitable query

Re: NSTableView sort with a data source (silly question ?)

2010-05-03 Thread Graham Cox
On 04/05/2010, at 1:00 AM, vincent habchi wrote: Hi, this might be a silly question but, before doing any further implementation, and having found no definite answer, I dare ask it. Is there a way to sort the contents of a NSTableView whose data is provided by a data source, besides

Re: NSTableView sort with a data source (silly question ?)

2010-05-03 Thread vincent habchi
Le 3 mai 2010 à 17:08, Graham Cox a écrit : this might be a silly question but, before doing any further implementation, and having found no definite answer, I dare ask it. Is there a way to sort the contents of a NSTableView whose data is provided by a data source, besides sorting

Re: narraycontroller sort performance problems

2009-12-18 Thread Richard
hey mike the final thought put me on to an easy solution, thanks. i just stopped the controller automaticallly rearranging the content, then called [arrayController rearrangeContent] after a batch of search results has arrived. it still is quite heavy on the processor, but the results arrive in a

narraycontroller sort performance problems

2009-12-17 Thread Richard
hey i have an app that performs searches over a network connection. the app uses core data to manage all the search requests (currently using an in memory store), with an array controller and table view bound to the relevant results. a search query produces up to about 1 results, and they are

Re: narraycontroller sort performance problems

2009-12-17 Thread Jens Alfke
On Dec 17, 2009, at 7:22 AM, Richard wrote: i assume this is because with each new search result that is being retrieved and added to the core data model, the array controller is resorting the entire collection of search results? can anyone suggest a solution to this problem? I've run into

Re: narraycontroller sort performance problems

2009-12-17 Thread Mike Abdullah
As with every performance question. Don't assume, MEASURE. Fire up Instruments and find out what is using up the CPU. On 17 Dec 2009, at 15:22, Richard wrote: hey i have an app that performs searches over a network connection. the app uses core data to manage all the search requests

Re: narraycontroller sort performance problems

2009-12-17 Thread Richard
jens, this sounds reasonable, i will give it a try. mike, i did give it a shot in instruments, comparing the same search with and without sorting. i'm not really sure what to make of the results however. when sorting is enabled, nearly all the execution time is taken up with [NSArrayController

Re: narraycontroller sort performance problems

2009-12-17 Thread Mike Abdullah
As with every performance question. Don't assume, MEASURE. Fire up Instruments and find out what is using up the CPU. On 17 Dec 2009, at 15:22, Richard wrote: hey i have an app that performs searches over a network connection. the app uses core data to manage all the search requests

Re: narraycontroller sort performance problems

2009-12-17 Thread Mike Abdullah
Aha, now we're talking! So the problem is that after ever change to your model, the controller must rearrange its content to match. It knows the change is needed because it receives a Key-Value Observing notification of the change. It's got no way to know that more changes are about to happen

proper technique for CoreData SQLite fetch with sort descriptors

2009-09-25 Thread Jim Thomason
several NSSortDescriptors associated with it to properly order the objects (since there are several properties to sub-sort on). One of those, however, causes it to blow up badly - specifically, I have it set on keyPath creator.classRank, where classRank is a method sitting up in my object class

Fwd: [SOLVED] NSTreeController setSelectionIndexPath depends on sort order

2009-09-17 Thread Konrad Windszus
, which are also in the requested object hierarchy. Therefore finding the object is much faster. Since I operate on content rather than on arrangedObjects I do not have to mess around with proxy objects. Just be carefull to apply the same sort order to the contents array. Hope this will help

NSTreeController setSelectionIndexPath depends on sort order

2009-08-25 Thread Konrad Windszus
I have a NSTreeController which is connected to a NSOutlineView. I wish to have links to specific entries in the NSTreeController. With these links I want to select those items. I therefore use the NSIndexPath. Unfortunately the NSIndexPath becomes invalid if the sort order is changed

Forcing NSTreeController to re-sort, and select inserted

2009-05-22 Thread Jim Thomason
to the outlineview, but it adds it into a random spot in the outline view. If I manually re-sort the outline (clicking the column headers), then the rows slide into the appropriate position. So they're being placed in the right spot internally in the collection, the tree controller is just refusing to update

NSTableColumn's sort key in Interface Builder

2009-03-30 Thread Mike Manzano
): { xkDateModified = 2008-01-15 23:03:00 -0800; xkDisplayStatus = Awaiting Pickup; xkFileName = stuff.graffle; xkOwnerID = l...@testtest.com; } I'd like to make the File Name columns sortable, so I've set up the file name column's sort key to be xkFileName and the selector

Re: NSTableColumn's sort key in Interface Builder

2009-03-30 Thread Corbin Dunn
of this dictionary to display to the user): { xkDateModified = 2008-01-15 23:03:00 -0800; xkDisplayStatus = Awaiting Pickup; xkFileName = stuff.graffle; xkOwnerID = l...@testtest.com; } I'd like to make the File Name columns sortable, so I've set up the file name column's sort

[SOLVED] Re: NSTableColumn's sort key in Interface Builder

2009-03-30 Thread Mike Manzano
sortable, so I've set up the file name column's sort key to be xkFileName and the selector to be compare:. The sorting triangle appears in the header, but the column isn't being sorted. I have verified using an NSLog() inside of - tableView:objectForTableColumn:row: that [resultObjectValue

Custom sort order on NSTableColumn

2009-03-29 Thread Trygve Inda
I have an NSTableView with 4 columns. There is an NSArrayController behind it and two columns use bindings to grab data from the array directly. The other two columns have to calculate their content based on other fields in the array. I need to define a custom sort comparison method

Re: Table sort image question

2009-01-06 Thread Graham Cox
On 6 Jan 2009, at 6:20 am, Jon C. Munson II wrote: Essentially what I’m trying to do is determine the sort of the column. One way I've found is to pull out the indicator image. I plan on comparing that to a named image for one of the indicator images. If there is a better way to do

RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
Essentially what I'm trying to do is determine the sort of the column. One way I've found is to pull out the indicator image. I plan on comparing that to a named image for one of the indicator images. If there is a better way to do that, I'd love to know as I haven't dredged

Re: Table sort image question

2009-01-06 Thread Graham Cox
On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote: 1. When is didClickTableColumn actually called? Is it after the table does its stuff, including setting the sort descriptors, or just prior to that? This is not the method you want. You want the NSTableDataSource method: - (void

RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote: 1. When is didClickTableColumn actually called? Is it after the table does its stuff, including setting the sort descriptors, or just prior to that? This is not the method you want. You want the NSTableDataSource method: - (void

RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
miss something? Based on what I see, I think the sortDescriptors aren't even being used when the column sort happens...or is that wrong thinking? Thanks in advance! Peace, Love, and Light, /s/ Jon C. Munson II -Original Message- From: Jon C. Munson II [mailto:jmun...@his.com] Sent

Re: Table sort image question

2009-01-06 Thread Andy Lee
:. It takes two arguments, the first being the table view whose sort descriptors changed. --Andy I am not able to find any further reference to implementation of that method to make sure I implemented it correctly. My subclass isn't complicated, essentially containing a pointer

RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
or does doing so create unnecessary overhead? Peace, Love, and Light, /s/ Jon C. Munson II -Original Message- From: Andy Lee [mailto:ag...@mac.com] Sent: Tuesday, January 06, 2009 2:31 PM To: jmun...@his.com Cc: 'Graham Cox'; 'cocoa dev' Subject: Re: Table sort image question On Jan 6

Core DataTableView Column Sort at launch with bindings?

2008-12-22 Thread vince
Thanks for the help ... Is it possible to set up my Core Data doc application's Bindings so that upon launch my mainColumn header is selected and the column is pre-sorted (ascending) without implementing code? thanks again. vince. ___ Cocoa-dev

Re: Sort Through Commas in Cocoa

2008-11-28 Thread Pierce Freeman
Would this still work for a NSMutable array? Sincerely, Pierce F -- Pierce Freeman [EMAIL PROTECTED] On 11/26/08 6:40 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On Nov 26, 2008, at 7:28 PM, Pierce Freeman wrote: Thanks for your reply. I understand how you would do that much, but

Re: Sort Through Commas in Cocoa

2008-11-28 Thread Nick Zitzmann
On Nov 28, 2008, at 5:12 PM, Pierce Freeman wrote: Would this still work for a NSMutable array? If you need a mutable version, then you need to make a mutable copy of the components array. Nick Zitzmann http://www.chronosnet.com/ ___

Sort Through Commas in Cocoa

2008-11-26 Thread Pierce Freeman
Hi everyone. Assuming that you get input from user via a regular text field, I am wondering how you can sort through the commas and then save each of the words that come before the commas into a array. For example, the words below would be what the user inputted: Apple, banana, grapes

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Nick Zitzmann
On Nov 26, 2008, at 7:12 PM, Pierce Freeman wrote: Assuming that you get input from user via a regular text field, I am wondering how you can sort through the commas and then save each of the words that come before the commas into a array. For example, the words below would be what

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Pierce Freeman
: Assuming that you get input from user via a regular text field, I am wondering how you can sort through the commas and then save each of the words that come before the commas into a array. For example, the words below would be what the user inputted: Apple, banana, grapes NSArray

Re: Sort Through Commas in Cocoa

2008-11-26 Thread Nick Zitzmann
On Nov 26, 2008, at 7:28 PM, Pierce Freeman wrote: Thanks for your reply. I understand how you would do that much, but how exactly would you do that if Apple, Banana, Grape were stored in a variable? Same thing as I wrote, except substitute the variable's name for the constant. Nick

Re: How do I use Sort Descriptor binding in IB on my array controller?

2008-09-03 Thread Negm-Awad Amin
controller (ctrl-dragging in IB). Then you can set the sort desciptors of the array controller in your code using setSortDescriptors:. The best place depends on the type of the file's owner. Typically you have a window controller or an view controller subclass and simply put the code

Re: How do I use Sort Descriptor binding in IB on my array controller?

2008-08-30 Thread amy
. Is there a quick, mostly-IB way to configure that? The presence of a sort descriptor binding for the NSArrayController makes me think it should be pretty straightforward. TIA, -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: How do I use Sort Descriptor binding in IB on my array controller?

2008-08-30 Thread Quincey Morris
. I would like those menu items to be sorted. Is there a quick, mostly-IB way to configure that? The presence of a sort descriptor binding for the NSArrayController makes me think it should be pretty straightforward. Typically, File's Owner for the nib file containing the array controller

Sort Descriptor problem in NSTableView

2008-08-11 Thread Graham Cox
I have a table view where one column's strings are sorted using (NSCaseInsensitiveSearch | NSNumericSearch). To do this I use compare:options: on the strings. I'd like to be able to allow the user to sort ascending or descending in the usual way by clicking the column header but using

Re: Sort Descriptor problem in NSTableView

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 12:26 am, Keary Suska wrote: OTOH, implement a custom sort method, setting it as the method to use in the table column properties. OK, that helps a little - I've made some progress in that I'm now getting the sort change notification in my delegate and the arrow

Re: Sort Descriptor problem in NSTableView

2008-08-11 Thread Adam R. Maxwell
On Monday, August 11, 2008, at 05:32PM, Graham Cox [EMAIL PROTECTED] wrote: I just want to sort a simple mutable array of strings. So what should the key be? There is no property I want to sort on, the string itself *is* the property. But if I leave the key field blank the table just

Re: Sort Descriptor problem in NSTableView [SOLVED]

2008-08-11 Thread Graham Cox
On 12 Aug 2008, at 10:39 am, Adam R. Maxwell wrote: I just want to sort a simple mutable array of strings. So what should the key be? There is no property I want to sort on, the string itself *is* the property. But if I leave the key field blank the table just keeps accumulating broken sort

Can't sort NSTableView

2008-06-19 Thread Trygve Inda
I have an NSTableView tied to an NSArrayController After I populate the array, the table does show the data via bindings on each of the columns. However, clicking a column header does nothing - how can I make it sort? I have done this before in IB2 and it sorted ok, but I can't make this new

Re: Can't sort NSTableView

2008-06-19 Thread Brent Fulgham
On Thu, Jun 19, 2008 at 10:24 AM, mmalc crawford [EMAIL PROTECTED] wrote: http://homepage.mac.com/mmalc/CocoaExamples/controllers.html - Disabling sorting in a tableview mmalc mmalc's note reminds me: I would like to publicly thank him for this great resource. The examples and documentation

Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-08 Thread Kyle Sluder
On Fri, Jun 6, 2008 at 6:53 PM, Adam R. Maxwell [EMAIL PROTECTED] wrote: So for an array of NSNumbers you could use -description and a -numericCompare: method that uses NSNumericSearch. In my opinion, it makes more sense to use -self and -compare: for NSDate/NSNumber. To me, option 1 only

Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread George Stuart
So I searched through the cocoabuilder.com threads on array sorting to see what had been discussed regarding this topic. My goal is to reverse alphabetically sort an array of NSString objects. I saw a couple suggestions: 1. Categories to add funcationality to NSString and then use

Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread Ken Thomases
On Jun 6, 2008, at 4:16 PM, Adam R. Maxwell wrote: On Friday, June 06, 2008, at 02:07PM, George Stuart [EMAIL PROTECTED] wrote: The suggestion of using a keyPath of @self presents another question: 1) I assume NSSortDescriptor is using valueForKeyPath:, which in turns calls valueForKey:

Re: Using NSSortDescriptor to reverse sort an NSArray containing NSString objects

2008-06-06 Thread Adam R. Maxwell
sorting). Sure, the combination of KVC, sort descriptors, and categories allows a lot of creativity: -description can be used for a comparison if NSString implements the method you need, or if you add it as an NSString category. So for an array of NSNumbers you could use - description

How to sort smoothly when NSTableColumn's Sort Key is empty

2008-06-03 Thread an0
I know how to sort items in NSTableView when each NSTableColumn corresponds to a property of the item object. But what if there is only one NSTableColumn and it is just mapped to the item object itself instead of a property of it? I set the Selector to compare: and leave the Sort Key to empty

Re: How to sort smoothly when NSTableColumn's Sort Key is empty

2008-06-03 Thread Hamish Allan
.: - (id)identity { return self; } And bind to 'identity' rather than leaving the sort key empty. Let us know what happens! Hamish ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments

How do I use Sort Descriptor binding in IB on my array controller?

2008-05-31 Thread Rick Mann
I have an array controller in IB that is used by a popup menu in a table view column. I would like those menu items to be sorted. Is there a quick, mostly-IB way to configure that? The presence of a sort descriptor binding for the NSArrayController makes me think it should be pretty

Re: Sort

2008-05-10 Thread norio
Chuck, Thanks for the help. Suppose that you have these 9 strings:0001,0002,0003,001,002,003,01,02,03. I'd like to sort them as 0001,001,01,0002,002,02,0003,003,03 as Finder. If you use one of the compare methods that allows you to supply options, NSNumericSearch will do what you want

Sort

2008-05-09 Thread Norio
Suppose that you have these 9 strings:0001,0002,0003,001,002,003,01,02,03. I'd like to sort them as 0001,001,01,0002,002,02,0003,003,03 as Finder. I tried a sample code of Sorting strings like Finder in Searching, Comparing, and Sorting Strings in String Programming Guide for Cocoa. However

  1   2   >