Re: NSWindowController for Prefs XIB Question (Core Data involved)

2010-05-21 Thread Quincey Morris
On May 20, 2010, at 20:08, Steve Cronin wrote: if (!prefPanelController) { prefPanelController = [[PreferencesController alloc] initWithWindowNibName:@testPref]; [prefPanelController setManagedObjectContext:[self managedObjectContext]]; } [prefPanelController

Re: NSWindowController for Prefs XIB Question (Core Data involved)

2010-05-21 Thread Steve Cronin
Folks; This one is driving me mad! I'm trying to bust up an overly complicated xib into 2 xibs - the main xib and a preference xib I've started completely over trying to implement a pref xib -- no CoreData just bare bones…. I have created a brand new subclass of NSWindowController:

Re: NSWindowController for Prefs XIB Question (Core Data involved)

2010-05-21 Thread Quincey Morris
On May 20, 2010, at 23:51, Steve Cronin wrote: I have created a brand new xib file: ptest XCode creates the xib with a FilesOwner, FirstResponder, Application, and Window (set to releaseOnClose and visibleAtLaunch) ... The new ptest.xib window will open once but never again if I close

Re: migrating CoreData data model doesn't work

2010-05-21 Thread Gustavo Pizano
Rainer hello. Have you created once again the ManagedObjects from the model?.. If so and you didn't remove the old ones, Xcode will start complaining A LOT (don't ask me why but it happened to me when I did it), then I realize I had to delete the old MO .m and .h files and generate again form

NSManagedObject subclass mysteriously notifies observers for non-modeled properties

2010-05-21 Thread David Hoerl
Before doing my latest project, I poured over the Model Object Implementation Guide and the NSManagedObject Class Reference. Both documents state categorically that NSManagedObjects do NOT automatically provide KVO notification unless one overrides +(BOOL)automaticallyNotifiesObserversForKey.

Re: scriptability of button in interface?

2010-05-21 Thread Dan Ribe
Hi All, I am working on to make my cocoa application scriptable. I want to automate the testing of my application and for that I want all the actions which user can performs manually to be scriptable. Like apple script should be able to open a dialog, type something in the text box (or any other

Re: NSManagedObject subclass mysteriously notifies observers for non-modeled properties

2010-05-21 Thread Mike Abdullah
What does +contextShouldIgnoreUnmodeledPropertyChanges return for your class? I am wondering if the two are interlinked. On 21 May 2010, at 13:24, David Hoerl wrote: Before doing my latest project, I poured over the Model Object Implementation Guide and the NSManagedObject Class Reference.

controlAlternatingRowBackgroundColors

2010-05-21 Thread Rick C.
Hello, Returning this method does exactly what I need in my NSTableView, but is there a way to use it somehow locally that it will not affect other areas of my project such as an NSOpenPanel? Thanks, rick___ Cocoa-dev mailing list

Re: NSManagedObject subclass mysteriously notifies observers for non-modeled properties

2010-05-21 Thread David Hoerl
On 5/21/10 9:10 AM, Mike Abdullah wrote: What does +contextShouldIgnoreUnmodeledPropertyChanges return for your class? I am wondering if the two are interlinked. This was an oversight on my part - this app is targeted at 10.5 (and thus uses the 10.5 SDK.) That Class method is not defined for

NSPrintInfo printSettings archiving

2010-05-21 Thread Gideon King
In the NSPrintInfo documentation, when talking about the printSettings, it says: Adding keys to the dictionary is equivalent to calling the Core Printing function PMPrintSettingsSetValue. Your new keys are added to the current print settings and are saved with any user preset files generated by

Re: Displaying NSPopUpButtonCells in NSTableView

2010-05-21 Thread Keary Suska
On May 20, 2010, at 3:28 PM, James Maxwell wrote: hmm... Well, I've tried returning the cell's selectedItem, indexOfSelectedItem, and also: [[inst MIDI_Inst_Ports] objectAtIndex:[ports indexOfSelectedItem]] (that is, the port name at indexOfSelectedItem). If I NSLog the [ports

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Vassilis Pantazis
Hello Nick, First of all thank you for your reply! My method has been monitoring the mem usage of the specified (and other calls) while in the debugger and trusting guard malloc for memory leaks. With this the mem allocated by the said call is instantly in the scale of tenths of MBs for just one

Re: NSPrintInfo printSettings archiving

2010-05-21 Thread Scott Ribe
You probably want to use [[self printInfo] dictionary] and then archive the dictionary however you want. -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Keary Suska
On May 20, 2010, at 9:37 PM, Nick Zitzmann wrote: On May 19, 2010, at 5:36 AM, Vassilis Pantazis wrote: Hello, I have in my code the following statement: NSDirectoryEnumerator* dirEnum; NSArray* inDirContents; dirEnum = [[NSFileManager defaultManager] enumeratorAtPath:inPath];

Re: iPhone/iPad: Desktop wallpaper can't be set.

2010-05-21 Thread Alex Kac
I never understand posts like this. If the app does it, and you don't want it, don't buy it. Some people may want it. I might want an app that creates fractal imagery and sets a wallpaper for me. I might want to be able to set a wallpaper of a screenshot of an app. In fact I get customers

Re: NSPrintInfo printSettings archiving

2010-05-21 Thread Gideon King
The dictionary method only returns standard attributes: (gdb) po [oldPrintInfo dictionary] { NSBottomMargin = 72; NSCopies = 1; NSDetailedErrorReporting = 0; NSFaxNumber = ; NSFirstPage = 1; NSHorizonalPagination = 0; NSHorizontallyCentered = 1; NSJobDisposition =

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Paul Sanders
Also be aware that just because memory is released, doesn't mean it is returned to the system (e.g. you will not see your apps memory usage go down in Activity Monitor). In fact, AFAIK, it is never returned to the system, except perhaps in low memory situations. I don't actually think

Re: NSWindowController for Prefs XIB Question (Core Data involved)

2010-05-21 Thread Keary Suska
On May 21, 2010, at 12:09 AM, Quincey Morris wrote: On May 20, 2010, at 20:08, Steve Cronin wrote: if (!prefPanelController) { prefPanelController = [[PreferencesController alloc] initWithWindowNibName:@testPref]; [prefPanelController setManagedObjectContext:[self

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Keary Suska
On May 21, 2010, at 9:18 AM, Paul Sanders wrote: Also be aware that just because memory is released, doesn't mean it is returned to the system (e.g. you will not see your apps memory usage go down in Activity Monitor). In fact, AFAIK, it is never returned to the system, except

Re: Calling allObjects memory allocation problem

2010-05-21 Thread Jean-Daniel Dupas
Le 21 mai 2010 à 17:54, Keary Suska a écrit : On May 21, 2010, at 9:18 AM, Paul Sanders wrote: Also be aware that just because memory is released, doesn't mean it is returned to the system (e.g. you will not see your apps memory usage go down in Activity Monitor). In fact, AFAIK, it is

Re: iPhone/iPad: Desktop wallpaper can't be set.

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 7:52 AM, Alex Kac a...@webis.net wrote: Don't limit the users just because you don't want something. Its not being forced. One of the best things about the Mac ecosystem is that developers are willing to stand up to users. Otherwise you wind up with kitchen-sink

Re: iPhone/iPad: Desktop wallpaper can't be set.

2010-05-21 Thread Alex Kac
In many ways true. This is not one of them. I can see many valid reasons to do this. On May 21, 2010, at 11:13 AM, Kyle Sluder wrote: On Fri, May 21, 2010 at 7:52 AM, Alex Kac a...@webis.net wrote: Don't limit the users just because you don't want something. Its not being forced. One of

NSWindow dataWithEPSInsideRect: giving error on 10.5

2010-05-21 Thread David Alter
I have a NSWindow that when I call dataWithEPSInsideRect: on it, I get the following error appearing in the Console. Error: CMSStreamPSDefinition : CMGetPS2ColorSpace: returned -4200 I only get the error if it is running on 10.5. It works great on 10.6 What I'm trying to do is create an image

NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
I find it disgusting that the doc section for NSXMLParser initWithData takes binary data, but doesn't tell you which encoding it's supposed to be? Link:

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Keary Suska
On May 21, 2010, at 10:39 AM, Patrick Rutkowski wrote: I find it disgusting that the doc section for NSXMLParser initWithData takes binary data, but doesn't tell you which encoding it's supposed to be? Link:

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 9:39 AM, Patrick Rutkowski rutsk...@gmail.com wrote: I find it disgusting that the doc section for NSXMLParser initWithData takes binary data, but doesn't tell you which encoding it's supposed to be? Link:

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
Milder tone? No thanks. Any API that accepts binary data needs to give at least a hint as to what format the binary data should be. Saying that just it accepts data is disgusting. Period, end of argument. Actually, maybe there is one more thing to be said: Perhaps if the class is something

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread David Duncan
On May 21, 2010, at 10:23 AM, Patrick Rutkowski wrote: Any API that accepts binary data needs to give at least a hint as to what format the binary data should be. Saying that just it accepts data is disgusting. Period, end of argument. The problem is that XML specifies the text encoding

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 10:23 AM, Patrick Rutkowski rutsk...@gmail.com wrote: Milder tone? No thanks. Awfully strong words from someone who waltzes onto a mailing list, lambastes the documentation, and admits in the very next sentence he has no idea what he's talking about. Any API that

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
I really hope you're joking. Do you really not see that it's completely non-obvious if it's supposed to be UTF-8 or UTF-16? -Patrick On May 21, 2010, at 1:31 PM, Gary L. Wade wrote: The name of the class makes it pretty obvious to everyone that the data is XML. On 05/21/2010 10:23 AM,

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread Troy Stephens
Hi Kyle, On May 20, 2010, at 12:12 PM, Kyle Sluder wrote: On Thu, May 20, 2010 at 9:52 AM, Kyle Sluder kyle.slu...@gmail.com wrote: I have uploaded a sample project to http://www.lanechng.com/ScrolledLayerHostingView.zip. Resize the window to see the problem in action; then click one of the

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread David Duncan
On May 21, 2010, at 10:37 AM, Troy Stephens wrote: By the way: I don't know whether CAGradientLayer disregards -setNeedsDisplay (since the layer renders its content programmatically), possibly making this irrelevant in practice, but in cases like this, where you provide a layer of your own

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Gary L. Wade
You can read more about the XML spec here: http://www.w3.org/standards/xml/ Citing your other example, the PNG specification is here: http://www.w3.org/TR/PNG/ From the documentation, you can learn how the character set is specified in XML and how PNG data is stored, be that in 24-bit,

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
On May 21, 2010, at 1:31 PM, Kyle Sluder wrote: On Fri, May 21, 2010 at 10:23 AM, Patrick Rutkowski rutsk...@gmail.com wrote: Milder tone? No thanks. Awfully strong words from someone who waltzes onto a mailing list, lambastes the documentation, and admits in the very next sentence he

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Patrick Rutkowski
On May 21, 2010, at 1:29 PM, David Duncan wrote: On May 21, 2010, at 10:23 AM, Patrick Rutkowski wrote: Any API that accepts binary data needs to give at least a hint as to what format the binary data should be. Saying that just it accepts data is disgusting. Period, end of argument.

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 10:37 AM, Troy Stephens tsteph...@apple.com wrote: CALayers don't support the same notion of flippedness that NSView's geometry model uses.  (CALayer's geometryFlipped property is recursive in its effect, so isn't semantically identical.) Hmm. Perhaps instead of using

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread Troy Stephens
On May 21, 2010, at 10:52 AM, Kyle Sluder wrote: On Fri, May 21, 2010 at 10:37 AM, Troy Stephens tsteph...@apple.com wrote: CALayers don't support the same notion of flippedness that NSView's geometry model uses. (CALayer's geometryFlipped property is recursive in its effect, so isn't

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 11:06 AM, Troy Stephens tsteph...@apple.com wrote: You can use geometryFlipped on your documentView's layer for this purpose, if and only if your documentView isn't going to have any subviews.  If you control all the content (build it out of your own layers) from there

Core data model persistence, independent of document

2010-05-21 Thread James Maxwell
Looking over the type of model I want to build for my music app, I realized that perhaps Core Data would be a good way to manage it. The reason being that I want an arbitrary number of Instruments, each of which has a MIDI port, channel, and an arbitrary number of Articulations. The total set

Re: NSXMLParser initWIthData - Encoding?

2010-05-21 Thread Scott Anguish
On May 21, 2010, at 1:52 PM, Patrick Rutkowski wrote: When docs are bad, and I'm frustrated, I might throw out a mild pejorative; it's a reflex, sorry :-/ You were warned by an Apple employee (David Duncan) that your tone wasn’t going to get you help. Behavior on the list is expected to

Re: migrating CoreData data model doesn't work

2010-05-21 Thread Hal Mueller
MOGenerator (from Wolf Rentzsch) is one solution to this problem. It uses one file for human-written custom code, another file for machine-generated boilerplate code. http://github.com/rentzsch/mogenerator Hal On May 21, 2010, at 4:53 AM, Gustavo Pizano wrote: Now if you have custom methods

Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread K . Darcy Otto
I'm working on a feature that will see my program automatically export to a UTF-8 text file. This process works fine. What doesn't work fine is that TextEdit.app (and others) does not recognise it automatically as a UTF-8 text file, even when Plain Text Encoding: Opening Files: (in

Re: Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread Gus Mueller
On May 21, 2010, at 12:42 PM, K.Darcy Otto wrote: [textStream appendFormat:@%C%C%C,0x00EF,0x00BB,0x00BF]; // textStream is an empty NSMutableString that gets added to, and then written to a file How are you writing the string to a file? Are you using NSString's writeToFile:atomically:?

Re: Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread Sixten Otto
On Fri, May 21, 2010 at 3:42 PM, K.Darcy Otto do...@csusb.edu wrote: I've tried prefacing the text file with a BOM in this way: You may well already know this, and that may be something you're attempting out of desperation, but: The endian order entry for UTF-8 in Table 2-4 is marked N/A

Re: migrating CoreData data model doesn't work

2010-05-21 Thread Gustavo Pizano
Hehee,, it makes me remember EOVelocity .. or the Wonder generators from WebObjects On 21.5.2010, at 20:54, Hal Mueller wrote: MOGenerator (from Wolf Rentzsch) is one solution to this problem. It uses one file for human-written custom code, another file for machine-generated boilerplate

Re: Getting TextEdit to Recognise UTF-8 Output

2010-05-21 Thread Greg Guerin
K.Darcy Otto wrote: Question: Is there any header I can put at the beginning of the text file to get it automatically recognised as UTF-8? It's not a header, but there is the com.apple.TextEncoding xattribute. See post #4 in the following thread:

Forcing NSImage to cache images at certain sizes

2010-05-21 Thread B.J. Buchalter
I read the NSImage and Cocoa drawing guide docs, which tends to indicate that calling drawInRect:fromRect:operation:fraction: on an NSImage will cause it to create a cached image rep that matches the scaled image so that the next time it is drawn it does not need to be scaled again. That

Re: Layer-hosting views and layer-backed scroll views

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 11:06 AM, Troy Stephens tsteph...@apple.com wrote: Sure.  Let us know if you run into further difficulty with this. Unfortunately I have indeed hit more difficulty. I've attached an updated demo project to the Radar as well as uploaded it to

Compatibility of Data iPhone / Mac

2010-05-21 Thread Eiko Bleicher
When transferring data between Mac and iPhone/iPad, serializing via NSKeysedArchiver seems simple and easy. Wrapping up some trivial Objects like NSData, NSDictionary, NSNumber, NSString seems to work. But the question is: is it considered safe to transfer data like that? How likely is this

Re: Compatibility of Data iPhone / Mac

2010-05-21 Thread Kyle Sluder
On Fri, May 21, 2010 at 4:35 PM, Eiko Bleicher bleic...@k4it.de wrote: When transferring data between Mac and iPhone/iPad, serializing via NSKeysedArchiver seems simple and easy. Wrapping up some trivial Objects like NSData, NSDictionary, NSNumber, NSString seems to work. But the question

Re: Forcing NSImage to cache images at certain sizes

2010-05-21 Thread Ken Ferry
Hi BJ, On Fri, May 21, 2010 at 2:44 PM, B.J. Buchalter b...@mhlabs.com wrote: I read the NSImage and Cocoa drawing guide docs, which tends to indicate that calling drawInRect:fromRect:operation:fraction: on an NSImage will cause it to create a cached image rep that matches the scaled image so

Re: Getting TextEdit to Recognise UTF-8 Output [solved]

2010-05-21 Thread Darcy Otto
Bingo. Completely and utterly solved. Thanks Gus! I was writing to the file with: [[textStream dataUsingEncoding:NSUTF8StringEncoding] writeToFile:[sheet filename] atomically:YES]; Now, I'm writing with: [textStream writeToFile:[sheet filename] atomically:YES encoding:NSUTF8StringEncoding

PopupButton image scaling

2010-05-21 Thread Trygve Inda
I have a popup button in either the square or gradient style with an image of NSActionTemplate. I set the image scaling to proportionally down, and in IB it looks fine, but when I run the app, the image is completely filling the button, instead of a nice small image. Any Ideas? Trygve

Re: Core data model persistence, independent of document

2010-05-21 Thread Jerry Krinock
On 2010 May 21, at 11:30, James Maxwell wrote: I built a model that seems about right, to me, but I can't seem to bind it to anything I don't know how you bind it [a model]. The only thing which you can bind are bindings. Admittedly, the terminology is very confusing and the word binding