Re: NSTableView live resizing glitch

2009-03-12 Thread Chris Suter
Hi Ulai, On Fri, Mar 13, 2009 at 9:33 AM, Ulai Beekam wrote: > I'm having an NSTableView live resizing glitch that is driving me nuts. > Please see this image: > > > http://img15.imageshack.us/img15/2012/picture1tcz.png > > > I really need to have the column width independent of the table view'

Re: NSTableView live resizing glitch

2009-03-12 Thread Chris Suter
Hi Corbin, On Fri, Mar 13, 2009 at 10:06 AM, Corbin Dunn wrote: > That's doing too much redraw work :) I was aware that may be the case but it didn't matter for my needs; the performance is perfectly adequate for me. > Please do log bugs when you run into these issues. I did back in August 20

Re: Fast dictionary with integer keys?

2009-03-15 Thread Chris Suter
Hi Clark, > If your keys are integers, then you've got the best hash function > possible: the identity function :) I know what you mean, but that's not strictly speaking true. If your integers were congruent modulo your hash table size, it wouldn't be a very good hash function. Regards, Chris _

Re: Double Initialize - is that how it should be?

2009-03-16 Thread Chris Suter
Hi Steve, On Tue, Mar 17, 2009 at 1:21 PM, Steve Cronin wrote: > Folks; > > I use an object in my application called 'appDelegate'; it's a subclass of > NSObject. > > I instantiate this object in the main Nib file > This object has  IBActions for the main menu and since it is -app delegate > it i

Avoiding Flicker with OpenGL View when Moving Divider of a Split View

2009-03-21 Thread Chris Suter
Hi all, I have a split view arranged horizontally with an OpenGL view in the right pane (surrounded by some other stuff). When I move the divider, there is a flicker on the right hand side of the OpenGL view. You don’t get this glitch if you resize the window. It's not a major issue, just a bit an

Re: Measuring time between keypresses?

2009-03-31 Thread Chris Suter
On Wed, Apr 1, 2009 at 12:27 PM, Debajit Adhikary wrote: > I'm trying to write an app where I need to accept keypresses, and call > a function whenever the user has stopped typing (or when there is a > specified delay between keystrokes). > > How do I measure the time between two keystrokes? Have

Re: How do I time a Cocoa app?

2009-03-31 Thread Chris Suter
On Wed, Apr 1, 2009 at 12:53 PM, Debajit Adhikary wrote: > What is an easy way to time a Cocoa application? (Alternatively, any > good way to measure performance would suffice). > > (I have two different frameworks and would like to compare their > performances over some fixed input data) Google:

Re: NSMutableArray is null?

2009-03-31 Thread Chris Suter
On Wed, Apr 1, 2009 at 1:12 PM, Pierce Freeman wrote: > Whoops, sorry I didn't put that in... > > @interface Example_Class : NSObject { > >    IBOutlet NSTableView *tableView; >    NSMutableArray *globalVariable; > } :-D You still haven't put it in! Where do you set globalVariable to something?

Re: NSMutableArray is null?

2009-03-31 Thread Chris Suter
On Wed, Apr 1, 2009 at 1:16 PM, Pierce Freeman wrote: > The global variable is in the Controller.h... Is this what you are asking > for? Unless you set globalVariable to something (I do hope you haven't actually called it that BTW), it will remain nil forever. Messages to nil will yield nil. We'

Re: NS <-> CG Rect Conversion and screen coordinates

2009-03-31 Thread Chris Suter
Hi Trygve, 2009/4/1 Trygve Inda : > Using these two calls: > > NSRect nsRect = [screen frame]; > CGRect cgRect = CGDisplayBounds (displayID); > > I get for my two screens: > > NS    x=0        y=0      w=2560    h=1600  // screen A > CG    x=0        y=0      w=2560    h=1600 > > NS    x=-1920    

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Suter
Hi Marcel, On Fri, Apr 3, 2009 at 10:37 AM, Marcel Weiher wrote: > So the compiler also disagrees with you that these are the same type.  You > can *cast* them to be compatible, but they are not the same type. Right, but the original question was about figuring out what they are at runtime whic

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Suter
Hi Marcel, On Fri, Apr 3, 2009 at 11:06 AM, Marcel Weiher wrote: > As I explained, Did you? > it is trivially possible, because the only Objective-C class > that is the same as its underlying CFType is NSCFArray.  So a simple test > would be  [object class] == [NSCFArray class]. Right. So som

Re: Toll-free bridge type at runtime

2009-04-02 Thread Chris Suter
Hi Marcel, [snip] > However, that does not mean that they are the same. They are the effectively the same and I couldn't see anything in your e-mail that proves otherwise. You appear to have proven that a subclass of NSArray doesn't happen to be a descendent NSCFArray (nobody asked that though)

Re: Puzzling run loop/autorelease pool question

2009-04-05 Thread Chris Suter
Hi m, On Mon, Apr 6, 2009 at 8:21 AM, m wrote: > I've uploaded a project that demonstrates the problem to > > The problem is that you set-up your callback and your actual callback is all via C; it's not an Objective-C interface so it makes no guar

Re: Puzzling run loop/autorelease pool question

2009-04-05 Thread Chris Suter
Hi Michael, On Mon, Apr 6, 2009 at 9:50 AM, Michael Ash wrote: > On Sun, Apr 5, 2009 at 5:11 PM, m wrote: > The workaround is easy. What you're doing is fine, or you can post a > fake NSEvent, or something similar. Pretty much up to you. Whilst that approach will probably work for ever, I stil

Re: Non-pageable app

2009-04-05 Thread Chris Suter
Hi Finlay, On Sun, Apr 5, 2009 at 6:47 AM, Finlay Dobbie wrote: > -- > Indeed, many types of data, such as hashes, unencrypted versions of > sensitive data, and authentication tokens, should generally not be > written to disk due to the potential for abuse. This raises an > interesting problem.

Re: Suppressing variable hiding warning in Xcode

2009-04-05 Thread Chris Suter
Hi Brad, On Mon, Apr 6, 2009 at 10:10 AM, Brad O'Hearne wrote: > I had a few questions about selectively suppressing a certain warning in > Xcode. I personally find the warning which pertains to local variables > hiding instance variables a real nuisance. For example, if you have a > message sig

Re: Non-pageable app

2009-04-05 Thread Chris Suter
Hi Kyle, On Mon, Apr 6, 2009 at 4:03 PM, Kyle Sluder wrote: > On Sun, Apr 5, 2009 at 8:07 PM, Chris Suter wrote: >> What am I missing? > > If the attacker physically powers off the machine while the page is > written out to disk, s/he can just read the page off the swap space

Re: sending email form Cocoa app using Mail

2009-04-15 Thread Chris Suter
Hi Reza, On Wed, Apr 15, 2009 at 9:06 PM, Reza Farhad wrote: > I want to update my app from using  NSMailDelivery to using scripting Bridge > with Mail to take care of all my emailing from my Cocoa app. I just have > this question, what happens if the user is not using Mail and has only setup >

Re: Best technology to use for overlays?

2009-04-24 Thread Chris Suter
Hi Daniel, On Fri, Apr 24, 2009 at 9:07 PM, Michael Ash wrote: > If you want to use the same back-end as window compositing, why not > use actual window compositing? Create a borderless NSWindow, make it a > child window, and position it appropriately. In my opinion, you're better off having a

Re: Best technology to use for overlays?

2009-04-24 Thread Chris Suter
Hi Michael, On Fri, Apr 24, 2009 at 9:38 PM, Michael Ash wrote: > If your overlay is known about in advance, the solution to the timing > window is easy: load and position it immediately, when you load the > parent window, even if you don't need it yet. You can fill it with > nothing so that it'

Re: Best technology to use for overlays?

2009-04-24 Thread Chris Suter
Hi Michael, And I've just thought of more things that are awkward with child windows: handling events and accessibility. Regards, Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to

Re: How to clone a mutable dictionary

2009-04-24 Thread Chris Suter
Hi Graham, On Fri, Apr 24, 2009 at 6:49 PM, Graham Cox wrote: > Incidentally this makes a very useful basic category on NSDictionary, one > that every Cocoa programmer is likely to need sooner or later. Here's mine: [snip] You could also use CFPropertyListCreateDeepCopy. Just remember to call N

Re: Fill box with repeating text

2009-04-24 Thread Chris Suter
Hi Trygve, 2009/4/25 Trygve Inda Makes the text transparent, but I can't seem to make the background of the > NSImage transparent. I want to end up with white text on a transparent > background, but [[NSImage alloc] initWithSize:[theString size]] seems to > set > the background to solid white. >

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Chris Suter
Hi Colin, On Tue, May 5, 2009 at 9:50 AM, Colin Cornaby wrote: > I'm dealing with some code that returns results out of order, but the > results contain the proper index. In the end, I'd like to put them all into > an NSArray, but unlike a C array, NSArray doesn't seem to allow me to simply > res

Re: A couple NSRunLoop questions

2009-05-04 Thread Chris Suter
Hi Miles, On Tue, May 5, 2009 at 11:54 AM, Miles wrote: > 1) I have a timer on a run loop. Every so often I invalidate the timer which > as I understand it should remove the run loop as well. No, invalidating a timer just removes it as a source from the run loop. > At a later time I > start a n

Re: TCPServer Example

2009-05-04 Thread Chris Suter
On Tue, May 5, 2009 at 6:58 AM, Development wrote: > I'm using parts of the TCPServer example code from apple. It's fairly > straight forward code however I have a problem. > > in the method:- (void)handleNewConnectionFromAddress:(NSData *)addr > inputStream:(NSInputStream *)istr outputStream:(NSO

Re: Tools in App Bundles

2009-05-19 Thread Chris Suter
Hi Kevin, On Tue, May 19, 2009 at 8:04 PM, Kevin LaCoste wrote: [snip] > If I understand that correctly, my tool is in the correct place but I'm not > confident. Should it be in "Contents/MacOS" Yes. > or should I add a "Contents/Executable" folder? No. > Bonus question. Is the support direct

Re: Tools in App Bundles

2009-05-19 Thread Chris Suter
Hi Kevin, On Wed, May 20, 2009 at 4:28 PM, Kevin LaCoste wrote: > Thanks for the link. Now the question becomes, if we move helper tools into > a new Contents/Helpers folder are they covered by codesign? No, it wouldn't be covered by codesign. codesign has some built-in rules that specify what i

Re: Tools in App Bundles

2009-05-20 Thread Chris Suter
Hi Kevin, On Wed, May 20, 2009 at 4:43 PM, Chris Suter wrote: [snip] > These are the default rules: > > ^Resources/.*\.lproj/ > >    optional >     >    weight >    1000 > Sorry, the default rules are more than just that. Have a look at the end of a generated CodeRe

Location of Auxiliary Tools in Bundles

2008-02-21 Thread Chris Suter
On 22/02/2008, at 7:41 AM, Nick Zitzmann wrote: Just place it in either the Contents/MacOS or Contents/Resources folder in your bundle & use NSBundle to get its path. It's pretty simple, actually... With the advent of code-signing, auxiliary tools should not be placed in Contents/Resourc

Re: NSInvocation question

2008-02-21 Thread Chris Suter
On 22/02/2008, at 3:00 PM, Hank Heijink wrote: I made NSInvocations because timing is critical and I didn't want to spend the time constructing the call when it needs to be invoked. I haven't profiled the difference yet though, so maybe the tradeof isn't bad. I'll give it a whirl. I'm no

Re: NSInvocation question

2008-02-22 Thread Chris Suter
On 23/02/2008, at 2:36 AM, Hank Heijink wrote: The nice thing about NSInvocation is not so much its efficiency (or lack thereof, as the case may be), but the fact that once you've got the thing constructed, you can just call invoke on it, without having to think about what's inside. I have

Re: NSInvocation question

2008-02-25 Thread Chris Suter
On 26/02/2008, at 1:49 AM, Hank Heijink wrote: I haven't been very clear, my apologies. I may have completely overlooked the best strategy, so let me try to explain what I'm doing. I have to call methods depending on certain conditions. These include passing of time, movement of the cursor

Re: Observing with GC

2008-02-26 Thread Chris Suter
On 26/02/2008, at 7:01 PM, Quincey Morris wrote: I find it hard to see anything dangerous in the finalize strategy used in the above code, unless: (a) there's a possibility that the observer is being finalized around the same time, or (b) the finalize method tries to set one of the obser

Re: Observing with GC

2008-02-26 Thread Chris Suter
On 27/02/2008, at 4:59 AM, Quincey Morris wrote: On Feb 26, 2008, at 02:42, Chris Suter wrote: The observation info uses a weak reference and it will have been zeroed before finalize is called so neither of the above are a problem. Even so, I'm not sure it's a good id

Re: Observing with GC

2008-02-27 Thread Chris Suter
On 27/02/2008, at 5:59 PM, Antonio Nunes wrote: On Feb 26, 2008, at 11:42 AM, Chris Suter wrote: On a side note, it doesn't look like you have to call removeObserver: for notifications registered with NSNotificationCenter. The garbage collection docs state: "For example, a no

Re: Drawing from secondary thread erases resize corner in window?

2008-02-27 Thread Chris Suter
On 28/02/2008, at 10:54 AM, Kyle Sluder wrote: On Wed, Feb 27, 2008 at 2:40 PM, Hank Heijink <[EMAIL PROTECTED]> wrote: I have a window with a custom view that occupies the entire window, so the little resize corner in the lower right is within the bounds of the view. I noticed that when I

<    1   2