Re: Accessing a property of a returned object?

2008-07-26 Thread Graham Cox
If a linked-list is the data structure that is the most natural fit, why not just use a linked list? (i.e. don't bother with NSArray etc). Objective-C is C, so you can do whatever you want - there's nothing to say to *have* to use Cocoa containers. I occasionally use classic linked lists in

Re: highlighted table column in nib

2008-07-26 Thread Nathan Kinsinger
On Jul 26, 2008, at 6:59 PM, James W. Walker wrote: When designing an NSTableView in IB, I can highlight one of the columns. That information is clearly stored in the file, because if I close and reopen, the highlight is still there. But after I load the nib, [myTable highlightedTableCol

IB view transitions, CA, NSWindow animation

2008-07-26 Thread Jacob Bandes-Storch
For a bit of background, I've got a window, and I'll be swapping its content view's subview between some other views. One (and more in the future) of the other views has a subview with "wants layer" set so it can use some CALayer stuff for fading and such. Now, when I switch between views f

Accessing a property of a returned object?

2008-07-26 Thread Mark Teagarden
Hi, I'm working on a strategy game in which a NSMutableArray called 'army' contains a series of Unit objects. Each Unit contains a property called next_unit, which is a pointer to the next unit in the array - I'm implementing a linked-list so that units can be moved sequentially. Army st

Re: creating a voice

2008-07-26 Thread Nathan Kinsinger
On Jul 26, 2008, at 5:03 PM, Charlie Dickman wrote: Can anybody direct me to documentation and or example code that explains/shows how to implement a voice for use in OS X? Charlie Dickman [EMAIL PROTECTED] http://developer.apple.com/DOCUMENTATION/UserExperience/Conceptual/SpeechSynthesisP

Re: unsigning NSNumber

2008-07-26 Thread Graham Cox
On 27 Jul 2008, at 2:48 am, Justin Giboney wrote: Multiply by -1 No, that's not the same as fabs(x). If the number is already +ve, *-1 it will make it -ve. fabs(x) makes -ve numbers +ve, but not vice versa. In any case you can't multiply NSNumber by anything - it's immutable. Graham __

Binding NSArrayController's objects to an NSTextView

2008-07-26 Thread John Joyce
I'm trying to learn to use bindings. Right now, I'm adapting the venerable RaiseMan example in the 3rd edition of Mr. Hillegass' book. Of course, in RaiseMan, the NSArrayController and the corresponding array and its objects are bound to a table view. What I'm trying to do is bind to an NSTextV

Re: memory management

2008-07-26 Thread Ken Thomases
On Jul 26, 2008, at 6:44 PM, Daniel Richman wrote: I just finished reading the docs on memory management and want to make sure I got everything right (for non-GC apps): 1) Any object returned by new, alloc, copy or any derivates (mutableCopy, etc.) is 'yours.' You must release/autorelease i

highlighted table column in nib

2008-07-26 Thread James W. Walker
When designing an NSTableView in IB, I can highlight one of the columns. That information is clearly stored in the file, because if I close and reopen, the highlight is still there. But after I load the nib, [myTable highlightedTableColumn] returns nil. Is there any way to get that nib-

creating a voice

2008-07-26 Thread Charlie Dickman
Can anybody direct me to documentation and or example code that explains/shows how to implement a voice for use in OS X? Charlie Dickman [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or

NSWindow resize problems

2008-07-26 Thread Jacob Ole Juul Kolding
Hello List I've implemented at main window in IB and set resize attributes for all my objects which works as desired, but I have two problems. First, when i maximize the app the objects in the window are resize but not placed properly. meaning that a large empty space resides in the left s

Re: (Newb question?) Launching app on dock icon file drop?

2008-07-26 Thread Jacob Ole Juul Kolding
I figured it out by adding CFBundleDocumentTypes CFBundleTypeExtensions CFBundleTypeName DocumentType

Unable to detect a NSRightMouseDown event using a three-button mouse?

2008-07-26 Thread Cloud Strife
Hi everyone. Maybe this issue is very odd, but I came across it indeed. I wrote an application using an override NSView to respond events trigged by users. Obviously, rewrite the -(void)mouseDown:(NSEvent* )theEvent is necessary. I want to test what button of mouse the user presses. So I want to ch

Re: memory management

2008-07-26 Thread Clark Cox
On Sat, Jul 26, 2008 at 4:44 PM, Daniel Richman <[EMAIL PROTECTED]> wrote: > Now let us suppose that I have a class Foo with instance variables V1 and V2 > (ints). If I were to create a class method: > > + (Foo *)fooWithV1:(int)a V2:(int)b { > > Foo *newFoo = [[Foo alloc] init]; > [newFoo setV1:a]

Re: memory management

2008-07-26 Thread Dave Carrigan
On Jul 26, 2008, at 4:44 PM, Daniel Richman wrote: I know this is convention. Should I not try to meddle with this, or may I not send the message [newFoo autorelease] if I note this clearly in the docs (this is a quite simple class that just stores two variables; it's intended for use only

Re: Getting process table info from within a Cocoa app

2008-07-26 Thread Ken Thomases
On Jul 26, 2008, at 12:58 AM, Sumner Trammell wrote: Hi. A daemon process is running independently of my Cocoa app. Given a pid file of the daemon process in a known location, say /var/run/ somedaemon.pid, I would like my Cocoa app to read that file and check the process table to see if the

Binding NSArrayController's objects to an NSTextView

2008-07-26 Thread John Joyce
I'm trying to learn to use bindings. Right now, I'm adapting the venerable RaiseMan example in the 3rd edition of Mr. Hillegass' book. Of course, in RaiseMan, the NSArrayController and the corresponding array and its objects are bound to a table view. What I'm trying to do is bind to an NSTextV

Re: CGDisplayBounds vs NSSCreen visibleFrame

2008-07-26 Thread Trygve Inda
The previous code was written in mail. Real code here: Given an CGDirectDisplayID for an auxScreen, get its frame in modern (0,0 is bottom left) coordinates. CGRect auxScreenRect = CGDisplayBounds (displayID); CGRect mainScreenRect = CGDisplayBounds (CGMainDisplayID ()); auxScreenRect.ori

Re: Decoding digital POCSAG / analog 5-tone (=selective call) sounds

2008-07-26 Thread Jaime Magiera
On Jul 26, 2008, at 7:36 PM, Joeles Baker wrote: Hi, i wonder if anyone of you ever tried decoding POCSAG (http://en.wikipedia.org/wiki/POCSAG ) sounds or 5-tone alarm sounds on the Mac. POCSAG is used for public radio transmissions (digital firefighter alarming system etc) and private radio

memory management

2008-07-26 Thread Daniel Richman
Hi All, I just finished reading the docs on memory management and want to make sure I got everything right (for non-GC apps): 1) Any object returned by new, alloc, copy or any derivates (mutableCopy, etc.) is 'yours.' You must release/autorelease it yourself. 2) Objects not returned by any

CGDisplayBounds vs NSSCreen visibleFrame

2008-07-26 Thread Trygve Inda
I have a 23" Cinema as my main display and a 17" PB as my secondary. The Cinema is arranged to the right of the PB. When I call NSScreen -visibleFrame on the secondary screen, I get a y origin of -774 but when calling CGDisplayBounds it is 924. The secondary screen height is 1050 and the height of

Re: NSTimer and a problem with document-based apps

2008-07-26 Thread Todd Heberlein
- (id)init { ... timer = [NSTimer scheduledTimerWithTimeInterval:10.0 ... } ... That new instance of course calls init, and suddenly I have two NSTimers running when I only wanted one timer for the whole app. I think you want to make your timer a global variable and then initialize it wi

Re: NSTimer and a problem with document-based apps

2008-07-26 Thread Clark Cox
On Sat, Jul 26, 2008 at 3:34 PM, Sumner Trammell <[EMAIL PROTECTED]> wrote: > Hi. I'm writing a Cocoa document-based app (using the Xcode template) that > uses a WebView and needs an NSTimer to trigger one of the methods every 10 > seconds in the MyDocument class. It sounds like you want a single

Re: QTKit Error loading DesktopVideoOut.component

2008-07-26 Thread Nick Zitzmann
On Jul 25, 2008, at 10:39 PM, chaitanya pandit wrote: 2008-07-26 00:34:31.173 diary[11433:813] Error loading /Library/ QuickTime/DesktopVideoOut.component/Contents/MacOS/DesktopVideoOut: dlopen(/Library/QuickTime/DesktopVideoOut.component/Contents/MacOS/ DesktopVideoOut, 262): no suitable im

NSTimer and a problem with document-based apps

2008-07-26 Thread Sumner Trammell
Hi. I'm writing a Cocoa document-based app (using the Xcode template) that uses a WebView and needs an NSTimer to trigger one of the methods every 10 seconds in the MyDocument class. In my init method, I set up the timer: @interface MyDocument : NSDocument { IBOutlet WebView *webView; NSTimer

Re: unsigning NSNumber

2008-07-26 Thread Steven Hamilton
Thanks all, fabs() is just what I need. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update

Re: CFSTR and double-double quotes

2008-07-26 Thread Michael Ash
On Sat, Jul 26, 2008 at 2:40 PM, Ivan Galic <[EMAIL PROTECTED]> wrote: > Hi, > > I've been writing a utility function for getting a path within the bundle > from the filename. For that, I used the function CFBundleCopyResourceURL, > which needs some CFStringRefs. I saw somewhere on the net an examp

Re: How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Joel Norvell
Phil, I'd add Google Code Search to the aforementioned. http://www.google.com/codesearch In its "advanced" mode you can stipulate that the match must be in Objective-C. Joel ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Pleas

NSTableview Datasource and NSPopupbuttonCell

2008-07-26 Thread Steven Hamilton
Hi Folks, I have a NSTableview with a datasource consisting of an NSArray of dictionaries. One column in my table has an NSPopupbuttonCell. The content and contentValues are bound to a Core Data "Account" object. I use a "name" property as my contentValue. I'm having trouble changing the

Re: CFSTR and double-double quotes

2008-07-26 Thread Greg
It's just padding it with zero's. "" = '\0' Which is probably why passing a variable didn't work. You can do this: char *yum = "fee" "fi" "fo" "fum"; And the compiler will concatenate that into: "feefifofum", but you can't do this: "asdf" somevar "poo" Because the compiler doesn't know t

CFSTR and double-double quotes

2008-07-26 Thread Ivan Galic
Hi, I've been writing a utility function for getting a path within the bundle from the filename. For that, I used the function CFBundleCopyResourceURL, which needs some CFStringRefs. I saw somewhere on the net an example like this: CFSTR("somefile") and it worked fine. However, when I pu

Re: unsigning NSNumber

2008-07-26 Thread Justin Giboney
Multiply by -1 > float val = [mySignedNumber floatValue]; > > NSNumber* myAbsoluteNumber = [NSNumber numberWithFloat:fabsf( val )]; > > (note NSNumber is immutable so you can't change what it contains to > remove the sign. You can create a new NSNumber with the absolute value > however). > > > hth

Re: NSNumber Formatter with percent?

2008-07-26 Thread Christopher Kane
On Jul 19, 2008, at 5:13 PM, Todd Heberlein wrote: I was working through Hillegass's latest book and chapter 8 has me applying an NSNumberFormatter to one of the columns of a table view. Unfortunately I get unexpected behavior when I modify one of the values in the column. For example, if I

Re: How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Shawn Erickson
On Sat, Jul 26, 2008 at 1:49 AM, Phil Faber <[EMAIL PROTECTED]> wrote: > If someone can recommend a searchable resource, the first thing I'll be > looking up is stringWithContentsOfFile:encoding:error: (I would have used > this as an example above but can't find an example of its usage!) google "

Re: How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Shawn Erickson
On Sat, Jul 26, 2008 at 1:49 AM, Phil Faber <[EMAIL PROTECTED]> wrote: > Can anyone direct me to an on-line resource that includes examples of how to > use specific Cocoa commands? I assume you have looked at Apple extensive API and conceptual documentation? The are available directly in Xcode e

Re: Spoiled by Java IDEs

2008-07-26 Thread William Squires
On Jul 19, 2008, at 7:36 AM, Jean-Daniel Dupas wrote: Le 19 juil. 08 à 14:20, Graham Perks a écrit : On Jul 18, 2008, at 6:38 PM, Ken Thomases wrote: Even better, I write a method, add it to the .h for me. Except not every method should be part of the class's interface. Ken, agreed, of

Re: Spoiled by Java IDEs

2008-07-26 Thread I. Savant
Proudly top-posting to annoy you all: It seems like someone brought this conversation over from the xcode- users list. Since the crux of the argument is about why Xcode should do this or that like other IDEs I humbly suggest this conversation should probably stay on the xcode-users list

Re: How to locate coding examples for specified commands

2008-07-26 Thread I. Savant
On 26 Jul 2008, at 11:33, Phil Faber wrote: Can anyone direct me to an on-line resource that includes examples of how to use specific Cocoa commands? (Are things like - (NSString *)capitalizedString called 'commands' or should I call them something else?) It's often so much easier to understa

Re: Spoiled by Java IDEs

2008-07-26 Thread William Squires
On Jul 18, 2008, at 1:45 PM, Jens Alfke wrote: On 18 Jul '08, at 7:18 AM, Graham Perks wrote: I too l sorely miss the completion tools. Add a method prototype, it should absolutely kick out a stub. Copy and paste? What?? Even better, I write a method, add it to the .h for me. There are

Re: How to locate coding examples for specified commands

2008-07-26 Thread julius
On 26 Jul 2008, at 11:33, Phil Faber wrote: Can anyone direct me to an on-line resource that includes examples of how to use specific Cocoa commands? (Are things like - (NSString *)capitalizedString called 'commands' or should I call them something else?) It's often so much easier to understa

Re: unsigning NSNumber

2008-07-26 Thread Graham Cox
float val = [mySignedNumber floatValue]; NSNumber* myAbsoluteNumber = [NSNumber numberWithFloat:fabsf( val )]; (note NSNumber is immutable so you can't change what it contains to remove the sign. You can create a new NSNumber with the absolute value however). hth, Graham On 23 Jul 200

unsigning NSNumber

2008-07-26 Thread Steven Hamilton
Hi folks, Can anyone tell me the most efficient way to unsign a floatvalue in an NSNumber? Like change a -1.47 to 1.47 ? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: unsigning NSNumber

2008-07-26 Thread Phil
On Wed, Jul 23, 2008 at 12:20 AM, Steven Hamilton <[EMAIL PROTECTED]> wrote: > Can anyone tell me the most efficient way to unsign a floatvalue in an > NSNumber? > > Like change a -1.47 to 1.47 ? > fabsf(3) Phil

Re: unsigning NSNumber

2008-07-26 Thread Ron Fleckner
On 22/07/2008, at 10:20 PM, Steven Hamilton wrote: Hi folks, Can anyone tell me the most efficient way to unsign a floatvalue in an NSNumber? Like change a -1.47 to 1.47 ? Thanks // Below reverses the sign of, in this case, a float float y, x; y = x = -12.0;

Re: Retrieving the current -[NSShadow set]

2008-07-26 Thread Keith Duncan
That's actually the original question. How does one do this? Go look at the bits you removed again. That isn't the finished code. I need an explicit pointer to the shadow so that I can manipulate it and set another, different shadow; based on the first. As Graham initially pointed out Qu

Re: Repositioning a content view w/in a window

2008-07-26 Thread Michael Ash
On Fri, Jul 25, 2008 at 11:08 PM, Henry McGilton (Starbase) <[EMAIL PROTECTED]> wrote: > On Jul 25, 2008, at 6:50 PM, Michael Ash wrote: >> >> In fact I would go so far as to say that if you ever use >> -setContentView:, you are very probably doing it wrong. It is, for the >> most part, not a very

unsigning NSNumber

2008-07-26 Thread Steven Hamilton
Hi folks, Can anyone tell me the most efficient way to unsign a floatvalue in an NSNumber? Like change a -1.47 to 1.47 ? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the l

Re: How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Omar Qazi
On Jul 26, 2008, at 1:49 AM, Phil Faber wrote: Can anyone direct me to an on-line resource that includes examples of how to use specific Cocoa commands? http://www.cocoadev.com/ is a good one. (Are things like - (NSString *)capitalizedString called 'commands' or should I call them someth

Re: NSSpeechSynthesizer delegate method not called in OCUint

2008-07-26 Thread Omar Qazi
On Jul 25, 2008, at 6:14 PM, Sean DeNigris wrote: Hi, I'm using OCUnit injected into my project executable in xCode to test a class that contains an NSSynthesizer. The following didFinishSpeaking method gets called when I run the app normally, but not in the test. This is because, ostensi

How to locate coding examples for specified commands [Newbie]

2008-07-26 Thread Phil Faber
Can anyone direct me to an on-line resource that includes examples of how to use specific Cocoa commands? (Are things like - (NSString *)capitalizedString called 'commands' or should I call them something else?) It's often so much easier to understand how it works by seeing an example.