Re: Frame rate check

2008-06-03 Thread Davide Scheriani
yes I was looking just to see the times draawREct get called. is it a weay to set a limit framerate as well? mean 25fps or to ask from the cpu/gpu 120fps? Depends what you mean by "frame rate". The number of times drawRect: is called per second? Easy to calculate/present but is it useful? G.

Re: How to implement window fade-in fade-out effects

2008-06-03 Thread Brian Christensen
On Jun 4, 2008, at 2:01 , Markus Spoettl wrote: Hello List, I need someone to push me in the right direction as I have no idea where to start: I have an existing window which I'd like to show and hide using a zooming transition effect. I'd like something similar to the one in iCal (on

How to implement window fade-in fade-out effects

2008-06-03 Thread Markus Spoettl
Hello List, I need someone to push me in the right direction as I have no idea where to start: I have an existing window which I'd like to show and hide using a zooming transition effect. I'd like something similar to the one in iCal (on Leopard) when you double click a calendar entry o

Re: IBOutlet, multiple nibs, method duplication

2008-06-03 Thread Andrew Merenbach
On Jun 3, 2008, at 2:48 PM, Trygve Inda wrote: Hi, Trygve, With regard to your code duplication, I would use a common NSWindowController superclass, with a subclass for your main window and a subclass for your aux window. Then you can just use the right nib name in each of them, but leave the

Re: DTrace probe problem

2008-06-03 Thread radj
> > I'm not sure I understand what you're asking. Are you looking for the > dtrace:::BEGIN probe? If you put an action on that, it's executed when > DTrace starts tracing. > This is exactly what I'm looking for. Thanks again! :) ___ Cocoa-dev mailing

totally confused by bindings settings

2008-06-03 Thread Daniel Child
I worked out a super basic bindings case where table columns display the ivars of a Word class via bindings. Words have three ivars with standard accessors. An ArrayController manages a table of these words, with appropriate bindings between the columns and ivars. It works as expected. So f

Re: NSObjectController needless in "Intro to Bindings"?

2008-06-03 Thread David Carlisle
I'm looking forward to reading the chapter "Application Kit Support for Controller Subsystems" in Erik Buck's forthcoming book "Cocoa Design Patterns" to get a clearer understanding of the use of NSObjectController, etc. On Jun 3, 2008, at 7:59 PM, Ken Thomases wrote: On Jun 3, 2008, at 6

Re: Frame rate check

2008-06-03 Thread Ken Ferry
You'll be capped at 60 fps unless you turn off beam sync in Quartz Debug. And Quartz Debug can report frame rate, as Ken mentioned. -Ken On Tue, Jun 3, 2008 at 8:19 PM, Paul Bruneau <[EMAIL PROTECTED]> wrote: > On Jun 3, 2008, at 5:28 PM

10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing

2008-06-03 Thread Jerry Krinock
I use an NSOutlineView. I have implemented an action, myAction, which is targetted by a main menu item, which is in turn assigned the keyboard shortcut cmd+upArrow. In some situations, myAction is not allowed, so -validateMenuItem: in my window controller subclass returns NO. I see that -

Re: Manipulating images with meta-data

2008-06-03 Thread Ken Ferry
Can we see the code you're using to write the CGImage to the CGImageDestination? I suspect the difficulty may be that you expect the metadata to be carried with the CGImage. It isn't: You can get all the metadata with CGImageSourceCopyPropertiesAtIndex, then you need to turn around and pass meta

Use text system or totally custom text view?

2008-06-03 Thread R . Matthew Emerson
I work on a Common Lisp system (). The lisp has an Objective-C bridge, and there's a more-than-a-demo Cocoa IDE for it, though it is pretty rough around the edges in places. An important part of the IDE is the editor. We're currently using an emacs-like e

Re: DTrace probe problem

2008-06-03 Thread Ken Thomases
On Jun 3, 2008, at 9:48 PM, radj wrote: It can. There's an action, raise(int signal), that may be used in a DTrace clause. This action is considered "destructive", so you have to pass the -w option to the "dtrace" command. This is good! But since D script are made out of probes, is it

Re: Opening column for edit after adding to tree controller?

2008-06-03 Thread Rick Mann
On Jun 3, 2008, at 20:15:45, Rick Mann wrote: ARGGHHHit works very well (thanks, j o a r!). I failed to connect my view outlet, like a total n00b. Oh wait, that's what I am. AGH, again. It still doesn't work, but now itemForRow always returns -1. -- Rick __

Re: My windows don't cascade

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 8:40 PM, Boyd Collier <[EMAIL PROTECTED]> wrote: > Although everything now works as I think it should, the fact that it didn't > work correctly when I used Apple's sample code makes me very nervous; have I > misunderstood something, or... ?? It is an unwritten assumption tha

Re: Frame rate check

2008-06-03 Thread Paul Bruneau
On Jun 3, 2008, at 5:28 PM, Davide Scheriani wrote: hi, I wanted to do a small frame rate check to see on my nsview as debug output. How can I do this? tnx I made an NSDate ivar in the view. At the start of drawRect I stored the current time in it. At the end of drawRect I subtracted that

Re: CoreData file format stability

2008-06-03 Thread Jason Coco
On Jun 3, 2008, at 23:03 , Michael Ash wrote: On Wed, Jun 4, 2008 at 12:48 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: This is extremely unlikely to occur in practice. Apple is sensible enough to, in these sorts of circumstances, make these changes depending on which SDK you're compiling agai

Re: Opening column for edit after adding to tree controller?

2008-06-03 Thread Rick Mann
On May 31, 2008, at 14:39:29, Rick Mann wrote: I am targeting Leopard (for now, at least). However, -rowForItem:, and for that matter, -itemForRow: both return null, even if I fetch first. ARGGHHHit works very well (thanks, j o a r!). I failed to connect my view outlet, like a tota

Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 10:45 PM, Frederick C. Lee <[EMAIL PROTECTED]> wrote: > I need to send data through the mail from within my Cocoa program. This is > to be for general release; so it must be stable. Why has every single person under the sun decided that they now need to send mail using Coco

Re: CoreData file format stability

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 11:03 PM, Michael Ash <[EMAIL PROTECTED]> wrote: > Note that silently upgrading files when opening is the last thing > you'd want in this case. A file saved using FooApp 1.2 on 10.6 should > still work in FooApp 1.2 on 10.5. If you destroy my files so that they > no longer wo

Versioning MainMenu.nib

2008-06-03 Thread Chris Outwin
I have MainMenu.nib and MainMenu(Debug).nib in a Cocoa document app using Xcode 3.0. The (Debug)version has controls only used during development. I am trying to use build settings to dynamically load the MainMenu(Debug).nib when PreprocessorMacros has a value associated with the debug co

Re: CoreData file format stability

2008-06-03 Thread Michael Ash
On Wed, Jun 4, 2008 at 12:48 AM, Kyle Sluder <[EMAIL PROTECTED]> wrote: > On Tue, Jun 3, 2008 at 12:01 PM, Charles Srstka > <[EMAIL PROTECTED]> wrote: >> It also >> means that even for a Mac-only app you could end up with this really weird >> situation where an app running on a later version of OS

Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-03 Thread Nick Zitzmann
On Jun 3, 2008, at 8:45 PM, Frederick C. Lee wrote: So what does Apple intend us to use as the replacement? I've scanned the discussion groups and I haven't found a consensus yet. I would prefer to use an Apple or framework. Good luck with that; there aren't any. Use the Scripting Br

Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-03 Thread Scott Anguish
there is o apple provided solution for this at the moment. others will likely point you to the Pantomime project.. have a search for that. On Jun 3, 2008, at 10:45 PM, Frederick C. Lee wrote: I need to send data through the mail from within my Cocoa program. This is to be for general rel

Re: DTrace probe problem

2008-06-03 Thread radj
> It can. There's an action, raise(int signal), that may be used in a DTrace > clause. This action is considered "destructive", so you have to pass the -w > option to the "dtrace" command. > This is good! But since D script are made out of probes, is it possible to use raise() when dtrace comman

Re: DTrace probe problem

2008-06-03 Thread radj
> It can. There's an action, raise(int signal), that may be used in a DTrace > clause. This action is considered "destructive", so you have to pass the -w > option to the "dtrace" command. > This is good! But since D script are made out of probes, is it possible to use raise() when dtrace comman

What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-03 Thread Frederick C. Lee
I need to send data through the mail from within my Cocoa program. This is to be for general release; so it must be stable. NSMailDelivery appear to be a candidate; unfortunately it's deprecated in Leopard+. So what does Apple intend us to use as the replacement? I've scanned the discussion

Re: Best Practice for Returning Immutable Objects?

2008-06-03 Thread Michael Ash
On Wed, Jun 4, 2008 at 3:07 AM, Seth Willits <[EMAIL PROTECTED]> wrote: > On Jun 3, 2008, at 9:15 AM, j o a r wrote: > >>> Would it be sufficient to cast, like this? >>>: >>>return (NSData *)myData; >>> >>> Does this generalize to other non-collection classes, e.g., NSString? >> >>

Re: [SOLVED] Code to convert NSDictionary to binary plist file?

2008-06-03 Thread Ken Thomases
On Jun 3, 2008, at 8:49 PM, David Hoerl wrote: ret = [manager createFileAtPath:@"/tmp/binary.plist" contents:plist attributes:nil]; You can also do [plist writeToFile:...] to write the data object out. There's nothing wrong with what you wrote, but since you were already familiar with

Re: NSObjectController needless in "Intro to Bindings"?

2008-06-03 Thread Ken Thomases
On Jun 3, 2008, at 6:25 PM, Jochen Moeller wrote: Both versions run identical, so my question: Are both approaches equivalent and the NSObjectController is not really needed or is there a reason/advantage to hook the NSObjectController between MyController and the NSArrayController ? See t

Re: Frame rate check

2008-06-03 Thread Ken Thomases
On Jun 3, 2008, at 4:28 PM, Davide Scheriani wrote: I wanted to do a small frame rate check to see on my nsview as debug output. How can I do this? Depending on what you're actually looking for, you might have a look at Quartz Debug.app (in /Developer/Applications/Graphics Tools). From

[SOLVED] Code to convert NSDictionary to binary plist file?

2008-06-03 Thread David Hoerl
I never did get a pointers to code to convert a NSDictionary to a binary formatted plist, but did get pointers to look at NSPropertyListSerialization - something I had already (mis)read a few times. The description for the dataFromPropertyList class method seems confusing if you don't underst

Re: Manipulating images with meta-data

2008-06-03 Thread Ken Thomases
On Jun 3, 2008, at 12:14 PM, Randall Meadows wrote: I'm about to resort to using a third-part solution (jpegtran and jpegexiforient) that I've found, but Shirley, I must be missing something in the Cocoa/Carbon/Foundation/whatever frameworks that would make my life a lot simpler. Am I righ

Re: Strange Error

2008-06-03 Thread Graham Cox
This is a link error. Add the QuartzCore framework to your project. G. On 4 Jun 2008, at 11:15 am, Gabriel Shahbazian wrote: I am getting this error: Undefined symbols: ".objc_class_name_CALayer", referenced from: [EMAIL PROTECTED]@[EMAIL PROTECTED] in myController.o ld: symbol(s) not

Re: Key-Value pairs

2008-06-03 Thread Graham Cox
A good concrete example is the 'frame' property of CALayer. It is calculated from other known values, and is not an ivar. G. On 4 Jun 2008, at 11:05 am, Ken Thomases wrote: The important thing to think about is "properties" and what they are. Properties are _not_ the ivars. ___

Re: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-03 Thread Nick Zitzmann
On Jun 3, 2008, at 7:25 PM, Steven Moore wrote: It looks like most of the calls are coming from [NSArray indexOfObjectIdenticalTo:], half of which are from [NSSubTextStorage release] and [NSTextStorage removeLayoutManager:]. I'm not exactly sure why, as I didn't think I was directly touchi

Re: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-03 Thread Steven Moore
It looks like most of the calls are coming from [NSArray indexOfObjectIdenticalTo:], half of which are from [NSSubTextStorage release] and [NSTextStorage removeLayoutManager:]. I'm not exactly sure why, as I didn't think I was directly touching the layout manager.. is it being re-created ev

Re: CoreData file format stability

2008-06-03 Thread Nick Zitzmann
On Jun 3, 2008, at 7:18 PM, Ilan Volow wrote: But for the long term, the mac development community outside of Apple really needs to come up with their own ORM/persistance framework that can target a number of difference storage technologies (PostgreSQL, MySQL, SQLite), and provides adequat

Re: how to run my app in privileged mode

2008-06-03 Thread Charles Srstka
On Jun 3, 2008, at 2:08 PM, Jean-Daniel Dupas wrote: Note that you should never run a GUI application with elevated provilege, particulary an application that uses AppKit, this is EVIL. Just to explain a bit *why* this is evil and why you absolutely should not do this, here's a little demon

Strange Error

2008-06-03 Thread Gabriel Shahbazian
I am getting this error: Undefined symbols: ".objc_class_name_CALayer", referenced from: [EMAIL PROTECTED]@[EMAIL PROTECTED] in myController.o ld: symbol(s) not found collect2: ld returned 1 exit status and not sure what it means and how I can fix it (I'm new to Cocoa). Any help greatly

Re: CoreData file format stability

2008-06-03 Thread Ilan Volow
I'd suggest you check out QuickLite http://www.webbotech.com/ for the time being. But for the long term, the mac development community outside of Apple really needs to come up with their own ORM/persistance framework that can target a number of difference storage technologies (PostgreSQL,

Re: DTrace probe problem

2008-06-03 Thread Ken Thomases
On Jun 1, 2008, at 9:31 PM, Bill Bumgarner wrote: On Jun 1, 2008, at 7:19 PM, radj wrote: I can try that. Sounds like a good idea. Make the "waiting for the signal" the first thing the driver will do. but how do you send a signal from within DTrace to a specific process? I have no idea if

Re: Key-Value pairs

2008-06-03 Thread Ken Thomases
Others have addressed your concern about automated generation of accessors to relieve the programmer of that drudgery. I'd like to address something else... On Jun 2, 2008, at 4:30 PM, john darnell wrote: To refresh everyone's memory, key-value coding is the convention that says for ever

Re: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-03 Thread Nick Zitzmann
On Jun 3, 2008, at 6:43 PM, Steven Moore wrote: I'm trying to use an NSTextView to display the output of a shell script, but when my script outputs too much data, too quickly (on the order of a dozen lines nearly simultaneously), my app gives up with a pinwheel. I'm using an NSPipe to get

NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-03 Thread Steven Moore
I'm trying to use an NSTextView to display the output of a shell script, but when my script outputs too much data, too quickly (on the order of a dozen lines nearly simultaneously), my app gives up with a pinwheel. I'm using an NSPipe to get the data, readInBackgroundAndNotify to know when

Re: My windows don't cascade

2008-06-03 Thread Boyd Collier
A couple of months ago, I too had this problem, but didn't satisfactorily solve it at that time. As my original posting noted, this change in behavior happened after upgrading to Leopard and Xcode 3.0. The recent posting by Stefan Haller prompted me to spend some time trying to figure out

Re: Core Data merge and "statement is still active" error?

2008-06-03 Thread Michael Link
On Jun 3, 2008, at 5:52 PM, Ben Trumbull wrote: Michael, This error is almost always a multi-threading problem. When you used the _debug version of Core Data, did you enable the threading assertions with the user default -com.apple.CoreData.ThreadingDebug 3 ? Yes, I also see this in t

Re: timing of showing a window and setting display attributes of controls on that window

2008-06-03 Thread Randall Meadows
On Jun 3, 2008, at 6:06 PM, Stuart Malin wrote: I have a window with a few NSTextFields. The window has a controller (sub class of NSWindowController). The window is loaded from a Nib. I set the stringValue of the NSTextFields using the -setStringValue. I tried doing this before showing the

Re: set up multiple columns in NSTableView

2008-06-03 Thread Nick Zitzmann
On Jun 3, 2008, at 5:47 PM, Wayne Shao wrote: There is no way to use clicking to access the 2nd column. I use "Tool" --> "Select Next Sibling" to gain access to the inspector for the 2nd column and specified the identifier. However, the UI only shows 1 column. This is true in IB and the

IB Plugin Exchange / Apple Pro Apps Elements?

2008-06-03 Thread Brad Gibbs
Is there an IB 3.0 plugin exchange I haven't been able to find through Google? Some place where developers could share or trade IB plugins they've built? Specifically, I'm looking for the darker look-and-feel of Apple's Pro apps, like Aperture and MainStage from Logic Studio, in particular

timing of showing a window and setting display attributes of controls on that window

2008-06-03 Thread Stuart Malin
I have a window with a few NSTextFields. The window has a controller (sub class of NSWindowController). The window is loaded from a Nib. I set the stringValue of the NSTextFields using the -setStringValue. I tried doing this before showing the window:[super showWindow:self]; I moved the -sh

Re: many-to-many relationships and retain cycles

2008-06-03 Thread Ken Thomases
On Jun 2, 2008, at 11:12 AM, Todd Ransom wrote: Has anyone out there created a non-retaining array class or come up with another solution to this problem? Or is there anything in particular I should watch out for when subclassing NSMutableArray? Probably the non-retaining CFArray that other

Re: CoreData file format stability

2008-06-03 Thread Charles Srstka
Thank you for your feedback. On Jun 3, 2008, at 5:34 PM, Ben Trumbull wrote: 1) The file format for saved files. I'd rather not make some proprietary/closed Microsoft-ish thing - I'd like it to be possible for other programs to read/write my file format, including hypothetical programs that mig

set up multiple columns in NSTableView

2008-06-03 Thread Wayne Shao
In IB, I set the number of columns to 2 in NSTableView. Then I was able to select the NSTableColumn by clicking on the view. I changed the identifier for the column There is no way to use clicking to access the 2nd column. I use "Tool" --> "Select Next Sibling" to gain access to the inspector for

NSObjectController needless in "Intro to Bindings"?

2008-06-03 Thread Jochen Moeller
Greetings! Here my 1st question to this list :-) I started with Bindings and worked through the great article "Introduction to Cocoa Bindings" by Scott Stevenson. All works fine as expected even when I delete the NSObjectController "ControllerA

Re: Apple Remote and exclusivity

2008-06-03 Thread Scott Anguish
On Jun 3, 2008, at 5:02 AM, Hamish Allan wrote: I don't even know what the Cocoa interface to the Apple Remote is, let alone having used it, let alone being able to troubleshoot it, and I don't imagine everyone here is an expert either... I don't believe there is a public API for it. __

Re: Frame rate check

2008-06-03 Thread Graham Cox
Depends what you mean by "frame rate". The number of times drawRect: is called per second? Easy to calculate/present but is it useful? G. On 4 Jun 2008, at 7:28 am, Davide Scheriani wrote: hi, I wanted to do a small frame rate check to see on my nsview as debug output. How can I do this?

re: Core Data merge and "statement is still active" error?

2008-06-03 Thread Ben Trumbull
Michael, This error is almost always a multi-threading problem. When you used the _debug version of Core Data, did you enable the threading assertions with the user default -com.apple.CoreData.ThreadingDebug 3 ? What version of OSX are you using ? Is there a reason you're not using Cor

re: CoreData file format stability

2008-06-03 Thread Ben Trumbull
1) The file format for saved files. I'd rather not make some proprietary/closed Microsoft-ish thing - I'd like it to be possible for other programs to read/write my file format, including hypothetical programs that might get written for other platforms so that my file format could possibly be read

Re: File still in use after closing document window

2008-06-03 Thread Bill Bumgarner
On Jun 3, 2008, at 2:06 PM, Antonio Nunes wrote: On Jun 3, 2008, at 5:52 PM, Bill Bumgarner wrote: Why can't you pause the program in Xcode? Because it is running in Instruments? Yes, I could find no way to pause it after Start with Performance Tool->Leaks (or Object Allocations for that mat

Re: Copying NSTextStorage

2008-06-03 Thread Alastair Houghton
On 3 Jun 2008, at 19:19, Ross Carter wrote: First I will echo what Jens has said: there's a strong probability that NSAttributedString or NSMutableAttributedString will do what need. NSTextStorage adds two capabilities to NSMutableAttributedString: it communicates with one or more NSLayou

Re: IBOutlet, multiple nibs, method duplication

2008-06-03 Thread Trygve Inda
> Hi, Trygve, > > With regard to your code duplication, I would use a common > NSWindowController superclass, with a subclass for your main window > and a subclass for your aux window. Then you can just use the right > nib name in each of them, but leave the rest of the code identical. > > Cheer

Re: Get and set "Auto adjust brightness when ambient light changes" preferences

2008-06-03 Thread Gabriel ROUSSEAU
BezelServices does what you say, but not only ! It seems to also manage the ALS preferences. In the com.apple.BezelServices.plist you can see preferences concerning ALS behavior on the keyboard backlight and the display brightness, like : – alsLGPVersion – dAuto (display auto birghtness from

Re: The KVO Race

2008-06-03 Thread Gordon Apple
OK, if I understand the documentation correctly, the first suggestion might work. Thanks. I don't think the second one is applicable here. (I have used that successfully within one class.) Yes, the observed editLayer in displayController was being observed by the displayEditcontroll

Frame rate check

2008-06-03 Thread Davide Scheriani
hi, I wanted to do a small frame rate check to see on my nsview as debug output. How can I do this? tnx ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: IBOutlet, multiple nibs, method duplication

2008-06-03 Thread Andrew Merenbach
Hi, Trygve, With regard to your code duplication, I would use a common NSWindowController superclass, with a subclass for your main window and a subclass for your aux window. Then you can just use the right nib name in each of them, but leave the rest of the code identical. Cheers,

IBOutlet, multiple nibs, method duplication

2008-06-03 Thread Trygve Inda
Hi All, Sorry for the vague subject title... Let me explain. I have one window per attached screen so at least one, but perhaps 3 (for example). There is always one "main" window and the others are considered "aux windows". The Main window has 4 groups of controls (A, B, C, D). The Aux windows h

Re: Apple Remote and exclusivity

2008-06-03 Thread Ilan Volow
There's been some changes to device seizing in Leopard. I've had some code of my own (albeit keyboard/barcode scanner stuff) that's been affected by it. http://developer.apple.com/technotes/tn2007/tn2187.html I'd think that the Apple remote wouldn't be affected (unless it's being interpret

Re: Manipulating images with meta-data

2008-06-03 Thread Heinrich Giesen
On 03.06.2008, at 21:00, Randall Meadows wrote: I'm about to resort to using a third-part solution (jpegtran and jpegexiforient) that I've found, but Except that I'm not going to be able to use jpegexiforient, because the image file apparently isn't in the correct form it wants. This test

Re: File still in use after closing document window

2008-06-03 Thread Antonio Nunes
On Jun 3, 2008, at 5:52 PM, Bill Bumgarner wrote: Why can't you pause the program in Xcode? Because it is running in Instruments? Yes, I could find no way to pause it after Start with Performance Tool- >Leaks (or Object Allocations for that matter). But then I realised I should attach the

Re: [Moderator] Re: Leopard (10.5+): Any Upper-Level (Cocoa) access to Mail?

2008-06-03 Thread Ilan Volow
Just out of curiosity, what exactly was the rational behind Apple deprecating NSMailDelivery? -- Ilan On Jun 2, 2008, at 2:53 PM, Scott Anguish wrote: This question has been asked three or four times in the last week. A search of the list archives would have determined how to do that. In

Re: NSTextView programmatically apply smart quotes?

2008-06-03 Thread Douglas Davidson
On Jun 3, 2008, at 12:53 PM, Mark Munz wrote: Is the smart quotes functionality only applied to typed in text (by the user) or is there a way to apply it to text programmatically (as in text pasted in or after a NSTextView contents are set)? It appears to do some unique localized/contextual qu

Re: The KVO Race

2008-06-03 Thread Keith Duncan
I have traced the problem to KVO race conditions. In most cases these can be solved by setting up the key dependencies and occasionally by using the NSKeyValueObservingOptionInitial (Leopard only) option. From your summary, I'm assuming that the editLayer property is dependent on the NSI

Core Data merge and "statement is still active" error?

2008-06-03 Thread Michael Link
The goal is to do insertions/changes/deletes on a background thread and then after a save merge those changes into the main threads managed object context and thus update the UI. I have a situation where NSManagedObjectContextDidSaveNotification is forwarded from a background thread's manag

Re: Alert Sheets hard wired in Interface Builder

2008-06-03 Thread John Love
Thank you everyone ... I went back to Apple Docs on Sheets and found everything you stated ... I apologize for not being a careful reader. John Love ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator c

Re: Best Practice for Returning Immutable Objects?

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 3:07 PM, Seth Willits <[EMAIL PROTECTED]> wrote: > I used to think that. Now I'm converting to making sure it truly is > returning an immutable object. There have been cases where I've changed it > under myself and run into problems. I figure if it says it's immutable, it'd >

Re: Copying NSTextStorage

2008-06-03 Thread Kyle Sluder
On Tue, Jun 3, 2008 at 2:19 PM, Ross Carter <[EMAIL PROTECTED]> wrote: > Kyle, AFAICT, NSTextStorage is the only Cocoa class deemed "semiconcrete." I > guess it means that you can instantiate NSTextStorage objects as if they > were concrete, but you can't subclass them without special effort. Maybe

Re: Code to convert NSDictionary to binary plist file?

2008-06-03 Thread mmalc crawford
On Jun 3, 2008, at 12:46 PM, Jens Alfke wrote: On 3 Jun '08, at 12:24 PM, David Hoerl wrote: Am I missing something obvious? Is there code out there that can take a dictionary and save it as a binary plist? NSPropertyListSerialization. (Everyone overlooks this at first because it's unexpecte

NSTextView programmatically apply smart quotes?

2008-06-03 Thread Mark Munz
Is the smart quotes functionality only applied to typed in text (by the user) or is there a way to apply it to text programmatically (as in text pasted in or after a NSTextView contents are set)? It appears to do some unique localized/contextual quote replacement and I can't find any documentation

Re: Code to convert NSDictionary to binary plist file?

2008-06-03 Thread Jean-Daniel Dupas
Le 3 juin 08 à 21:24, David Hoerl a écrit : I'm using [NSDictionary writeToFile:...] to save a fairly large dictionary as a text plist file. I found a quick and dirty hack to convert it into a binary formatted file: strcpy(command, "/usr/bin/plutil -convert binary1 "); strcat(command

Re: Code to convert NSDictionary to binary plist file?

2008-06-03 Thread Jens Alfke
On 3 Jun '08, at 12:24 PM, David Hoerl wrote: Am I missing something obvious? Is there code out there that can take a dictionary and save it as a binary plist? NSPropertyListSerialization. (Everyone overlooks this at first because it's unexpected to have to use a separate class to do this.

Re: Cocoa bindings and reluctance to use NSPopupButon

2008-06-03 Thread Georg Tuparev
It seams I am always 2 weeks late with my contributions ... oh well :-( On May 19, 2008, at 2:03 AM, Erik Buck wrote: 1) Bindings are an ADVANCED technique that was recently introduced and not yet completely documented. If someone tries to use bindings in a situation where he/she doesn't al

Design Patterns -- Views

2008-06-03 Thread Gordon Apple
I haven't delved into the Buck Book yet, but I thought I would offer my take on the use of Views. IMHO, Cocoa and its sample code, like MacApp, makes far too much use of subclassing views for encapsulating complex functionality, e.g., NSTextView, in violation of MCV. In MacApp, I made copious

Code to convert NSDictionary to binary plist file?

2008-06-03 Thread David Hoerl
I'm using [NSDictionary writeToFile:...] to save a fairly large dictionary as a text plist file. I found a quick and dirty hack to convert it into a binary formatted file: strcpy(command, "/usr/bin/plutil -convert binary1 "); strcat(command, fileName); ret = system(command); Yeah,

Re: The KVO Race

2008-06-03 Thread Gordon Apple
(Sorry about that. For got to chance the Subject. -- GA) I guess I don't know hw to use that. The particular situation was a nib that is document related, but loaded and opened later by menu. > On Tue, Jun 3, 2008 at 5:53 PM, Gordon Apple <[EMAIL PROTECTED]> wrote: > >> Both observations

Re: Cocoa-dev Digest, Vol 5, Issue 972

2008-06-03 Thread Gordon Apple
I guess I don't know hw to use that. The particular situation was a nib that is document related, but loaded and opened later by menu. > On Tue, Jun 3, 2008 at 5:53 PM, Gordon Apple <[EMAIL PROTECTED]> wrote: > >> Both observations are set up in the same Nib >> in "awakeFromNib". > > If you

Digital Librarian

2008-06-03 Thread Gerriet M. Denkmann
I am trying to create a Cocoa version of the old NeXT Digital Librarian. To complete it, I would like to have the original icon. Now I am right now about 10 000 km from my own NeXT Cube. Does anybody out there still has a working NeXT and is willing to send me a copy of the Digital Librarian ico

Re: Get and set "Auto adjust brightness when ambient light changes" preferences

2008-06-03 Thread Jean-Daniel Dupas
BezelServices is not used to control ALS but to display visual notification like the one you see when you change the audio volume, or when you press the eject key. Le 3 juin 08 à 20:58, Gabriel ROUSSEAU a écrit : Hi, There is one thing that should be accessible from UserDefaults or by A

NSPredicateEditorRowTemplate: Custom templateView state

2008-06-03 Thread Mario Fischer
Hi - - I use the NSPredicateEditor with a custom NSPredicateEditorRowTemplate - This custom component should implement something like this: [Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB] By overriding templateViews I'm able to add an additional NSPopupButton to the e

Re: how to run my app in privileged mode

2008-06-03 Thread Jean-Daniel Dupas
Note that you should never run a GUI application with elevated provilege, particulary an application that uses AppKit, this is EVIL. See man authopen(1). This is built-in an helper tool design to read and write file using auth services. It handle all the authorization part for you. And b

Re: Best Practice for Returning Immutable Objects?

2008-06-03 Thread Seth Willits
On Jun 3, 2008, at 9:15 AM, j o a r wrote: Would it be sufficient to cast, like this? : return (NSData *)myData; Does this generalize to other non-collection classes, e.g., NSString? In the general case yes. I used to think that. Now I'm converting to making sure it truly i

Re: Core Data "entity required" error

2008-06-03 Thread John Bishop
Melissa's got the right answer... You've probably defined a "configuration" for entities within your data model - via the Configurations pane (wrench) in the Entity box (upper right) in the data modeling editor. You've then specified an entity within the model that you expect to be in the sto

Get and set "Auto adjust brightness when ambient light changes" preferences

2008-06-03 Thread Gabriel ROUSSEAU
Hi, There is one thing that should be accessible from UserDefaults or by AppleScript, or some kind of CGDisplay or NSScreen methods, but it is not the case. On MacBooks Pro and PowerBooks (don't know for MacBooks and iBooks), there is a feature called ALS (Ambient Light Sensors) in the hard

Re: how to run my app in privileged mode

2008-06-03 Thread Michael Vannorsdel
You can't really upgrade an already running process's privilege level. What I'd suggest is make a small launcher program that the user opens. This would ask for the admin password and then launch your main application using AuthorizationExecuteWithPrivileges and friends. On Jun 3, 2008

how to run my app in privileged mode

2008-06-03 Thread Nick Rogers
Hi, I wish to access disk sectors using open() and pread(). but it fails for the system disk. So how can I get the user to type in admin passwd and then run my app in privileged mode. Please point me to any sample code etc. I tried ""BetterAuthorizationSample" code from apple, but using it to

Re: Copying NSTextStorage

2008-06-03 Thread Ross Carter
On Jun 3, 2008, at 12:51 PM, Kyle Sluder wrote: On Tue, Jun 3, 2008 at 11:15 AM, Gordon Apple <[EMAIL PROTECTED]> wrote: I tried exactly that. It did nothing but a horrendous crash when I tried to type text. I couldn't even trace it. I never even got to the copy part. I got the same re

Re: Manipulating images with meta-data

2008-06-03 Thread Bill Bumgarner
On Jun 3, 2008, at 11:03 AM, Randall Meadows wrote: Except that I'm not going to be able to use jpegexiforient, because the image file apparently isn't in the correct form it wants. This test fails: /* Read File head, check for JPEG SOI + Exif APP1 */ for (i = 0; i < 4; i++) exif_data[i] =

Re: Manipulating images with meta-data

2008-06-03 Thread Randall Meadows
On Jun 3, 2008, at 11:14 AM, Randall Meadows wrote: I'm about to resort to using a third-part solution (jpegtran and jpegexiforient) that I've found, but Except that I'm not going to be able to use jpegexiforient, because the image file apparently isn't in the correct form it wants. This

Re: Main window disappears. Sometimes.

2008-06-03 Thread Bill Bumgarner
On Jun 3, 2008, at 10:02 AM, Andy Lee wrote: I've been assuming that NSApplication keeps a strong reference to all windows in its window list, but now that I think of it there's no particular reason to assume that. Is it not the case? I just want to correct my mental model if I've been mis

Re: Main window disappears. Sometimes.

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 6:02 PM, Andy Lee <[EMAIL PROTECTED]> wrote: > On Jun 2, 2008, at 1:50 PM, Bill Bumgarner wrote: > >> If your window is sometimes disappearing under GC -- is sometimes being >> collected prior to when you think it should be -- that means that the >> collector doesn't believe

Re: The KVO Race

2008-06-03 Thread Hamish Allan
On Tue, Jun 3, 2008 at 5:53 PM, Gordon Apple <[EMAIL PROTECTED]> wrote: > Both observations are set up in the same Nib > in "awakeFromNib". If you have dependencies between objects in your nib, you can use -[NSApplication applicationWillFinishLaunching:] to set things up. Hamish

  1   2   >