Re: NSLevelIndicator Bindings Crash
On Mar 23, 2009, at 2:04 PM, Walker Argendeli wrote: Yes, you're right, Item is an NSArrayController representing the entity Item. Sorry about that. ItemsList is an Entity and Array Controller representing an outline view of folders. Each folder can have multiple Items in it. Depending on which folder is selected in the ItemsList outline view, the right Items will appear in the Table view whose columns are bound to properties of the Item array controller. Depending on which item is selected in the Item tableview, the level indicator, which is bound to (the array controller) Item.selection.priority The Item.selection.priority keypath indicates that you are referencing the key Item of the array controller (as you describe). How is that key defined? For some reason though, I get the odd behavior that follows: In the Item table view, if I have one item selected, then select a different one, that new Item will have the levelindicator defaulted back to 1, though it had been set to a different value previously. Are you saying that the level indicator always shows 1, no matter what the bound value is, or that it changes back to the original value after you change it? Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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
Re: NSLevelIndicator Bindings Crash
I'm sorry for the trouble I'm giving you explaining this. The Item.selection.priority keypath indicates that you are referencing the key Item of the array controller (as you describe). How is that key defined? I'm binding to the array controller called Item, which contains entities of type Item. The level indicator is bound to the key selection and model key path priority of the Item array controller. Are you saying that the level indicator always shows 1, no matter what the bound value is, or that it changes back to the original value after you change it? If I have a row selected in the table view, change the level indicator, select another row, and come back to the original row, the row I changed will have defaulted back to 1. Thanks, - Walker Argendeli ___ 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
Re: NSLevelIndicator Bindings Crash
On Tue, Mar 24, 2009 at 2:52 PM, Walker Argendeli heckler0...@bellsouth.net wrote: The Item.selection.priority keypath indicates that you are referencing the key Item of the array controller (as you describe). How is that key defined? I'm binding to the array controller called Item, which contains entities of type Item. The level indicator is bound to the key selection and model key path priority of the Item array controller. I've seen people refer to their keypaths as [Object]key.anotherKey in an attempt to alleviate this confusion. --Kyle Sluder ___ 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
Re: NSLevelIndicator Bindings Crash
On Mar 24, 2009, at 11:52 , Walker Argendeli wrote: I'm sorry for the trouble I'm giving you explaining this. The Item.selection.priority keypath indicates that you are referencing the key Item of the array controller (as you describe). How is that key defined? I'm binding to the array controller called Item, which contains entities of type Item. The level indicator is bound to the key selection and model key path priority of the Item array controller. Are you saying that the level indicator always shows 1, no matter what the bound value is, or that it changes back to the original value after you change it? If I have a row selected in the table view, change the level indicator, select another row, and come back to the original row, the row I changed will have defaulted back to 1. Thanks, - Walker Argendeli You're binding a levelIndicator? The LevelIndicator's value binding is read-only. That's why it looks like you've changed the value, but you really haven't. The rest of your setup sounds correct. Please file a bug that NSLevelIndicator's value binding isn't read- write. -- RONZILLA ___ 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
Re: NSLevelIndicator Bindings Crash
On Mar 24, 2009, at 13:43 , Dave Keck wrote: You're binding a levelIndicator? The LevelIndicator's value binding is read-only. That's why it looks like you've changed the value, but you really haven't. The rest of your setup sounds correct. The docs: http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSLevelIndicator.html don't say anything about NSLevelIndicator's 'value' property being read-only, and personal experience also suggests that it is read-write. Am I missing something? Ah yea, you're right - you're not missing anything. I forgot to turn my example nib's level indicator to editable. After that it all works fine. Maybe Walker had the same mishap? -- RONZILLA ___ 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
Re: NSLevelIndicator Bindings Crash
You're binding a levelIndicator? The LevelIndicator's value binding is read-only. That's why it looks like you've changed the value, but you really haven't. The rest of your setup sounds correct. The docs: http://developer.apple.com/documentation/Cocoa/Reference/CocoaBindingsRef/BindingsText/NSLevelIndicator.html don't say anything about NSLevelIndicator's 'value' property being read-only, and personal experience also suggests that it is read-write. Am I missing something? ___ 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
Re: NSLevelIndicator Bindings Crash
I did some more looking and determined that it should be Item.selection.priority When i do this, however, every time I switch back to another item, the level defaults back to 1. Also, I checked that chapter in Hillegass's book, and it had an example where it used Car.selection.condition, so it seems that selection is the right controller key. The bindings in general are just really funky. I added a stepper and textbox in addition to the level indicator, and bound them to Item.selection.priority, and they too default back to 1 (the default value) every time I go to another item. The Item array controller's Content Set is bound to ItemsList.selection.Item That's the only binding, other than the managed object context. I really can't figure out what's causing this problem, which is annoying because I'm trying to focus on fixing this before I continue development. Thanks, - Walker Argendeli On Mar 22, 2009, at 10:05 AM, Richard Somers wrote: On Mar 21, 2009, at 3:41PM, Walker Argendeli wrote: I'm using Core Data, and I have an entity; we'll call it Item. It has an attribute called priority. In the xib, I have an NSLevelIndicator and NSStepper. I have a NSTableView full of Items. Depending on which item is selected in the table view, I want the level indicator and stepper to display the right values, and for me to be able to set them to a certain value for each item. There are 2 problems: If I bind the value of either one to Item.arrangedObjects.priority, the app throws an exception, whereas if I bind to Item.selection.priority, the controls don't set each item's priority individually. What should I bind to? Secondly, an NSLevelIndicator wants a float for its value, whereas an NSStepper wants a double for its value. Which should I set it to in the core data model? Cocoa Programming for Mac OS X Third Edition by Arron Hillegass Chapter 11, Basic Core Data, pages 171-182 has a NSLevelIndicator. This chapter might shed some light on your problem. Richard ___ 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
Re: NSLevelIndicator Bindings Crash
On Mar 23, 2009, at 1:13 PM, Walker Argendeli wrote: When i do this, however, every time I switch back to another item, the level defaults back to 1. Also, I checked that chapter in Hillegass's book, and it had an example where it used Car.selection.condition, so it seems that selection is the right controller key. The bindings in general are just really funky. I added a stepper and textbox in addition to the level indicator, and bound them to Item.selection.priority, and they too default back to 1 (the default value) every time I go to another item. The Item array controller's Content Set is bound to ItemsList.selection.Item That's the only binding, other than the managed object context. I really can't figure out what's causing this problem, which is annoying because I'm trying to focus on fixing this before I continue development. Your descriptions make no sense. When referencing binding key paths, make them relative to the controller, and not to the model. I assume that when you say Item.arrangedObjects.priority you really mean NSARRAYCONTOLLER.arrangedObjects.priority. This is a critical distinction, as the two paths are nowhere near the same. Ok, so you have an entity Item, and you have an NSArrayController with Content Set bound to ItemsList.selection.Item. What is ItemsList, and why does it exist? What controller is providing content to the table view? Generally the proper approach is: 1. array controller with bound MOC that either performs its own fetch or is populated programmatically; 2. tableview bound (technically, columns are bound) to that array controller; 3. detail items (level indicator and stepper) bound to arraycontroller.selection.property (where arraycontroller is the controller specified in #1). That should be all there is to it. On Mar 22, 2009, at 10:05 AM, Richard Somers wrote: On Mar 21, 2009, at 3:41PM, Walker Argendeli wrote: I'm using Core Data, and I have an entity; we'll call it Item. It has an attribute called priority. In the xib, I have an NSLevelIndicator and NSStepper. I have a NSTableView full of Items. Depending on which item is selected in the table view, I want the level indicator and stepper to display the right values, and for me to be able to set them to a certain value for each item. There are 2 problems: If I bind the value of either one to Item.arrangedObjects.priority, the app throws an exception, whereas if I bind to Item.selection.priority, the controls don't set each item's priority individually. What should I bind to? Secondly, an NSLevelIndicator wants a float for its value, whereas an NSStepper wants a double for its value. Which should I set it to in the core data model? Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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
Re: NSLevelIndicator Bindings Crash
Yes, you're right, Item is an NSArrayController representing the entity Item. Sorry about that. ItemsList is an Entity and Array Controller representing an outline view of folders. Each folder can have multiple Items in it. Depending on which folder is selected in the ItemsList outline view, the right Items will appear in the Table view whose columns are bound to properties of the Item array controller. Depending on which item is selected in the Item tableview, the level indicator, which is bound to (the array controller) Item.selection.priority For some reason though, I get the odd behavior that follows: In the Item table view, if I have one item selected, then select a different one, that new Item will have the levelindicator defaulted back to 1, though it had been set to a different value previously. I hope that's not too confusing. Thanks - Walker Argendeli On Mar 23, 2009, at 3:55 PM, Keary Suska wrote: On Mar 23, 2009, at 1:13 PM, Walker Argendeli wrote: When i do this, however, every time I switch back to another item, the level defaults back to 1. Also, I checked that chapter in Hillegass's book, and it had an example where it used Car.selection.condition, so it seems that selection is the right controller key. The bindings in general are just really funky. I added a stepper and textbox in addition to the level indicator, and bound them to Item.selection.priority, and they too default back to 1 (the default value) every time I go to another item. The Item array controller's Content Set is bound to ItemsList.selection.Item That's the only binding, other than the managed object context. I really can't figure out what's causing this problem, which is annoying because I'm trying to focus on fixing this before I continue development. Your descriptions make no sense. When referencing binding key paths, make them relative to the controller, and not to the model. I assume that when you say Item.arrangedObjects.priority you really mean NSARRAYCONTOLLER.arrangedObjects.priority. This is a critical distinction, as the two paths are nowhere near the same. Ok, so you have an entity Item, and you have an NSArrayController with Content Set bound to ItemsList.selection.Item. What is ItemsList, and why does it exist? What controller is providing content to the table view? Generally the proper approach is: 1. array controller with bound MOC that either performs its own fetch or is populated programmatically; 2. tableview bound (technically, columns are bound) to that array controller; 3. detail items (level indicator and stepper) bound to arraycontroller.selection.property (where arraycontroller is the controller specified in #1). That should be all there is to it. On Mar 22, 2009, at 10:05 AM, Richard Somers wrote: On Mar 21, 2009, at 3:41PM, Walker Argendeli wrote: I'm using Core Data, and I have an entity; we'll call it Item. It has an attribute called priority. In the xib, I have an NSLevelIndicator and NSStepper. I have a NSTableView full of Items. Depending on which item is selected in the table view, I want the level indicator and stepper to display the right values, and for me to be able to set them to a certain value for each item. There are 2 problems: If I bind the value of either one to Item.arrangedObjects.priority, the app throws an exception, whereas if I bind to Item.selection.priority, the controls don't set each item's priority individually. What should I bind to? Secondly, an NSLevelIndicator wants a float for its value, whereas an NSStepper wants a double for its value. Which should I set it to in the core data model? Keary Suska Esoteritech, Inc. Demystifying technology for your home or business ___ 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
Re: NSLevelIndicator Bindings Crash
On Mar 21, 2009, at 3:41PM, Walker Argendeli wrote: I'm using Core Data, and I have an entity; we'll call it Item. It has an attribute called priority. In the xib, I have an NSLevelIndicator and NSStepper. I have a NSTableView full of Items. Depending on which item is selected in the table view, I want the level indicator and stepper to display the right values, and for me to be able to set them to a certain value for each item. There are 2 problems: If I bind the value of either one to Item.arrangedObjects.priority, the app throws an exception, whereas if I bind to Item.selection.priority, the controls don't set each item's priority individually. What should I bind to? Secondly, an NSLevelIndicator wants a float for its value, whereas an NSStepper wants a double for its value. Which should I set it to in the core data model? Cocoa Programming for Mac OS X Third Edition by Arron Hillegass Chapter 11, Basic Core Data, pages 171-182 has a NSLevelIndicator. This chapter might shed some light on your problem. Richard ___ 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
NSLevelIndicator Bindings Crash
I'm using Core Data, and I have an entity; we'll call it Item. It has an attribute called priority. In the xib, I have an NSLevelIndicator and NSStepper. I have a NSTableView full of Items. Depending on which item is selected in the table view, I want the level indicator and stepper to display the right values, and for me to be able to set them to a certain value for each item. There are 2 problems: If I bind the value of either one to Item.arrangedObjects.priority, the app throws an exception, whereas if I bind to Item.selection.priority, the controls don't set each item's priority individually. What should I bind to? Secondly, an NSLevelIndicator wants a float for its value, whereas an NSStepper wants a double for its value. Which should I set it to in the core data model? Thanks, - Walker Argendeli ___ 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