Re: NSSound won't play wave files???

2008-07-07 Thread Charles Srstka
On Jul 7, 2008, at 1:53 AM, Jason Bobier wrote: Has anyone else had issues playing wave files with NSSound? Not only does it refuse to play the file (even tho I can open it with the Quicktime Player and play it), but it fails to error. It simply doesn't make a sound. AIFF files seem to play

Re: NSSound won't play wave files???

2008-07-07 Thread Jason Bobier
BTW, this: - (void)awakeFromNib { BOOL success; NSError *error = nil; QTMovie *sound = [[QTMovie movieWithFile:@"/Users/jason/Desktop/ 306.wav" error:&error] retain]; [sound play]; NSLog(@"%d", (int)success); } works fine. On Jul 7

Re: NSSound won't play wave files???

2008-07-07 Thread Jason Bobier
Hey Charles, I just did and that worked fine, so at least I have a work around. :-) Jason On Jul 7, 2008, at 3:01 AM, Charles Srstka wrote: On Jul 7, 2008, at 1:53 AM, Jason Bobier wrote: Has anyone else had issues playing wave files with NSSound? Not only does it refuse to play the file (

Re: garbage collection and NSConnection

2008-07-07 Thread Joan Lluch (casa)
El 07/07/2008, a las 0:18, Hamish Allan escribió: On 7/4/08, Chris Hanson <[EMAIL PROTECTED]> wrote: Under non-GC, an object's memory may not be reclaimed until the current autorelease pool is drained. However, under GC, an object's memory can be reclaimed as soon as the collector can tel

Re: Bit maps from raw camera files

2008-07-07 Thread Paul Sargent
Remember that some raw files contain multiple resoltions (i.e. a thumbnail and the main image), so you may not always want the first one. On 6 Jul 2008, at 04:29, James Merkel wrote: Will look into CGImageRef using ImageIO. However, I found that if I use: imageRepsWithContentsOfFile: rather

Rerouting keyboard input

2008-07-07 Thread em
I would like to be able to reassign the primary system keyboard input so as to direct it to an incoming network stream. It's a general query at present and any suggestions would be appreciated. I'm leaning toward writing a Cocoa/Objective C/PPC Masm app--locating and modifying the "remote a

archive only what changed?

2008-07-07 Thread Randy Canegaly
I have an application whose data model is an NSMutableArray with elements that could be pointers other NSMutableArrays, much like what you would navigate with a NSIndexPath. I am using NSKeyedArchiver to archive the data model to a file. Right now I archive the entire top level array obje

Re: Toolbar code in separate Controller?

2008-07-07 Thread John Love
Uli - To enable/disable the toolbar items, Cocoa uses the NSUserInterfaceValidation protocol, and asks each responder in the responder chain, beginning at the first responder. Have you inserted your toolbar controller in the responder chain so it actually gets asked whether these methods should be

Re: archive only what changed?

2008-07-07 Thread I. Savant
\On Mon, Jul 7, 2008 at 10:13 AM, Randy Canegaly <[EMAIL PROTECTED]> wrote: > I have an application whose data model is an NSMutableArray with elements > that could be pointers other NSMutableArrays, much like what you would > navigate with a NSIndexPath. I am using NSKeyedArchiver to archive the

Re: archive only what changed?

2008-07-07 Thread Andy Mroczkowski
Another possible option is CDBStore framework. I haven't personally used it, but it claims to fill the gap between archiving/property lists and Core Data. http://mooseyard.com/projects/CDBStore/ - Andy On Jul 7, 2008, at 10:25 AM, I. Savant wrote: \On Mon, Jul 7, 2008 at 10:13 AM, Randy C

Re: Stopping actions mid stream

2008-07-07 Thread Jeff Brown
Thanks everyone. I ended up just disabling the option in the end. Cheers Jeff Thanks Andy and Jean-Daniel. Peter On 07/07/2008, at 3:34 AM, Andy Lee wrote: Yes: (by way of DaringFireball) --Andy On Jul 6, 2008, at

Being notified of current document change

2008-07-07 Thread Laurent Cerveau
Hi This is probably a stupid question but : in a NSDocument application I did not found a way to be notified of change of currentDocument. For now I do some tricks with notification on window but I was wondering if I simply missed a part? Thanks laurent __

Re: Efficiently receiving data from an NSTask

2008-07-07 Thread Michael Ash
On Mon, Jul 7, 2008 at 2:36 AM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > On 06 Jul 08, at 23:24, Omar Qazi wrote: >> >> On Jul 6, 2008, at 7:46 AM, Martin Hairer wrote: >>> >>> This works like a treat and is faster by a factor 3 or so than using >>> the "Moriarity" implementation. However, it lea

Re: NSURLConnection how to handle 502 error

2008-07-07 Thread Kanny
I am still trying to find a solution to quickly resolve the web server 502 error using NSURLRequest and NSURLConnection. Right now, even if i set timeoutinterval to 5 seconds, it takes 30 seconds. But more painful thing is that during that time, it makes the app unresponsive with the beach ball

Re: Efficiently receiving data from an NSTask

2008-07-07 Thread Charles Srstka
On Jul 7, 2008, at 10:16 AM, Michael Ash wrote: 3) Look for a clean break in the UTF-8 sequence. This is not as difficult as it sounds. There are two easy scenarios where you can break. The first is after any ASCII character. You can scan your NSMutableData buffer for any char value <= 127, and

Re: Toolbar code in separate Controller?

2008-07-07 Thread Graham Cox
On 8 Jul 2008, at 12:13 am, John Love wrote: Initially, my ToolbarController was sub to NSObject as was the case for Apple's SimpleToolbar, so I changed the super class of my ToolbarController to NSControl. Huh? This makes no sense whatsoever. Why not just make your toolbar's delegate/c

Re: NSURLConnection how to handle 502 error

2008-07-07 Thread Mike Abdullah
I don't know the full solution, but for a start, is there a particular reason you are using a synchronous request? Use the asynchronous API and the main thread won't be locked. On 7 Jul 2008, at 16:27, Kanny wrote: I am still trying to find a solution to quickly resolve the web server 502

Re: Being notified of current document change

2008-07-07 Thread Graham Cox
I'm not sure if there is a better way, but subscribing to NSWindow didBecomeMain/didResignMain, then using: NSDocument* cd = [[NSDocumentController sharedDocumentController] currentDocument]; is one way to do it. hth, Graham On 8 Jul 2008, at 1:14 am, Laurent Cerveau wrote: Hi This

Re: Efficiently receiving data from an NSTask

2008-07-07 Thread Michael Ash
On Mon, Jul 7, 2008 at 11:52 AM, Charles Srstka <[EMAIL PROTECTED]> wrote: > On Jul 7, 2008, at 10:16 AM, Michael Ash wrote: > >> 3) Look for a clean break in the UTF-8 sequence. This is not as >> difficult as it sounds. There are two easy scenarios where you can >> break. The first is after any AS

Re: NSSpeechSynthesizer and empty strings

2008-07-07 Thread Sean McBride
On 6/26/08 11:30 PM, Michael Ash said: >> No; don't ever do that. It is possible for an NSString to have zero length >> but not be empty. > >This is backwards. You can have a string that is "empty" but has >non-zero length, due to the characters it contains being semantically >null. Neat. Could

Re: Efficiently receiving data from an NSTask

2008-07-07 Thread Charles Srstka
On Jul 7, 2008, at 11:04 AM, Michael Ash wrote: Um, no it won't. The mask for the first two bits would be 0xC0, not 0xA. 0xA would be 0101, which other than being the ASCII newline character, doesn't seem terribly interesting for this use. You're right, my bad. I even checked 0xC0 to make

Re: Efficiently receiving data from an NSTask

2008-07-07 Thread Daryle Walker
On Jul 7, 2008, at 11:19 AM, Michael Ash wrote: 3) Look for a clean break in the UTF-8 sequence. This is not as difficult as it sounds. There are two easy scenarios where you can break. The first is after any ASCII character. You can scan your NSMutableData buffer for any char value <= 127, and

NSButton in a NSPanel's top-right corner?

2008-07-07 Thread Relindor
Hi there I would like to have a NSButton in my NSPanel's top-right corner (Like the app on this image: http://img363.imageshack.us/img363/5733/bild5ex0.png ) but I have absolutely no idea of how to achieve this so any help would be appreciated. Thanks, Tim _

Re: archive only what changed?

2008-07-07 Thread Joan Lluch (casa)
Core Data does a really good job at what you are describing, when using SQLite as a persistent store, although this may not be what are you looking for. The only other approach to this that I think of is to cache the objects that change in your model and then only store these objects eith

Re: NSButton in a NSPanel's top-right corner?

2008-07-07 Thread Kyle Sluder
Get a reference to a standard button using -[NSWindow standardWindowButton:], and then insert your button into its superview. Position it as you normally would. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post ad

Re: Guidelines for Cocoa frameworks supporting garbage collection?

2008-07-07 Thread Sean McBride
On 7/5/08 2:56 PM, Chris Hanson said: >For example, this pseudocode is wrong under GC: > > - (NSURL *)someURL { > NSURL *URL = (NSURL *)CFURLCreate...(...); > return [URL autorelease]; > } > >It will leak, because the runtime will "eat" the -autorelease message >when running under

Re: garbage collection and NSConnection

2008-07-07 Thread Sean McBride
On 7/6/08 11:18 PM, Hamish Allan said: > >collectExhaustively >Tells the receiver to collect iteratively. > >- (void)collectExhaustively > >Discussion >You use this method to indicate to the collector that it should >perform an exhaustive collection. Collection is subject to >interruption

debugging runaway allocations under gc

2008-07-07 Thread [EMAIL PROTECTED]
We have an "out of memory" crasher in a gc app that we are trying debug, but I'm having a bit of difficulty bringing the correct tools to bear on the problem. I suspect that either we have some kind of runaway loop that's allocating us into oblivion, or we're outrunning the collector (I suspe

Re: NSURLConnection how to handle 502 error

2008-07-07 Thread Scott Tury
Kanny, On Jul 7, 2008, at 1:37 PM, [EMAIL PROTECTED] wrote: I am still trying to find a solution to quickly resolve the web server 502 error using NSURLRequest and NSURLConnection. Right now, even if i set timeoutinterval to 5 seconds, it takes 30 seconds. But more painful thing is that duri

More CALayer Questions

2008-07-07 Thread Gordon Apple
I'm suffering from extreme frustration with CALayers. I obviously don't understand the documentation available and there is a lot that is not documented, especially since the Views guide has not been updated to include CALayers. Also, as others have observed, the "flipped" paremeter in [NSGra

Sub-classing NSAtomicStore

2008-07-07 Thread Todd Stanley
Hi All, Has any one had any luck working with the AutomicStoreSubclass example. I need to manage and AtomicStore and thought that I would be able to use the AutomicStoreSubclass example as a road-map. When I addPersistentStoreWithType as follows - if ([coordinator addPersistentStoreWithType

Re: More CALayer Questions

2008-07-07 Thread Jens Alfke
On 7 Jul '08, at 12:42 PM, Gordon Apple wrote: One source of confusion is the anchorPoint/Position relation. Reference says "The position is relative to anchorPoint". Huh? What anchorPoint? -- the layer in question, or its superLayer? And what does this mean for the view's layer in

Releasing objects causes BAD_ACCESS

2008-07-07 Thread Meik Schuetz
Dear all, according to the document http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html the connection object as well as the receivedData object are released in the connectionDidFinishLoading delegate. However, while debugging, I receiv

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Jonathan del Strother
On Mon, Jul 7, 2008 at 10:38 PM, Meik Schuetz <[EMAIL PROTECTED]> wrote: > Dear all, > > according to the document > > http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html > > the connection object as well as the receivedData object are released

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Randall Meadows
On Jul 7, 2008, at 3:44 PM, Jonathan del Strother wrote: On Mon, Jul 7, 2008 at 10:38 PM, Meik Schuetz <[EMAIL PROTECTED]> wrote: according to the document http://developer.apple.com/documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html the connection object as well

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Randall Meadows
On Jul 7, 2008, at 3:49 PM, Randall Meadows wrote: NSZombieEnabled is a good start - http://developer.apple.com/technotes/tn2004/tn2124.html#SECFOUNDATION See also "Technical Note TN2124 - Mac OS X Debugging Magic": Heh, which now I s

Re: More CALayer Questions

2008-07-07 Thread Gordon Apple
OK, a little update. Through watching a number of parameters, a lot of experimentation, and probably blind a** luck, I've managed to get rescaling to sort of work. However, to do editing of objects (e.g., dragging them around), I had to call "removeAllAnimations". When I change the scale, th

Re: garbage collection and NSConnection

2008-07-07 Thread Hamish Allan
On Mon, Jul 7, 2008 at 6:33 PM, Sean McBride <[EMAIL PROTECTED]> wrote: > There's always the lower-level: > >objc_collect (OBJC_EXHAUSTIVE_COLLECTION | >OBJC_WAIT_UNTIL_DONE); If this were called from the main thread, would it guarantee that the collector run without interruption, giv

Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
I want to be able to delete the items selected in a view, but am struggling finding a best way to turn the different key presses into a -delete: action that my controller can handle. I think I want (it seems expected functionality anyway) the delete key, the forward delete key, as well as C

Re: Why aren't my bindings firing?

2008-07-07 Thread Hamish Allan
On Thu, Jul 3, 2008 at 1:12 AM, mmalc crawford <[EMAIL PROTECTED]> wrote: > > On Jul 2, 2008, at 4:04 PM, Hamish Allan wrote: > >> This is a rather unuseful attitude to take. Clearly, this thread >> started as a result of the distinction. Also, Apple's own >> documentation disagrees with you, as it

Re: More CALayer Questions

2008-07-07 Thread douglas a. welton
See my comments embedded below... On Jul 7, 2008, at 3:42 PM, Gordon Apple wrote: I'm suffering from extreme frustration with CALayers. I obviously don't understand the documentation available and there is a lot that is not documented, especially since the Views guide has not been updated

Re: More CALayer Questions

2008-07-07 Thread douglas a. welton
Hi Gordon, I'm not sure what you really want to do is -removeAllAnimations. I suspect that you probably want to temporarily disable animation within the scope of a CATransaction. Take a look at the code found here:

Re: More CALayer Questions

2008-07-07 Thread Bill Dudney
Hi Gordon, 'the upcomming book on animation'? If by that you mean the Core Animation book from Pragmatic Programmers you can get the PDF now from http://www.pragprog.com/titles/bdcora and then the paper when it ships. You get a really good discount on it if you buy both. Not sure where

Re: Delete action from variety of key presses

2008-07-07 Thread Ken Thomases
On Jul 7, 2008, at 5:29 PM, Nathan Vander Wilt wrote: I want to be able to delete the items selected in a view, but am struggling finding a best way to turn the different key presses into a -delete: action that my controller can handle. I think I want (it seems expected functionality anyway

Re: [NSTextStorage/NSAttributedString] How can we know the height of a rendered string?

2008-07-07 Thread Jean-Daniel Dupas
Le 7 juil. 08 à 23:54, Stéphane Sudre a écrit : On Jul 6, 2008, at 11:26 PM, Jean-Daniel Dupas wrote: Le 6 juil. 08 à 21:25, Stéphane Sudre a écrit : Problem: I would like/need to know the height that would be required to render a string inside a fixed width box. Solution tha

Re: Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
The Cocoa Text Bindings system already translates keys and key combinations into invocations of NSResponder methods. So, what you need to do is determine which methods those

Re: Delete action from variety of key presses

2008-07-07 Thread Greg Titus
Hi Nathan, By overriding -keyDown: and not calling [super keyDown:keyEvent], you have stopped your view from actually processing the keys any further. That's why you aren't getting to either of the delete methods. Hope this helps, - Greg On Jul 7, 2008, at 4:59 PM, Nathan Vander Wi

Re: Delete action from variety of key presses

2008-07-07 Thread Graham Cox
The view that is first responder needs to override -keyDown: and do this: [self interpretKeyEvents:[NSArray arrayWithObject:event]]; which hooks the event into the standard dispatcher for these methods. (One thing that has long puzzled me about this though - why is the parameter an

Re: Delete action from variety of key presses

2008-07-07 Thread Randall Meadows
On Jul 7, 2008, at 6:07 PM, Graham Cox wrote: The view that is first responder needs to override -keyDown: and do this: [self interpretKeyEvents:[NSArray arrayWithObject:event]]; which hooks the event into the standard dispatcher for these methods. (One thing that has long puzzled m

Re: Delete action from variety of key presses

2008-07-07 Thread Ken Thomases
On Jul 7, 2008, at 6:59 PM, Nathan Vander Wilt wrote: Thanks, I forgot to mention that I tried overriding some of those action methods. However, I couldn't get them to fire. If I implement: - (BOOL)acceptsFirstResponder { return YES; } - (void)keyDown:(NSEvent*)keyEvent { (v

Re: Delete action from variety of key presses

2008-07-07 Thread Nathan Vander Wilt
By overriding -keyDown: and not calling [super keyDown:keyEvent], you have stopped your view from actually processing the keys any further. That's why you aren't getting to either of the delete methods. Hmm, the flowchart I mentioned (http://developer.apple.com/documentation/Cocoa/Conceptua

Re: More CALayer Questions

2008-07-07 Thread Gordon Apple
Thanks. That's a good suggestion. I just realized that the thing was trying to animate and was interfering with my attempts to manually draw. I saw "removeAllAnimations" and tried it to solved my immediate problem. I'll see if I can use what you mentioned instead. I'm not currently using C

Re: Releasing objects causes BAD_ACCESS

2008-07-07 Thread Scott Ribe
> the connection object as well as the receivedData object are released > in the connectionDidFinishLoading delegate The sample also retains receivedData after creating the connection. Did you do that? And did you create the connection using alloc initxxx? -- Scott Ribe [EMAIL PROTECTED] http:/

Re: Rerouting keyboard input

2008-07-07 Thread Kyle Sluder
On Mon, Jul 7, 2008 at 8:34 AM, em <[EMAIL PROTECTED]> wrote: > I would like to be able to reassign the primary system keyboard input so as > to direct it to an incoming network stream. It's a general query at > present and any suggestions would be appreciated. I'm leaning toward writing >

Re: Why aren't my bindings firing?

2008-07-07 Thread Chris Hanson
On Jul 7, 2008, at 3:51 PM, Hamish Allan wrote: If that is the case, let me ask: is KVB unidirectional or bi- directional? Whether a binding is unidirectional or bidirectional depends upon the specific binding in question and the meaning the class providing it has decided to give it. -

Re: How to support dictionary service in a custom text view?

2008-07-07 Thread Evan Gross
On 03/07/08 3:26 PM, "Charles Srstka" <[EMAIL PROTECTED]> wrote: > On Jul 3, 2008, at 12:03 PM, Charles Srstka wrote: > >> Okay, so I've got a custom text view that's a subclass of NSView >> (not NSTextView). I've followed the instructions on this page: >> >> http://developer.apple.com/documenta

Re: Bit maps from raw camera files

2008-07-07 Thread James Merkel
That's true. As a matter fact, I think all digital camera files have more than one image -- even the lowliest point and shoot camera has a main image and a thumbnail. However, I checked various camera files and found that imageRepsWithContentsOfFile: always seems to return just one image. S

Re: Rerouting keyboard input

2008-07-07 Thread Matt Burnett
Take a look at the darwin-dev lists. You could reroute the keyboard events in kernel space to go to your daemon instead of its typical path to user land. Then have your daemon send the events over the network to a daemon on a 2nd computer, then have the 2nd daemon reinject them to your targ

Re: More CALayer Questions

2008-07-07 Thread Gordon Apple
Yup, Amazon, July 15, $23.07 + shipping. BTW, you might want them to update the title because it doesn't mention iPhone. Considering the huge number of iPhone SDKs downloaded, that could be a big draw. I may cancel Amazon and order the PDF package from your site. I had considered adding

Re: How to support dictionary service in a custom text view?

2008-07-07 Thread Charles Srstka
On Jul 7, 2008, at 9:48 PM, Evan Gross wrote: While supporting AX is always a good thing to do, the Dictionary service doesn't require access to be enabled. Have you tested at all with accessibility off? I'm not sure what you're referring to with regards to "accessibility off". If you are

Cocoaheads Lake Forest meets Wednesday, 7/9 at 7pm PST

2008-07-07 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday in July. We will be meeting, as usual, in the community room of the El Toro branch of the Orange County Public Library at 24672 Raymond Way, Lake Forest, CA 92630. Please join us from 7pm to 9pm on Wednesday, 7/9. Note: the caption m

controlling system muting ?

2008-07-07 Thread Jason Bobier
Hey folks, Has anyone figured out how to control a machine's volume level (specifically muting) from code? I know that you can do it from Applescript, but running an applescript from code seems to be a rather clunky approach. This is for emergency notification, so I have to be able to cra

Re: How to support dictionary service in a custom text view?

2008-07-07 Thread Evan Gross
On 07/07/08 11:14 PM, "Charles Srstka" <[EMAIL PROTECTED]> wrote: > I'm not sure what you're referring to with regards to "accessibility off". If > you are referring to the "Allow access for assistive devices" check box in > the Universal Access preference pane, that isn't what I was talking ab

Re: How to support dictionary service in a custom text view?

2008-07-07 Thread Charles Srstka
On Jul 7, 2008, at 10:57 PM, Evan Gross wrote: On 07/07/08 11:14 PM, "Charles Srstka" <[EMAIL PROTECTED]> wrote: I'm not sure what you're referring to with regards to "accessibility off". If you are referring to the "Allow access for assistive devices" check box in the Universal Access

Re: controlling system muting ?

2008-07-07 Thread Phil
On Tue, Jul 8, 2008 at 3:25 PM, Jason Bobier <[EMAIL PROTECTED]> wrote: > Has anyone figured out how to control a machine's volume level (specifically > muting) from code? I know that you can do it from Applescript, but running > an applescript from code seems to be a rather clunky approach. > > Th

Re: Why aren't my bindings firing?

2008-07-07 Thread Ron Lue-Sang
*sigh* I haven't looked at these docs recently. With that in mind, here's how I think of things… YES: Cocoa Bindings ®™ is built on KVC, KVO and KVB KVB is an informal protocol. So Cocoa Bindings™® provides a concrete implementation (on NSObject) of the KVB protocols. In addition to prov

Re: Style Question (Robert Claeson)

2008-07-07 Thread Scott Ribe
> Should be possible, no? Emacs ;-) -- Scott Ribe [EMAIL PROTECTED] http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: How to create to-many accessor methods at runtime

2008-07-07 Thread Steve Weller
Just to follow up on my own question... What I am attempting to do is not working. -valueForKey: does not look for methods with -respondsToSelector: to figure out if methods exist sufficient to have KVC. So overriding this has no effect. My only option, it seems, is to use +resolveInsta