Re: NSTableView: Rows from bottom up
You can move the table view to the bottom of the scroll view in an override of -[NSScrollView tile]. Déjà vu http://cocoa-dev.apple.narkive.com/cwH1sLmk/nstableview-with-reversed-rows - Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: selectText of NSTextField on focus
@implementation MyTextField - (void)mouseDown:(NSEvent *)event { NSText *editor = self.currentEditor; assert(editor Current editor is nil!); assert(editor.isFieldEditor Editor not a field editor!); NSRange range = NSMakeRange(0, editor.string.length); [editor setSelectedRange:range]; [super mouseDown:event]; } @end You're almost there, do [super mouseDown:event] first. - Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: selectText of NSTextField on focus
Op 6 jul. 2015, om 18:15 heeft Richard Charles rcharles...@gmail.com het volgende geschreven: Does anyone have any insight into what is going on? The animation of the focus ring isn't finished. If the focus ring is switched off, the text is selected. Safari's Address and Search field calls setSelectedRange: of currentEditor in mouseDown: - Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Scripting Bridge Questions
Hi, Can you open the dictionary in Scripteditor? Is the application launched when you run sdef or open the dictionary in Scripteditor? I can’t seem to find an editor that will open it Try Xcode or TextWrangler with soft wrap switched on in the preferences. Or Sdef Editor, ignore the warnings and save as…. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTableView with reversed rows?
Op 2 okt 2014, om 23:13 heeft Luc Van Bogaert het volgende geschreven: That's not exactly what I meant, but it might be part of a solution. I want the table to populate 'from the bottom to the top', so that the free space in the scrollview (if there is any) is at the top, above the top row, instead of below the bottom table row. I hope I have expressed more clear what I 'm looking for. -- Luc Van Bogaert Override -[NSScrollView tile], call super and move the document view to the bottom if there is space left? --Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to Validate CoreData attribute value for uniqueness
Some ideas, I don't know if it works: in your validation method, change NSArray *allSpecies = [self.managedObjectContext executeFetchRequest:allSpeciesIDsFetchRequest error:nil]; NSArray *allCatalogIDs = [allSpecies valueForKeyPath:@catalogID]; if ([allCatalogIDs containsObject:*ioValue]) { to something like [allSpeciesIDsFetchRequest setPredicate:[NSPredicate predicateWithFormat:@catalogID == %@, *ioValue]]; NSArray *species = [self.managedObjectContext executeFetchRequest:allSpeciesIDsFetchRequest error:nil]; if ([species count] 1 || [species count] == 1 [species objectAtIndex:0] != self) { NSTextField can have a delegate which can implement - (BOOL)control:(NSControl *)control isValidObject:(id)object Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Converting database to Core Data
Perhaps I don't see the problem but what is preventing you from creating the second inverse relationship? Op 10 jul 2014, om 22:00 heeft William Squires het volgende geschreven: I'm trying to convert the following. I have two tables in a database, TransactionEntry, and ReasonCode. A TransactionEntry record is just a posting from a POS (Point-of-Sale) terminal, and has these fields (of interest): Table (TransactionEntry) ID As Int32 PrimaryReasonCode As Int32 // both of these link to ReasonCode.ID SecondaryReasonCode As Int32 ... and a ReasonCode record is used when a certain types of transactions occur, such as POSItemReturned, POSItemVoided, POSCommError, and a few others. Table (ReasonCode) ID As Int32 Description As Varchar(50) ReasonCode As Int16 // just an enum ... All would be good and well if the TransactionEntry table had only one reference (.PrimaryReasonCode) to the ReasonCode table, but some transactions (such as a voided item) require the manager to fill in both the primary and secondary reason codes. I can create the entities, and replace the Int32 record numbers/IDs with a relationship. I create the relationship in entity TransactionEntry and set it to ReasonCode, leaving the inverse relationship to none for now. I then create an inverse relationship in entity ReasonCode to refer back to TransactionEntry. Now I can create the inverse relationships in both directions. 1:1 for TransactionEntry - ReasonCode, and 1:many for ReasonCode - TransactionEntry. All okay so far. Primary ReasonCode records (entities) are re-used to save memory, and the .Description fields are pre-set to values such as, return item, wrong key hit, cc reader not working, etc... Secondary ReasonCode entities are (usually) created on-demand from the POS terminal when the manager logs in. A few are re-used, but mostly new entities are created. The problem now comes when I try to create the same relationships from TransactionEntry entities to ReasonCode entities for the secondary reason code records (entities), since it won't let me make both inverse relationships 1:many from ReasonCode back to TransactionEntry. Is this a limitation of CoreData? Or is there a way around this? Can I ignore Xcode's warnings about not having inverse relationships, and simply set the inverse relationships from the TransactionEntry entity(ies) to the ReasonCode Entity to none, and simply get rid of the inverse relationships in the ReasonCode entity? Please help! :) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/willeke2007%40gmail.com This email sent to willeke2...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Bindings setup with NSCollectionViews
Bind the Selection Indexes of the master collection view to selectionIndexes of the BoardArrayController. I would bind the Contents of the detail collection view to arrangedObjects of the ListArrayController. Willeke Op 18 jun 2014, om 03:40 heeft Hajder Rabiee het volgende geschreven: Hi all I am having trouble getting the master-detail binding configuration setup correctly. I've sat down far too many hours trying to debug this and I hope anyone can give me a hint on how to solve this issue. The full problem description can be found already at http://stackoverflow.com/questions/24190299/nscollectionview-master-detail-binding-configuration Thank you -- Med vänliga hälsningar / Best Regards Hajder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/willeke2007%40gmail.com This email sent to willeke2...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: copy and mutableCopy
Op 27 apr 2014, om 11:00 heeft Dave het volgende geschreven: Hi All, A long time back, I remember reading something about the way in which copy and mutableCopy are implemented. I think basically it said that: someObject = [someOtherObject copy]; or someObject = [someOtherObject mutableCopy]; Wouldn’t necessarily allocate any extra data storage. I’ve been searching for it to refresh my memory, but I can’t see to find it anywhere. Does anyone know if this document or something like it exists somewhere? Thanks a lot Dave Maybe this is what you are looking for? http://disanji.net/iOS_Doc/#documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmImplementCopy.html Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to display NSStrokeColorAttributeName on the NSColorPanel
You have to disconnect the NSColorPanel and the NSTextView. You can do this by switching off Font Panel of the NSTextView. - Willeke Op 3 feb 2014, om 20:45 heeft Leonardo het volgende geschreven: Hi Willeke, Yes, I click on the oForeColorWell, it gets activated and opens the NSColorPanel open. Then when the NSTextView is the first responder, any time I press the right or left arrow key and the text selection changes, the color panel and the colorWell display the text foreColor. I would like to to the same with the strokeColor, but I can't succeed. Regards -- Leonardo Da: Willeke willeke2...@gmail.com Data: Sun, 2 Feb 2014 13:25:46 +0100 A: Leonardo mac.iphone@gmail.com Oggetto: Re: How to display NSStrokeColorAttributeName on the NSColorPanel Op 1 feb 2014, om 17:12 heeft Leonardo het volgende geschreven: It seems that, since the oStrokeColorWell is active, it automatically gets its color value from the selected text. I would like to override the method from which it takes the color value, but I cannot guess which one it is. I unsuccessfully tried - (NSColor*)textColor; And I even tried to not to override the method below textViewDidChangeSelection. Same trouble. Any idea? How are the oForeColorWell and the text synchronized? Is the color panel open? - Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Set up an editable view based NSTableView programmatically - how to?
Op 7 jan 2014, om 16:52 heeft Peter het volgende geschreven: I’d actually prefer to use bindings, but my first column should simply display the row numbers After some experimenting I managed to create a simple editable view based table view with row numbers, using bindings except for the row number. The row number is in a column with identifier RowNumber. I implemented this delegate method: - (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row { NSTableCellView *result = [tableView makeViewWithIdentifier:[tableColumn identifier] owner:self]; if ([[tableColumn identifier] isEqualToString:@RowNumber]) result.textField.objectValue = [NSNumber numberWithInteger:row]; return result; } That's all. This is the first time I used a view based table view and it looks too simple but maybe it helps. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPopUpButton binding value/selected problem
Why don't you want to bind the Selected Index? It does what you want. Because I don't want the menu to reflect the selection in the table. I just need the contents of the menu to match the contents of the table, but the selections in each place need to be independent of each other. You could bind Selected Object of the popup button to something like a property of the windowcontroller. Or give the popup button its own arraycontroller. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data Initialization
Op 2 sep 2013, om 13:01 heeft Dave het volgende geschreven: Is this advisable? Yes, it's in the Core Data FAQ: https://developer.apple.com/library/ios/documentation/Cocoa/Conceptual/CoreData/Articles/cdFAQ.html#//apple_ref/doc/uid/TP40001802-SW5 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPipe eating up all available pipes on system.
I don't know why but it doesn't leak if you do readInBackgroundAndNotify only if [data length]!=0. - Willeke Op 20 feb 2013, om 23:56 heeft Mr. Gecko het volgende geschreven: Looks like every pipe is leaking. I cannot see a way to prevent the leak myself as I know the NSPipes are being released. It doesn't seem to crash with Auto Reference Counting… But boy, it eats memory and still leaks. So I would think this is an Apple bug. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: filtering an array of entities using NSPredicate
Op 15 okt 2012, om 02:05 heeft Koen van der Drift het volgende geschreven: On Oct 14, 2012, at 7:56 PM, Willeke willeke2...@gmail.com wrote: the predicate should be something like name IN {Jones A., Williams S., Brown M., Tobias S.} what is persons in this statement? [fetchRequest setPredicate: [NSPredicate predicateWithFormat: @name IN %@, persons]]; 'persons' is an array of dictionaries, where one of the key-value pairs contains the name. - Koen. It should be an array of strings: [fetchRequest setPredicate: [NSPredicate predicateWithFormat: @name IN %@, [persons valueForKey:@name]]]; Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: filtering an array of entities using NSPredicate
Maybe another clue, if I NSLog the predicate, I get this: name IN {{name = Jones A.}, {name = Williams S.}, {name = Brown M.}, {name = Tobias S.}} That seems as expected to me. the predicate should be something like name IN {Jones A., Williams S., Brown M., Tobias S.} what is persons in this statement? [fetchRequest setPredicate: [NSPredicate predicateWithFormat: @name IN %@, persons]]; Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
If Auto Rearrange Content is switched on, the array controller is observing the objects in its content for the keypaths of the filterpredicate and sortdescriptors. The value of key personalNames of keypath personalNames.value.gedcomString is an array and can't be observed for key value. What happens if you switch Auto Rearrange Content off? Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
MIkkel, I'm sorry, I didn't see your answer yet when I sent my previous message. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSPredicate / NSArray addObserver:forKeyPath:options:context: exception
Is Auto Rearrange Content of the array controller switched on? The array controller can't observe to-many relationships. Does NSPredicateEditor work with to-many relationships? I don't think so, but I'm not sure. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Binding NSTableView to NSSet
Op 14 jul 2012, om 04:46 heeft Koen van der Drift het volgende geschreven: A follow up question: how do I now sort the data in the table? I am showing three values in the table, and like to sort based on either one of them. The original data is in an unordered NSSet (from my CD model). I could create an NSArray in my view controller: NSArray *myArray = [myTagsSet allObjects], and bind that to the NSArrayController, instead of to the NSSet; then I can sort the values in the table based on the array using sortDescriptors as explained here: https://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/TableView/SortingTableViews/SortingTableViews.html#//apple_ref/doc/uid/1026i-CH10-SW1. Would that be a good approach? Other alternatives? Can't you just set the sortDescriptors of the array controller? Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sorting an NSTableView bound to an NSArrayController.
Op 28 jun 2012, om 17:44 heeft Robert Tillyard het volgende geschreven: I now I need to put a key and sort descriptor in IB but don't know what code I have to add to the Entity ot WindowController to handle it. You can create a category of NSString and implement your own compare method. In IB you set the selector of the table column to this method. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: multi-window document best practices?
Op 13 mei 2012, om 04:11 heeft mlist0...@gmail.com het volgende geschreven: If it were important that nibs should be built differently for single and multiple window cases, I'd think the docs would mention it someplace, but they don't They do. The documentation of awakeFromNib says It is recommended that you maintain a one-to-one correspondence between your File’s Owner objects and their associated nib files. You Should Subclass NSWindowController in Document-Based App Programming Guide for Mac says Reasons to Subclass NSWindowController: If your document requires or allows multiple windows for a single document, that is a good reason to subclass NSWindowController. How to Subclass NSWindowController: The NSWindowController subclass instance should be the File’s Owner for the nib file because that creates better separation between the view-related logic and the model-related logic. If each NIB has its own owner, awakeFromNib is only called once. Willeke ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
How to create an expression?
hi, How do I programmatically create the $x.firstname and .@count parts of this expression? SUBQUERY(residents, $x, $x.firstname == Jane $x.lastname == Doe).@count When I create a subquery predicate with predicateWithFormat:, the class of the $x.firstname and .@count expressions is NSKeyPathExpression and the type is NSFunctionExpressionType. The operand is an expression of type NSVariableExpressionType or NSSubqueryExpressionType. The function is valueForKeyPath:. When I create an expression with expressionForKeyPath:, the operand is SELF instead of the variable or the subquery. When I create an expression with expressionForFunction:selectorName:arguments:, the class is NSFunctionExpression. When the argument is a keypath expression, instead of $x.firstname the expression tries to evaluate $x.Jane and that doesn't work. executeFetchRequest throws an exception: -constantValue only defined for abstract class. Define -[NSKeyPathExpression constantValue]! If the argument is a constant value expression, executeFetchRequest throws an exception: -keyPath only defined for abstract class. Define -[NSConstantValueExpression keyPath]!. The predicate will be edited in a rule editor so I have to convert it to criteria and back. The predicate will be used as filter predicate of an array controller in entity mode and/or in a fetch request with Core Data (SQLite). Thanks, Willeke___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com