Re: apple remote

2008-10-05 Thread Simone Tellini
Il giorno 06/ott/08, alle ore 05:38, Memo Akten ha scritto: Hi All, I was wondering how straightforward it is to write an app that responds to Apple Remote events. would I get them in - (void) sendEvent:(NSEvent*)event ? I use Kahr's wrapper, too. I suggest you file a bug with Apple asking

Re: NSWindowController retain count confusion

2008-10-05 Thread James W. Walker
On Sep 30, 2008, at 6:06 PM, Jonathan Hess wrote: Interesting. Was there a corresponding console message about an object being autoreleased with no pool in place? If not, you should consider filing a radar with a small reproducible test case. In case you or any other Apple folks are intere

Re: apple remote

2008-10-05 Thread Tim Andersson
Hi there. I use the following for Apple Remote functionality in my app: http://www.martinkahr.com/2007/07/26/remote-control-wrapper-20/ Hope it works for you. Cheers, Tim ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admi

Re: apple remote

2008-10-05 Thread eric.bachard
Hi, Memo Akten a écrit : Hi All, I was wondering how straightforward it is to write an app that responds to Apple Remote events. AFAIK, there is no public API (please tell me ;) ) would I get them in - (void) sendEvent:(NSEvent*)event ? or what would I need to do? If anyone can point me i

apple remote

2008-10-05 Thread Memo Akten
Hi All, I was wondering how straightforward it is to write an app that responds to Apple Remote events. would I get them in - (void) sendEvent:(NSEvent*)event ? or what would I need to do? If anyone can point me in the right direction i'd appreciate it... cheers.

Re: Changing system volume

2008-10-05 Thread Nick Zitzmann
On Oct 5, 2008, at 2:45 PM, [EMAIL PROTECTED]@ßĦ wrote: Is there a method in Cocoa that I could use to set the system volume? I would use SetDefaultOutputVolume, but it is deprecated in 10.5. Not in the Cocoa frameworks, there isn't. You'll have to use CoreAudio from now on. Search the arc

Re: Should not use mogenerator in Mac OS 10.5+ ?

2008-10-05 Thread Sean McBride
Jerry Krinock ([EMAIL PROTECTED]) on 2008-10-4 7:11 PM said: >So, I don't ^need^ mogenerator, although I still may want to use it Jerry, I have been using mogenerator, and have asked myself the same question as you. I have found the following things about it most useful: 1) when you change you

Re: Problem setting the menu

2008-10-05 Thread Felipe Monteiro de Carvalho
Hello, I am still trying to get the application menu to work. I have even tryed to add a very simple nib file to the project. I simply added the nib file to the bundle and set NSMainNibFile, but it doesn't show the applications menu. It doesn't matter if I comment the code which attempts to genera

Re: Problem setting the menu

2008-10-05 Thread Felipe Monteiro de Carvalho
On Mon, Sep 29, 2008 at 5:02 PM, Peter Ammon <[EMAIL PROTECTED]> wrote: > NSMenu needs a minimal nib to properly set up the application menu. You can > construct your other menus programmatically however. Well, that's not completely true. The developers of the following code claim that it creates

Re: Cannot see toolbar buttons

2008-10-05 Thread Felipe Monteiro de Carvalho
Sorry, it actually works =) I cannot see the images when executing the program directly, but they show when executing from the bundle, because they are loaded from it. But I still find it wierd that there is no border in the button, just an image. -- Felipe Monteiro de Carvalho _

Cannot see toolbar buttons

2008-10-05 Thread Felipe Monteiro de Carvalho
Hello, I have created a toolbar, but I cannot see the buttons inside it. They actually work, because if I click in the place where the buttons should be the callback is actually executed. Any ideas? Here is my toolbar code: constructor TMyToolbarController.Create; begin { The class is register

Changing system volume

2008-10-05 Thread [EMAIL PROTECTED]@ßĦ
Hi, Is there a method in Cocoa that I could use to set the system volume? I would use SetDefaultOutputVolume, but it is deprecated in 10.5. Thanks. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderat

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 4:43 PM, Brian Stern <[EMAIL PROTECTED]> wrote: > How do I guarantee that object X is dealloced on the main thread? I'd suggest that, if at all possible, your dealloc method shouldn't care what thread it runs in. Fortunately most resource cleanup can run anywhere. If your de

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Jonathan Hess
On Oct 5, 2008, at 6:32 AM, Dr. Rolf Jansen wrote: Am 05.10.2008 um 00:36 schrieb Michael Ash: On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. ... In order to prevent my application from crashing, I overwrote -[NSObje

Re: Computer icon on Leopard

2008-10-05 Thread Ken Ferry
> Basically I need to get the icon currently associated with the user's > computer This is [NSImage imageNamed:NSImageNameComputer]. Check out the NSImage docs. -Ken On Sun, Oct 5, 2008 at 3:01 PM, Leonardo Cassarani <[EMAIL PROTECTED]> wrote: > Hi all > > I've been looking for this everywhere

Re: NSTableView confusion

2008-10-05 Thread James Maxwell
Thanks Michael, As I suspected, IB baffled me into doing something fairly stupid... or at least absent minded. I just forgot to make a connection... I started programming in MaxMSP, so it's not like I'm unaccustomed to making connections with little cables! But I think my frustration with I

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 5:41 PM, Brian Stern wrote: My main reason was just cleanliness. Looking more closely at the code however, most of which I didn't write, there are some runloop sources that are removed and calls to NSObject cancelPreviousPerformRequestsWithTarge:selector:object. Most of

Computer icon on Leopard

2008-10-05 Thread Leonardo Cassarani
Hi all I've been looking for this everywhere but couldn't find a solution. Basically I need to get the icon currently associated with the user's computer, that is the one that appears in the sidebar, or next to the "Go" -> "Computer" menu item in the Finder. I know where they're all store

re: Should not use mogenerator in Mac OS 10.5+ ?

2008-10-05 Thread Ben Trumbull
Jerry, Now, developing for Mac OS X 10.5+, I read that "On Mac OS X v10.5, Core Data dynamically generates efficient public and primitive get and set attribute accessor methods and relationship accessor methods for managed object classes." Yes. So, I don't ^need^ mogenerator, although I stil

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Brian Stern
On Oct 5, 2008, at 4:52 PM, Jim Correia wrote: On Oct 5, 2008, at 4:43 PM, Brian Stern wrote: This is the question I really wanted to ask: I have an object X that is alloc/inited on the main thread. This object creates some NSThreads with detachNewThreadSelector:toTarget:withObject, whi

hyphenationFactor in typesetter and layout manager

2008-10-05 Thread Ross Carter
The hyphenation factor can be set for both NSATSTypesetter and NSLayoutManager. My tests indicate that it is sufficient to send setHyphenationFactor: to the typesetter alone (and simpler, if a document has multiple layouts). Is that correct, or must each layout manager's hyphenation factor

Binding NSTableView Double Click argument and target to file's owner

2008-10-05 Thread Ken Tozier
Hi I'm trying to bind double click actions of an NSTableView to "file's owner" and can't figure out exactly how to set them up. My file's owner has a double click handler defined like so: - (void) handleDoubleClick:(NSNumber *) inRowIndex; Given that, how would I set up the bindings for bo

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 4:43 PM, Brian Stern wrote: This is the question I really wanted to ask: I have an object X that is alloc/inited on the main thread. This object creates some NSThreads with detachNewThreadSelector:toTarget:withObject, which have object X as their target. At a later po

How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Brian Stern
Hi All, The thread "Re: premature dealloc of the datasource of a NSTableView crashes my application" made me think about this problem again. This is the question I really wanted to ask: I have an object X that is alloc/inited on the main thread. This object creates some NSThreads with d

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 1:31 PM, Brian Stern <[EMAIL PROTECTED]> wrote: > > On Oct 4, 2008, at 11:36 PM, Michael Ash wrote: >> >> Absolutely not. Write your code to work with any order. In this case, >> what you should do is write your data source to nil out the table's >> reference to it when it go

Re: wasting space?

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 1:05 PM, I. Savant <[EMAIL PROTECTED]> wrote: > As to the other 50% of this sentiment, I don't understand the "some of us > still aren't too convinced about their ultimate utility" comment. By > "ultimate utility", I take it that you mean some view the Bindings mechanism > a

Binding not working in Document based app

2008-10-05 Thread Eric Gorr
You can download a complete working and non-working project by grabbing: http://ericgorr.net/bindings.zip The first project called bindings was based on a simple Cocoa Application. I setup all of the bindings and everything works as expected. The second project called bindingsdocs was base

DVDPlayback - garbled graphics in fullscreen, and missing device complaint

2008-10-05 Thread Fabian
Hi all, I'm having a couple of issues implementing the DVDPlayback framework in a kiosk app. First of all I see a lot a garbled graphics. The screen goes green and all I see is interlaced junk. Not always, but quite often, and when I do I usually need to force a shutdown of the computer. It seems

Moving file to trash on afp volume

2008-10-05 Thread Laurent Cerveau
Hi I'd like to programmatically mov to trash a file from an afp mounted volume. I have been using NSWorkspace with NSWorkspaceRecycleOperation but it fails (tag returned is -1). Is there a way to get a more exact description of the error? I tried to move to FSPathMoveObjectToTrashSync and

Re: file fixtures for unit testing

2008-10-05 Thread Brent Hargrave
Thank you all. As I'm new to testing, would someone mind expanding on Timothy's point re: using real files as test fixtures? What works better and why? Many thanks, JB On Sat, Oct 4, 2008 at 12:30 PM, Chris Hanson <[EMAIL PROTECTED]> wrote: > On Oct 4, 2008, at 3:59 AM, Colin Barrett wrote: >

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Nick Zitzmann
On Oct 5, 2008, at 7:32 AM, Dr. Rolf Jansen wrote: Anyway, now I cannot understand, why the NSTableView does not retain the dataSource, when it still needs it? Delegates and data sources don't get retained in order to avoid retention loops. If the table view did retain its delegate and da

Re: Data Types for Extracting samples from Audio Buffer

2008-10-05 Thread Jacob Lukas
On Oct 5, 2008, at 09:47, Joseph Ayers wrote: I'm trying to extract the audio samples from an audio buffer returned from the QuickTime Audio extraction API into a NSMutableArray of NSNumbers. The code I am using is: AudioBufferList* abl; NSMutableArray * ipbuf; N

Re: Data Types for Extracting samples from Audio Buffer

2008-10-05 Thread Nick Zitzmann
On Oct 5, 2008, at 10:47 AM, Joseph Ayers wrote: The program crashes on the line [ipsamp initWithUnsignedShort:(unsigned short)ippointer[isamp]]; with Program received signal: “EXC_BAD_ACCESS”. isamp is 1. Am I using the wrong data types? No; you're forgetting to allocate the memory

Re: Create CGImageRef with transparency

2008-10-05 Thread Christian Giordano
Yep, that worked perfectly, thanks a lot! chr On Sun, Oct 5, 2008 at 6:45 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote: > > On Oct 5, 2008, at 10:28 AM, Christian Giordano wrote: > >> I'm trying to create a CGImageRef with CGImageCreate from a generated >> byte array (RGBA) but it doesn't see

Re: Create CGImageRef with transparency

2008-10-05 Thread Adam R. Maxwell
On Oct 5, 2008, at 10:28 AM, Christian Giordano wrote: I'm trying to create a CGImageRef with CGImageCreate from a generated byte array (RGBA) but it doesn't seem to handle the transparency, so all the pixels are visible when some should not. As color space I'm using CGColorSpaceCreateDeviceRGB

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Brian Stern
On Oct 4, 2008, at 11:36 PM, Michael Ash wrote: Absolutely not. Write your code to work with any order. In this case, what you should do is write your data source to nil out the table's reference to it when it goes away: - (void)dealloc { [tableView setDataSource:nil]; [super dealloc]; }

Create CGImageRef with transparency

2008-10-05 Thread Christian Giordano
I'm trying to create a CGImageRef with CGImageCreate from a generated byte array (RGBA) but it doesn't seem to handle the transparency, so all the pixels are visible when some should not. As color space I'm using CGColorSpaceCreateDeviceRGB(), as CGColorRenderingIntent I'm using kCGRenderingIntentD

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Dr. Rolf Jansen
Am 05.10.2008 um 00:36 schrieb Michael Ash: On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. ... In order to prevent my application from crashing, I overwrote -[NSObject dealloc] of the datasource to the following: - (void

Re: wasting space?

2008-10-05 Thread I. Savant
On Oct 5, 2008, at 1:10 PM, Quincey Morris wrote: Let me make one attempt at rephrasing my point, then I'll shut up. Nonsense. There's nothing 'shut-up-worthy', just debate-worthy. :-) ... the combination of bindings and a MVC design pattern promotes code brevity through reusability via f

Re: wasting space?

2008-10-05 Thread Quincey Morris
On Oct 5, 2008, at 08:01, Michael Ash wrote: Pardon me? Cocoa did perfectly fine for over a decade having this be the *only* way to do things. Bindings only came about in 10.3, practically yesterday. And some of us still aren't too convinced about their ultimate utility either. In any case, dire

Re: wasting space?

2008-10-05 Thread I. Savant
On Oct 5, 2008, at 11:01 AM, Michael Ash wrote: Pardon me? Cocoa did perfectly fine for over a decade having this be the *only* way to do things. Bindings only came about in 10.3, practically yesterday. And some of us still aren't too convinced about their ultimate utility either. In any case, d

Data Types for Extracting samples from Audio Buffer

2008-10-05 Thread Joseph Ayers
I'm trying to extract the audio samples from an audio buffer returned from the QuickTime Audio extraction API into a NSMutableArray of NSNumbers. The audio extraction API indicates that the samples are two byte integers (unsigned short?) and the buffers are extracted without error. 2008-10

Re: Cocoa Programming for Mac OsX Third Edition eBook search

2008-10-05 Thread Howard Oakley
On 05/10/2008 15:38, Paul Bruneau wrote: > But the OP wanted to use it in an ebook. Does this format work in > ebooks? Paul, I do not know exactly which format the book is provided in (and 'ebook' is of course not a single format, but a generic term). However, Adobe Digital Editions does work wi

Re: Binding to displayName

2008-10-05 Thread Ken Thomases
On Oct 5, 2008, at 3:55 AM, Gerriet M. Denkmann wrote: When the Inspector gets loaded I get: ... KVO autonotifying only supports -set: methods that return void. Autonotifying will not be done for invocations of - [MyDocument _setDisplayName:]. [...] Why does displayName complain? What am I

Re: wasting space?

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 1:54 AM, Quincey Morris <[EMAIL PROTECTED]> wrote: > It's worth noting that this whole approach (setting a field in the user > interface), though not wrong, is rather un-Cocoa-like. It would be much more > usual to define the count of characters as a numeric property (for exa

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 9:32 AM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: > Am 05.10.2008 um 00:36 schrieb Michael Ash: > >> On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: >> >>> Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. >>> >>> ... >>> In order to prevent my applicat

Re: Memory Leak in XIB file?

2008-10-05 Thread Michael Ash
On Sun, Oct 5, 2008 at 1:26 AM, Jens Beuckenhauer <[EMAIL PROTECTED]> wrote: > THE LEAK: It is a "GeneralBlock-48", of Event Type "Malloc" in > "libTIFF.dylib". The responsible caller is "setByteArray". The library and > "setByteArray" are not implemented by my self (so it must be Apple stuff). > A

Re: Cocoa Programming for Mac OsX Third Edition eBook search

2008-10-05 Thread Paul Bruneau
On Oct 5, 2008, at 5:51 AM, Howard Oakley wrote: On 05/10/2008 02:25, David Orriss Jr wrote: I ran into the same thing. Probably one of my biggest complaints about Addison is that the ebooks they do are digitally signed and that the ONE platform Acrobat reader doesn't support for digitally

[MEET] CocoaHeads Frankfurt, Mon Oct 6th 8pm

2008-10-05 Thread Torsten Curdt
This time we plan on having some hands-on iPhone sessions. In the spirit of NSCoder Nights please bring your code and projects. We will try to work together through some of the problems. And we will also celebrate the lifting of the NDA with some beers. http://cocoaheads.mixxt.de/networks/e

Re: wasting space?

2008-10-05 Thread Uli Kusterer
Thomas Schönfeld wrote: Now I am wondering, because it seems to me the "example" is "wasting code". I used the "example", but the "extra" method setoutString is kinda useless. After a bit thinking I did this (see below). I didn't use the "extra" method and it works fine. So my question i

Re: Can I put UTIs in NSFilesPromisePboardType promise drag array?

2008-10-05 Thread Jim Correia
On Oct 5, 2008, at 12:44 AM, Nathan Vander Wilt wrote: I'm not sure what you mean here. The documentation for promise drags says to encode the OSType using NSFileTypeForHFSTypeCode() which in my testing just turns the "characters" the programmer sees in their source into a string (ie 'uint'

Re: NSTableView confusion

2008-10-05 Thread Michael Babin
On Oct 4, 2008, at 2:32 PM, James Maxwell wrote: But I've got an even more mysterious problem now... My preferences window (the window I was working on) will only open once!... I'm totally baffled. I can open it once per run of the app, but if I close it, then it's gone for good. Totally fr

Re: Cocoa Programming for Mac OsX Third Edition eBook search

2008-10-05 Thread Howard Oakley
On 05/10/2008 02:25, David Orriss Jr wrote: > I ran into the same thing. Probably one of my biggest complaints > about Addison is that the ebooks they do are digitally signed and that > the ONE platform Acrobat reader doesn't support for digitally signed > ebooks (aside from a beta reader if you

Binding to displayName

2008-10-05 Thread Gerriet M. Denkmann
In a document based Tiger (10.4.11) app I have an Inspector.nib which has an NSObjectController with content = current MyDocument. It has an NSTextField (not editable) with value bound to selection.displayName When the Inspector gets loaded I get: ... KVO autonotifying only supports -set: m

Binding to @count

2008-10-05 Thread Gerriet M. Denkmann
In a document based Tiger (10.4.11) app I have @interface MyDocument : NSDocument { NSMutableArray *things; } Inspector.nib has an NSObjectController with content = current MyDocument and an NSTextField with value bound to [EMAIL PROTECTED] When the Inspector gets loaded I get: ...