Re: Hiding Glyphs

2009-06-20 Thread Keith Blount
Hi, Sorry for being over a week late to this thread, but I'm the guy who was trying to get hidden text to work before, in the thread mentioned earlier (Martin kindly pointed me in this direction). I'm not sure why the test code archives on my site weren't decompressing, but they probably just

Re: Core Data Persistent Store Corrupted

2009-06-20 Thread Jerry Krinock
On 2009 Jun 17, at 05:43, Vladislav Struhar wrote: I'm using Core Data model with NSBinaryStoreType persistent store. Wow. I've never seen that actually used in real life. After a long time of using this with no issues, I have encountered an error: "The file could not be opened because

Re: Core Data Persistent Store Corrupted

2009-06-20 Thread Vladislav Struhar
Actually I took a look at the file with HexEdit, that the file is really corrupted! The header was different than the one from good file! Now how can this happen with saving managed object contex? I'm always saving in main thread... The only thing I've found in my code, is that I missed two

Re: my drawer won't close

2009-06-20 Thread James W. Walker
On Jun 19, 2009, at 12:19 PM, James Walker wrote: I set up a drawer in IB, with an NSScrollView containing an NSTextView as my content view. I open it programmatically, and it looks fine. But when I try to close the drawer using the mouse, it just beeps. With a bit more thought, it's f

Programmatically creating a NSMatrix with a prototype cell question

2009-06-20 Thread David Hoerl
Create a NSTextFieldCell and customize it. Create a NSMatrix using the "prototype" init version, and display it. All the custom formatting is gone - all cells are vanilla NSTextFieldCells. Loop through the matrix, and set each cell to a copy of the cell I used as a prototype, using the "putCel

Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Hello, I'm experiencing some difficulties with KVO and auto dependent keys. Am I doing something wrong, or should I fill a bug report ? Here is a test case. MyObject is a class with a single property: name. MyWrapper is a class that wrap a MyObject instance. It also declares a property 'na

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jeff Johnson
When you implement + (NSSet *)keyPathsForValuesAffectingName { return [NSSet setWithObject:@"object.name"]; }, you're implicitly setting up KVO, so whenever the name of the MyObject instance changes, KVO notifications are sent for the name of the MyWrapper instance. When you manually call a

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Quincey Morris
On Jun 20, 2009, at 11:08, Jean-Daniel Dupas wrote: - (void)dealloc { [_object release]; [super dealloc]; } Try changing this to: - (void) dealloc { self.object = nil; [super dealloc]; } 'keyPathsForValuesAffectingName' is going to cause your wrapper to observe its MyObje

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Quincey Morris
On Jun 20, 2009, at 11:56, Quincey Morris wrote: But you actually have a 1-1 relationship between the wrapper and the MyObject, so you kind of need to break the relationship before releasing the wrapper end of it. Oops, misspoke. It's a many-to-1 relationship, obviously. _

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jeff Johnson
Sorry, scratch that, I apparently misread your example. As Phil would say, I'm an idiot. Does +keyPathsForValuesAffecting... actually support true keypaths? The documentation is unclear. -Jeff On Jun 20, 2009, at 1:45 PM, Jeff Johnson wrote: When you implement + (NSSet *)keyPathsForValue

Re: programmatically creating a NSMatrix with a prototype cell

2009-06-20 Thread Bertil Holmberg
I do something similar here, perhaps you can spot some discrepancy? // Instantiate a special buttonCell that can be drawn in color and configure it CCDColoredButtonCell *colorCell = [[CCDColoredButtonCell alloc] init]; [colorCell setButtonColor:[NSColor clearColor]]; [c

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Le 20 juin 09 à 20:56, Quincey Morris a écrit : On Jun 20, 2009, at 11:08, Jean-Daniel Dupas wrote: - (void)dealloc { [_object release]; [super dealloc]; } Try changing this to: - (void) dealloc { self.object = nil; [super dealloc]; } 'keyPathsForValuesAffectingName' is go

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Clark Cox
On Sat, Jun 20, 2009 at 12:39 PM, Jeff Johnson wrote: > Sorry, scratch that, I apparently misread your example. As Phil would say, > I'm an idiot. > > Does +keyPathsForValuesAffecting... actually support true keypaths? The > documentation is unclear. What do you mean by "true" keypaths? -- Clark

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jean-Daniel Dupas
Le 20 juin 09 à 21:39, Jeff Johnson a écrit : Sorry, scratch that, I apparently misread your example. As Phil would say, I'm an idiot. Does +keyPathsForValuesAffecting... actually support true keypaths? The documentation is unclear. -Jeff If this is not supported, I will fill a bug r

Re: Crash in KVO when using -keyPathsForValuesAffecting

2009-06-20 Thread Jeff Johnson
On Jun 20, 2009, at 4:15 PM, Jean-Daniel Dupas wrote: Le 20 juin 09 à 20:56, Quincey Morris a écrit : On Jun 20, 2009, at 11:08, Jean-Daniel Dupas wrote: - (void)dealloc { [_object release]; [super dealloc]; } Try changing this to: - (void) dealloc { self.object = nil; [su

[WORKAROUND] Re: new NSTreeController bug in 10.5.7?

2009-06-20 Thread Dave Fernandes
This problem occurs when observing the NSTreeController keypath: arrangedObjects.myAttributeName As far as I can tell, I should be able to do this. Bug report filed. Workaround - The reason for observing that keypath was to tell whether any of the values of my attribute changed so that I coul

Re: How to fill rectangle under vertical scroller?

2009-06-20 Thread Sumin Kim
> > >> > > You need to place a view here and do the custom drawing in the view. To > place the view, you need to subclass NSScrollView and override the -tile > method to place the view in that corner. The scrollview subclass will also > typically own the custom view. > > Here's an example from the

NSDate scope

2009-06-20 Thread John Baldwin
This is mostly a curiosity. I've found a working solution by using time intervals, but still don't fully understand why my program would crash when I used dates. I declared a (NSDate *) in my .h file. NSDate *originalDate; Then in my init method, I initialized it to the current date. I trie

Re: Just implementing -isEqual:, never invoked, causes crash

2009-06-20 Thread Jerry Krinock
The problem is that the class for which I overrode -isEqual: is a managed object. According to NSManagedObject documentation, this "absolutely must not" be done. After I simplified my object graph, removing some of its entities relationships, I got a warning at runtime telling me about thi

Weird dyld loader crash

2009-06-20 Thread Erg Consultant
I suddenly started getting a weird loader crash when launching my app. Has anyone seen any errors similar to this one: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 0 Thread 0 Crashed: 0 ???

How to refresh detail view after [NSTreeController remove:sender]

2009-06-20 Thread Andy Triboletti
I'm using the SourceView example project which is an NSTreeController along with a detail view. I want to let the user remove the selected item in the treecontroller by clicking on a delete button. I am using NSTreeController remove:sender and the item is getting removed from the list, and the se

Cocoa and Computational Expense

2009-06-20 Thread syntonica
Hello All-- I am new to Cocoa (about 3 weeks now) and have not done much programming since the halcyon days of 16K RAM. Finishing up the main body of my program, I looked at what I have done and shivered. I have implemented a delegate method for "textDidChange" to handle a few things, includ

Re: Weird dyld loader crash

2009-06-20 Thread Andrew Farmer
On 20 Jun 2009, at 20:27, Erg Consultant wrote: I suddenly started getting a weird loader crash when launching my app. Has anyone seen any errors similar to this one: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x Crashed Thread: 0 Thr

Re: Cocoa and Computational Expense

2009-06-20 Thread Nathan
Kevin, I can't give definitive answers but I'll try. I'm fascinated with the history of computers, so while I didn't experience it I see where you're coming from. Yes, we do have much more resources available now. I think you're going to have to adjust to the fact that an identical app writ

Re: Cocoa and Computational Expense

2009-06-20 Thread Justin Carlson
How can I tell how computationally expensive a class or method is? I've never been this far from the metal. Is there a corpus somewhere listing this, or do programmers just know these things from their experience? Hi Kevin, I recommend running Shark for tasks really want to inspect. It i

Re: Cocoa and Computational Expense

2009-06-20 Thread Roland King
On Jun 21, 2009, at 1:50 PM, Justin Carlson wrote: Finally, on a side note and because this is my first OOP, just how big should a class get? Just as a rule of thumb. I have 700 lines and 50 methods in my MyDocument class and it seems positively bloated to me. It probably is too large