Re: Audio APIs [Carbon is C++?]

2010-03-01 Thread Paul Bruneau
On Mar 1, 2010, at 12:22 PM, Jens Alfke wrote: IMHO the worst problem with CoreAudio isn't what language it's in, but that the APIs don't form a coherent framework, rather a patchwork of complex procedural interfaces plus a pile of undocumented, mostly-unsupported and poorly-structured

Re: Carbon is C++?

2010-02-28 Thread Paul Bruneau
On Feb 28, 2010, at 1:20 AM, Ian Joyner wrote: Carbon was originally Pascal based, at least as far as the APIs. It does not essentially matter what it is written in, just what APIs it supports. If it has been rewritten in C++ (are they mad?), that should make no difference to whatever

Re: Carbon is C++?

2010-02-28 Thread Paul Bruneau
That is excellent and I really like the sound of it. Someone please inform the authors of Apple's iPhone sample code so that I won't have to deal with C++ anymore! (I'm looking at YOU, SpeakHere!) On Feb 28, 2010, at 10:24 PM, Erik Buck wrote: I disagree. I have written very low latency

Re: Application Menu - Preferences

2010-02-24 Thread Paul Bruneau
On Feb 24, 2010, at 3:28 PM, David Blanton wrote: In an NSDocument app where should or how should the Application Preferences menu item be connected? This is kind of old, and its main focus is bindings, but it gives you everything you need I think

Re: Application Menu - Preferences

2010-02-24 Thread Paul Bruneau
On Feb 24, 2010, at 3:58 PM, David Blanton wrote: Good Tip. Thanks. What I was really getting at is how to set the target / action for when the item is selected. Here is what I did, so if this is way off base please let me know. I sub-classed NSMenuItem and set the Preferences menu

Re: View Handling

2010-01-23 Thread Paul Bruneau
I used this method on the app I'm currently working with and it is great. I can offer two tips. The first is make the tabs be visible in IB because then it's so much easier to switch between them in IB. Then in awakeFromNib you can make the tabs be invisible. The first tip is that I found that

Re: NSDictionary trouble

2010-01-19 Thread Paul Bruneau
On Jan 19, 2010, at 11:53 AM, Shawn Rutledge wrote: I wish NSDictionary (NSMutableDictionary actually) could handle arbitrary mappings of one type of object to another, without copying the keys. A string makes a good key most of the time but what about the case where you want to do the

Re: if statement causing 32 Byte leak?

2010-01-09 Thread Paul Bruneau
-new is the equivalent of an -alloc and -init, so you already own the object at that point. Then you retain it, so I think that's more retaining than you want to do. That's my guess Sent from my iPhone--typos caused by auto-correct On Jan 9, 2010, at 8:15 PM, Mr. Gecko grmrge...@gmail.com

Re: iPhone: validate a NSString for US zipcode

2010-01-07 Thread Paul Bruneau
I'm a little unclear what you are asking, but I'll tell what I know. You just want to know if a 5 digit zip code is a valid one? Or do you want to compare it to the list of valid city names that are assigned to it? (yes it can be more than one, ugh) They are (from a non-USPS point of view)

Re: iPhone: validate a NSString for US zipcode

2010-01-07 Thread Paul Bruneau
On Jan 7, 2010, at 12:29 PM, David Duncan wrote: Given that you would likely want to do this test with a binary search I don't see any reason why it should be slow (effectively you can do the entire search with about 17*k compares). To help make this thread more Cocoa-y, I would like to

Re: Why is [NSArray arrayWithObjects:] failing for me?

2010-01-04 Thread Paul Bruneau
On Jan 4, 2010, at 7:58 AM, Charles Jenkins wrote: On 2010-01-03 00:08, Eric Smith wrote: Correct, do not release the array. If you don't create it with init, or retain it, then you should not release it. Eric, thank you for stating that rule. It should be easy enough to remember and

Re: button cell - selection change timing

2009-12-27 Thread Paul Bruneau
On Dec 27, 2009, at 9:00 PM, Rainer Standke wrote: Hello all, I have a table view with a column that holds a button cell. When the user clicks the button I need to open a web browser with an URL that is stored in the object represented by the table view's row. All of this is in a Core

Re: button cell - selection change timing

2009-12-27 Thread Paul Bruneau
On Dec 27, 2009, at 9:21 PM, Rainer Standke wrote: Sure. Here is what happens in the method targeted by the button. From the tableview ( = sender) it gets the first column, from that it gets the array controller behind the column, from that it gets the selection and finally it gets the

Re: Adding sub menus programatically

2009-12-24 Thread Paul Bruneau
On Dec 24, 2009, at 4:25 AM, Michael Davey wrote: Hi, I have googled around but have found nothing that can help me with this... I have a menu in my application that I wish to add sub items to programatically. I have the Menu itself connected up and I can add NSMenuItems to it just

Dependent values that are not iVars

2009-12-18 Thread Paul Bruneau
I would like to know the correct way to implement a non-stored value that is dependent on members of a collection. I am setting up the object that holds the dependent value as an observer of the individual members of the collection like this: [theFrameModule addObserver:self

Re: Dependent values that are not iVars

2009-12-18 Thread Paul Bruneau
On Dec 18, 2009, at 2:08 PM, Quincey Morris wrote: This is a situation where you use willChangeValueForKey:/ didChangeValueForKey: - (void)observeValueForKeyPath:(NSString *)keyPath ofObject: (id)object change:(NSDictionary *)change context:(void *)context { if

Re: Dependent values that are not iVars

2009-12-18 Thread Paul Bruneau
On Dec 18, 2009, at 2:28 PM, Kyle Sluder wrote: On Fri, Dec 18, 2009 at 11:18 AM, Paul Bruneau paul_brun...@special-lite.com wrote: if ([keyPath isEqualToString:kOverallWidth]) { [self willChangeValueForKey:@overallWidth]; NSLog(@got

Re: Dependent values that are not iVars

2009-12-18 Thread Paul Bruneau
On Dec 18, 2009, at 2:56 PM, Kyle Sluder wrote: On Fri, Dec 18, 2009 at 11:48 AM, Paul Bruneau paul_brun...@special-lite.com wrote: Ugh, so I guess you are saying that derived properties are not trustworthy in this usage? No, just that if you don't actually change the value, KVO might

Re: Best way to hook into the run loop?

2009-12-06 Thread Paul Bruneau
). Incidentally I have reported this bug but it came back as a dupe. It's been there since I started with Cocoa, on 10.2. I ran into the same problem and my bug was also flagged as a duplicate. Here is my submission which includes my workaround: 14-Aug-2008 09:31 AM Paul Bruneau: * SUMMARY When

Re: NSPopUpButton questions

2009-12-06 Thread Paul Bruneau
On Dec 6, 2009, at 12:29 PM, Andy Lee wrote: On Dec 6, 2009, at 11:34 AM, Matt Neuburg wrote: On Sat, 5 Dec 2009 20:29:25 -0500, timm...@gmail.com timm...@gmail.com said: The Apple docs for NSPopUpButtons says to avoid accessing it's NSMenu directly because it may need to do housekeeping.

Drawing: The Right place to keep bounds

2009-11-25 Thread Paul Bruneau
I'm really trying to do things correctly with my app but I'm at a place where I can't figure out what correct is, and all my best examples do it wrong (I think). I am working on the drawing parts of my app. In my last app I most definitely did things Wrong but they work fine and there's

Re: Drawing: The Right place to keep bounds

2009-11-25 Thread Paul Bruneau
, in this case). When the model data is all about visual information (drawing), then you have no choice but to violate the rule. On Nov 25, 2009, at 7:27 AM, Paul Bruneau wrote: I am also pretty sure that Cocoa Design Patterns does it wrong because it admits such: The model in this example

Re: Drawing: The Right place to keep bounds

2009-11-25 Thread Paul Bruneau
On Nov 25, 2009, at 11:24 AM, Jens Alfke wrote: On Nov 25, 2009, at 7:27 AM, Paul Bruneau wrote: I think I recognize, and I am pretty sure I have read that Sketch does things Wrong. I see that the shape objects keep their own bounds (and frame?) information. It seems clear to me

Re: NSValueTransformer problem with NSTextField update

2009-11-10 Thread Paul Bruneau
does get updated in the table (again, thanks Bindings). It seems like other people would have had issues with this, but sometimes I do things differently than other people :) On Sep 17, 2009, at 2:15 PM, Paul Bruneau wrote: Greetings- I have written a subclass of NSValueTransformer which

Re: Best pattern for similar objects with differences

2009-11-09 Thread Paul Bruneau
4, 2009, at 1:47 PM, Paul Bruneau wrote: Hi- I'm in early development of an app (non-core data, NSDocument app) that will deal with a lot of doors. I have created a door object, SLDoor, which currently contains all of the properties that might be used by any of the several types of doors

Best pattern for similar objects with differences

2009-11-04 Thread Paul Bruneau
Hi- I'm in early development of an app (non-core data, NSDocument app) that will deal with a lot of doors. I have created a door object, SLDoor, which currently contains all of the properties that might be used by any of the several types of doors. There is a doorType property which is

Bindings, am I doing right by MVC?

2009-10-23 Thread Paul Bruneau
I'm trying to do things correctly in my new app that I am writing, so I wanted to ask this question because I'm not sure if I am. I have a window for a door object in my document (NSDocument based app). It's a good thing I don't work for a window company or things would be really

Re: Binding hidden attribute

2009-10-12 Thread Paul Bruneau
Yes, I have recently learned how to do this for my under development app. Here is the IB part, pretty straightforward (File's Owner (a controller class) has a door object with a derived fake ivar called isMonumental: inline: pastedGraphic.png The tricky part in your case (and mine)

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
displayed (the cleaned up, doubly-transformed string) In textfield: 1. type: 1 1/2 2. press return 3. 1 1/2 is displayed (no change) 4. press undo 5. press redo 6. 1-1/2 is displayed (the cleaned up, doubly-transformed string) Any help appreciated On Sep 17, 2009, at 2:15 PM, Paul Bruneau wrote

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 9:47 AM, Graham Cox wrote: I don't have a definitive answer for you, but I've observed similar behaviour in some of my text fields. As long as you're typing, what you type is what the field will display. On enter/return, the value is sent to the data model, through the

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 10:45 AM, I. Savant wrote: Have you tried turning on the text field's value binding's continuously updates value option? Maybe even the validates immediately option? I imagine the wrong combination of these (including off) could have something to do with it. Thanks for

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 11:10 AM, I. Savant wrote: On Oct 1, 2009, at 10:58 AM, Paul Bruneau wrote: Thanks for the suggestion, IS. I had in fact tried those and I tried them again just now (in all combinations), no change. Hmmm ... This (figure 2): http://developer.apple.com/mac/library

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 1:23 PM, I. Savant wrote: As Quincey mentioned, it's probably because the data cell for that column (the prototype that's reused to draw that column's value for each row) is being updated per row, which involves reading that value and setting it as the cell's object

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 2:16 PM, Quincey Morris wrote: What was the number you tried this with? Some NSNumber values are singleton objects, so returning a new NSNumber with the same value might really return the original object. :) Or maybe just equality of value matters. It occurs to me that

Re: NSValueTransformer problem with NSTextField update

2009-10-01 Thread Paul Bruneau
On Oct 1, 2009, at 3:34 PM, I. Savant wrote: The problem is, I think, that most developers aren't overloading the input as you are. :-) I knew this would come up! :) But in actuality, this same problem would occur regardless of whether I was overloading the input. Even in the very

Re: Best way to implement drag and drop for multiple types of nstableview

2009-09-28 Thread Paul Bruneau
On Sep 25, 2009, at 12:19 PM, I. Savant wrote: Paul: Unless I'm missing something, why not add properties to your array controller class that keeps track of the desired types? If you use multiple tables for the same array controller instance, you could get even fancier and keep an

Best way to implement drag and drop for multiple types of nstableview

2009-09-25 Thread Paul Bruneau
Hi- I have used mmalc's DNDArrayController class from his Bookmarks example code to implement drag and drop for one of my NSTableViews. Of course it works great. But now I would like to set up a couple other table views with other types of data. I can re-use my DNDArrayController, but

NSValueTransformer problem with NSTextField update

2009-09-17 Thread Paul Bruneau
Greetings- I have written a subclass of NSValueTransformer which converts an NSString from something like 1-1/2 to an NSNumber with a value of 48 for my model to store (converts inches and fractions to number of 32nds). It also does the reverse transformation. This is working perfectly

Re: Mac Mini or iMac for Cocoa Development?

2009-09-13 Thread Paul Bruneau
The iMac is so much prettier plus can drive a second display. Refurb store = $999 or even sometimes $849 ones show up. On Sep 13, 2009, at 3:53 PM, Michael Rogers wrote: Hi, All: I've been given a short deadline for choosing between a Mac Mini or iMac for Cocoa development (especially

Model objects to NSUndoManager--am I doing it right?

2009-08-20 Thread Paul Bruneau
Hi all- I'm just starting my first real document-based Cocoa app. My other app was non-document based and the undo system was quite different (plus I know I did some things wrong MVC-wise in that app). The documentation I have read tells me that I should implement undo in the Setter

Re: Advice on building a complex user custom control

2009-03-02 Thread Paul Bruneau
On Mar 1, 2009, at 8:22 PM, Oliver Charles wrote: At the moment, I have a main MapView control, which creates vertices in an NSArrayController. I have 2 ways of viewing these vertices - one is to handle rendering them directly in the MapView, and another approach creates a new VertexView for

Re: NSCaledarDate's deprecation

2009-01-24 Thread Paul Bruneau
Please excuse this possibly dumb question but here it is: Why spend so much time and effort to remove some code that is going to keep running fine for years? The class isn't even deprecated yet. It's in this weird going to be deprecated limbo. How many years does it take between when

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Paul Bruneau
On Jan 19, 2009, at 2:49 AM, Kyle Sluder wrote: 3) You've over-architected your drawing code. Typically the fewer objects that are responsible for drawing (i.e. view objects) the better. Situations like the one you're describing often arise from making model objects responsible for their own

Re: Dealing with exceptions in a drawing stack

2009-01-19 Thread Paul Bruneau
On Jan 19, 2009, at 2:08 PM, Quincey Morris wrote: I don't get this at all (not just the quoted comments, but going all the way back to Graham's original statement). -- If a failure in the drawing code destroys the *data model* (thereby preventing it from being saved) then there's

Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread Paul Bruneau
On Jan 12, 2009, at 12:19 AM, Gami Ravi wrote: Hi All, I want to create custom control that looks like a multiple monitor control that manages monitors on Mac. The custom control should allow the rectangle dragging and resizing same way we are moving monitor rectangle can be moved. If

Re: create custom control same as multiple monitor control that manages monitors windows

2009-01-12 Thread Paul Bruneau
On Jan 12, 2009, at 10:54 AM, I. Savant wrote: On Mon, Jan 12, 2009 at 10:48 AM, Paul Bruneau paul_brun...@special-lite.com wrote: The way I did a similar thing (and I think this is the standard way) was to create a custom NSView subclass to draw the control. Well ... the *standard* way

Date Formatter year input without year display

2008-12-10 Thread Paul Bruneau
Hi- I ran into a problem with my production scheduling application as the new year approached. In IB I am using a 10.0 date formatter bound to NSDate properties of a model object. I used: %1m/%1d, %1I:%M%p which gave me something like: 12/23, 12:30PM This was used mostly for display,

Re: a newbie question

2008-11-11 Thread Paul Bruneau
On Nov 11, 2008, at 3:16 PM, Etienne Guérard wrote: Maybe it's an illustrative example, not a real one. Anyway you'd better stick to NSObject. Object is used to implement the metaclass class hierachy inside the ObjC runtime. You normally don't play with it. ;) It is a real example, but it

Re: Path handling routines

2008-10-29 Thread Paul Bruneau
On Oct 29, 2008, at 9:01 AM, Daniel Luis dos Santos wrote: Hello, Are there in the Foundation framework (or anywhere else on the Cocoa platform) path handling routines (directory extraction, path decomposition) ? Cheers There are a group of methods in NSString for working with paths.

Re: what do you use to make icons and similar?

2008-10-19 Thread Paul Bruneau
On Oct 19, 2008, at 12:09 PM, Ricky Sharp wrote: I will disagree here. It was so worth the effort to move all my bitmapped images to vector-based artwork. I got beautiful scaling from 0.5 to 3.0x to include non-integral scaling factors. In terms of the statement cannot vectorize a raster

Re: Strategy for naming support folder

2008-10-11 Thread Paul Bruneau
On Oct 10, 2008, at 3:31 AM, Graham Cox [EMAIL PROTECTED] wrote: Why is anyone poking around in there? (Not a rhetorical question, I'm interested in knowing what people do visit that folder for) Since you ask, in my one-user, non-document-based scheduling app, I keep the data file in there

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

Re: Object change to NSView update

2008-08-25 Thread Paul Bruneau
On Aug 22, 2008, at 9:44 PM, Graham Cox wrote: Keep all of the tree stuff in your data model. When you need to refresh any given item, flag that to your parent item, which flags that to its parent item and so on back to the root. The root object could have one or more controllers which in

Object change to NSView update

2008-08-22 Thread Paul Bruneau
I feel I can nearly grasp what I need to do, but not quite. I know what I shouldn't be doing--which is what I am doing and I feel I'm a little in the weeds. I seek a nudge in the right direction if someone can help. I have a master-detail setup with a normal table displaying a list of

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 11:09 AM, Jonathan del Strother wrote: How about having the object post an NSNotification whenever it's changed? Your controller can observe the notification call setNeedsDisplay accordingly. If you're posting a lot of notifications at the same time, you might look at

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 12:09 PM, Kyle Sluder wrote: On Fri, Aug 22, 2008 at 10:58 AM, Paul Bruneau [EMAIL PROTECTED] wrote: I am forcing the view to update after a change to one of the order step objects in what I am sure is The Wrong Way™ by basically chucking setNeedsDisplay into areas of my

Re: Object change to NSView update

2008-08-22 Thread Paul Bruneau
On Aug 22, 2008, at 11:19 AM, Graham Cox wrote: On 23 Aug 2008, at 12:58 am, Paul Bruneau wrote: I think I could maybe (maybe!) figure out how do this for the order (the table's selection), but I am totally lost as to how I would do it for the order's great-grandchildren order steps

Separating elements in an NSView subclass

2008-08-08 Thread Paul Bruneau
Hi- Some time ago I got some great advice to help me optimize the refresh rate of my NSView subclass (the answer is, just draw the minimum that you need to). So I am working to do this, but I am having some trouble with the inter-dependence of various elements that appear in my view.

Re: Separating elements in an NSView subclass

2008-08-08 Thread Paul Bruneau
On Aug 8, 2008, at 8:54 AM, Graham Cox wrote: Are you checking the view's -needsToDrawRect: when you actually iterate through your rectangles? For a view like this it will be essential to avoid drawing anything that doesn't need drawing - even checking thousands of rects for intersection

Re: cocoa mentoring (was Re: Bypassing Interface Builder)

2008-05-15 Thread Paul Bruneau
On May 15, 2008, at 9:36 AM, Torsten Curdt wrote: I have been thinking about BigNerdRanch. It would have been a great start ...but I guess now I would be more interested in advanced topics. Although Big Nerd Ranch's Cocoa Bootcamp is great for people just starting in Cocoa, it does

Re: Getting line numbers from an NSString

2008-04-11 Thread Paul Bruneau
On Apr 11, 2008, at 1:23 PM, allan greenier wrote: Greetings, Have I missed this somewhere in the Cocoa - Foundation api? If I have an NSString that is multi lined (say in contains \n characters) is there an api call so I can get line 0, line 1, ect? Or should I just code that myself? Hi

Re: Garbage collection - was Beginner with Cocoa

2008-03-25 Thread Paul Bruneau
On Mar 25, 2008, at 6:01 PM, Jack Repenning wrote: On Mar 25, 2008, at 2:06 PM, Scott Ribe wrote: There's a *very* simple set of rules to follow regarding retain/ release. Yes, but where are they documented? Or, if they're so simple, can you quote them here? Not to sound querulous, but

Re: NSSpeechSynthesizer/UKSpeechSynthesizer speechSynthesizer:didFinishSpeaking: called immediarely

2008-03-13 Thread Paul Bruneau
On Mar 13, 2008, at 5:27 AM, Ben Lachman wrote: According to the NSSpeechSynthesizer docs: speechSynthesizer:didFinishSpeaking: is invoked when the speaking of the string ends. The second parameter of this method indicates whether the text was entirely spoken or was disrupted (as might

Re: Finding a relative date

2008-02-26 Thread Paul Bruneau
I am sympathetic to using NSCalendar. At his Boot Camp, Aaron told me that NSCalendarDate was falling out of favor because it's not a good player regarding calendars other than Gregorian. I understand this. However, the documentation really doesn't provide any direction as to this for a