Re: Auto Layout and Resizable NSViews

2015-07-20 Thread Ken Thomases
> On Jul 20, 2015, at 3:30 PM, Thomas Wetmore wrote: > I define an NSView that has nothing more than a resize handle, defined as a > rectangular NSBezierPath in its lower right corner. There are no subviews and > no superviews involved here. I resize the NSView by implementing a mouse > event

Re: NSTableView - kill the blue (Obj-C)

2015-07-26 Thread Ken Thomases
On Jul 26, 2015, at 7:25 AM, 2551 <2551p...@gmail.com> wrote: > I’ve been struggling with NSTableView for the last two days. All I want to do > is ensure the alternative “gray” highlight is used on a selection > consistently instead of the heavy blue. My first question is why do you want to tri

Re: Programmatically switching text fields

2015-08-02 Thread Ken Thomases
On Aug 2, 2015, at 7:29 PM, Graham Cox wrote: > I have a series of NSTextFields and I want to automatically move the keyboard > focus to the ‘next’ field when the one preceding it has a certain number of > characters entered. My code is: > > - (void) controlTextDidChange:(NSNotifi

Re: Programmatically switching text fields

2015-08-02 Thread Ken Thomases
On Aug 2, 2015, at 11:01 PM, Graham Cox wrote: > On 3 Aug 2015, at 12:13 pm, Ken Thomases wrote: >> >> You can try [[self window] selectKeyViewFollowingView:control] instead. > > Great! That works fine. Glad to hear it. > The only problem remaining then is th

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Ken Thomases
On Aug 14, 2015, at 5:23 PM, Carl Hoefs wrote: > I'm trying to automatically re-queue an NSInvocationOperation to an > NSOperationQueue every n seconds, but I can't get it to work. From the NSOperation class overview: "An operation object is a single-shot object—that is, it executes its task o

Re: Thread-safe atomic property for array

2015-08-14 Thread Ken Thomases
On Aug 14, 2015, at 6:59 PM, Trygve Inda wrote: > My main thread periodically downloads some data from a website. This is > extracted into an NSArray (non-mutable) and placed in a property: > > @property (atomic, retain) NSArray* myArray; > NSString* someString = [[hostObject myArray] objectAtI

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Ken Thomases
On Aug 14, 2015, at 8:07 PM, Carl Hoefs wrote: > Here's what I'm trying to do, but in code rather than words: > >. . . >[self doStatusChecks]; // start endless checking at 1-min intervals >. . . > > > - (void)doStatusChecks > { >[jobQueue addOperation:[[NSInvocationOperation a

Re: Recurrent NSInvocationOperations on an NSOperationQueue?

2015-08-14 Thread Ken Thomases
On Aug 14, 2015, at 8:43 PM, Carl Hoefs wrote: > On Aug 14, 2015, at 6:24 PM, Ken Thomases wrote: >> >> -performSelector:withObject:afterDelay: depends on the run loop. The >> threads that service any non-main NSOperationQueue don't run their run loop. >>

Re: Automatically activate next window after one is closed

2015-08-15 Thread Ken Thomases
On Aug 15, 2015, at 1:32 AM, Felipe Monteiro de Carvalho wrote: > I have a nib-less Cocoa application which creates 2 forms, and 1 of > them is visible. Upon clicking a button in this form, it shows another > form. > > When I close this form, the other form is not activated automatically, > cau

Re: Help understanding Apple's approach in documentation a little better.

2015-08-16 Thread Ken Thomases
On Aug 16, 2015, at 3:09 PM, Alex Zavatone wrote: > So, I look at UIStoryboard.h and the docs and see that there are 3 methods. > No properties. > And in using it, I find out that in addition to the 3 methods within > UIStoryboard.h, inside a an instance of UIStoryboard, there are a bunch of

Re: Help understanding Apple's approach in documentation a little better.

2015-08-16 Thread Ken Thomases
On Aug 16, 2015, at 4:18 PM, Alex Zavatone wrote: > On Aug 16, 2015, at 4:49 PM, Ken Thomases wrote: > >> On Aug 16, 2015, at 3:09 PM, Alex Zavatone wrote: >> >>> Why isn't it in Apple's documentation for storyboards? >> >> Because these are

Re: Using alarm(3) on background NSOperationQueue threads

2015-08-20 Thread Ken Thomases
On Aug 20, 2015, at 7:29 PM, Carl Hoefs wrote: > > From within a background NSOperationQueue thread, the effects of alarm(3) > seem to be ignored. (I use alarm() to interrupt certain system calls like > connect() when they stall.) The alarm fires, the alarm handler is invoked, > but the ongoin

Re: navigating NSPopUpButton menu items with arrow keys

2015-08-23 Thread Ken Thomases
On Aug 23, 2015, at 5:56 PM, Seth Willits wrote: >> On Aug 23, 2015, at 1:05 AM, sqwarqDev wrote: >> >> When the user navigates to the last item in the list, further presses on the >> down arrow key do nothing, and the user has to reverse direction using the >> up arrow. If the user is at the

Re: "Format not a string literal and no format arguments"

2009-09-01 Thread Ken Thomases
On Aug 31, 2009, at 5:23 PM, Sean McBride wrote: #import int main (void) { NSString* foo = [NSString stringWithFormat: NSLocalizedString(@"%d days ago", @"some comment"), 350]; return 0; } $ gcc-4.2 -Wformat=2 -framework Cocoa test.m

Re: Changes in KVO behavior on SL?

2009-09-01 Thread Ken Thomases
On Sep 1, 2009, at 7:14 PM, Kevin Brock wrote: We've got an app that is using keyValueForPath: and observeValueForKeyPath:ofObject:change:context: to keep a status window up-to-date. On 10.5 it works fine. On 10.6 keyValueForPath: is called exactly once per property. When we later creat

Re: Problem with NSFileManager

2009-09-02 Thread Ken Thomases
Moving this to Cocoa-Dev where it's appropriate... On Sep 2, 2009, at 1:50 PM, K. Chen wrote: I ran into a weird situation with NSFileMnager. First my code want to see if a file already exists if (![fileManager fileExistsAtPath:myConfigFile]) the result is NO, so my code goes into the if block

Re: NSBundle from an URL.

2009-09-03 Thread Ken Thomases
On Sep 3, 2009, at 5:36 PM, Erik Österlund wrote: I just wanted to check out NSBundle's + bundleFromURL. I looked in the documentation and said nothing about only some protocols working, so I thought I could load a bundle via HTTP which would be awesome, but that seemed to fail. Is this a b

Re: Retaining a NSURL and retaining its -path

2009-09-12 Thread Ken Thomases
In addition to what others have already said... On Sep 12, 2009, at 11:43 AM, John Love wrote: In my controller, one of my instance variables is a NSURL and I retain it because I pass it to a 2nd controller. This sentence seems misguided. If it's an instance variable of the first controll

Re: Not receiving mouseDown/Up events in borderless window . . .

2009-09-12 Thread Ken Thomases
On Sep 12, 2009, at 9:12 PM, Michael A. Crawford wrote: I have created a borderless window that is used to display a custom graphic, which need to respond to the enter key or a mouse click by closing itself. Seems straightforward enough. It works great on Snow Leopard (10.6) but I do not

Re: Grand Central Dispatch vs CFRunLoop

2009-09-13 Thread Ken Thomases
On Sep 13, 2009, at 10:09 AM, Filip van der Meeren wrote: I am using NSTask objects in a Command Line Tool project, to be able to intercept notifications I need a runloop to the best of my knowledge. Don't confuse two different things. Notifications do not require a run loop in order to

Re: NSNotificationQueue : NSPostingStyle : Definitions for Dummies

2009-09-19 Thread Ken Thomases
On Sep 16, 2009, at 8:35 AM, Jerry Krinock wrote: From NSNotificationQueue Documentation: NSPostASAP [...] NSPostWhenIdle [...] NSPostNow [...] Since a run loop is a closed loop, I always get confused about what is the "end", and when it is idle. I guess the "notification callout" is the

Re: Grand Central Dispatch vs CFRunLoop

2009-09-19 Thread Ken Thomases
On Sep 16, 2009, at 1:47 PM, Chris Kane wrote: On Sep 13, 2009, at 9:18 PM, Ken Thomases wrote: With respect to NSTask, there's no reason to believe that it will work if you just run the main dispatch queue rather than running the NSRunLoop. I highly doubt it would. I think it will

Re: 2 simple questions

2009-09-19 Thread Ken Thomases
On Sep 18, 2009, at 11:05 AM, Uli Kusterer wrote: How do I get it to list it under "Places" (on the left of the Finder window) programmatically? That last one doesn't really have an official solution. The Places in the Finder sidebar correspond to kLSSharedFileListFavoriteItems in the LSS

Re: Running run loops in 10.6 (was: Need -[NSTask waitUntilExitOrTimeout:])

2009-09-20 Thread Ken Thomases
On Sep 20, 2009, at 1:38 AM, Jerry Krinock wrote: Trying to find a way to "tickle" a run loop into returning in Mac OS 10.6, I wrote another little tool which, instead of spawning a short- duration NSTask, sends a message to a mach port which has been added to the current run loop. To my su

Re: Suppressing Crash Reporter dialogs for a task

2009-09-22 Thread Ken Thomases
On Sep 22, 2009, at 2:27 PM, Alastair Houghton wrote: If you was *your* process that crashed, on "normal" UNIX-like systems you can use signal handlers to catch the crash and do something about it. Likewise, on a normal UNIX-like platform you'd get a SIGCHLD from the system and you could c

Re: building and running on Snow Leopard

2009-09-23 Thread Ken Thomases
On Sep 23, 2009, at 2:20 AM, Chris Idou wrote: If you build an application on Snow Leopard, but against the 10.5 deployment target, and then you run the program on Snow Leopard, do you get all the Leopard 10.5 bugs as if you ran it on Leopard, or do you get to benefit from Snow Leopard bug

Re: building and running on Snow Leopard

2009-09-23 Thread Ken Thomases
On Sep 23, 2009, at 3:20 AM, Chris Idou wrote: Ok, so if I don't desire bug for bug 10.5 compatibility, but I do want it to run on 10.5, then I select 10.6 SDK and 10.5 deployment target, is that right? I wouldn't have put it that way, but, yes, I suppose that's accurate. I'm curious what

Re: NSTimer and modal panels

2009-09-30 Thread Ken Thomases
On Sep 30, 2009, at 6:01 AM, Gabriel Zachmann wrote: My question is: I've got a modal panel (a config sheet in a screensaver) with a text field, and when I enter some text there one of my methods, -changeSomething: say, gets called. Is changeSomething executed in a different thread than my

Re: Static Analyzer Question

2009-09-30 Thread Ken Thomases
On Sep 29, 2009, at 8:00 PM, Dave DeLong wrote: To continue a bit on this idea, I believe that the static analyzer only analyzes a single method at a time. I don't believe it recurses into called methods to do analysis. (Can any of the clang- sa folks confirm this?) It will perform analy

Re: Some more questions on NSOpenPanel

2009-09-30 Thread Ken Thomases
On Sep 30, 2009, at 5:57 PM, David M. Cotter wrote: so am i just out of luck on this? i am completely out of ideas. So, forgive me if this was covered earlier in the thread... You have set the open panel to allow multiple selections, right? [panel setAllowsMultipleSelection:YES] Regards

Re: memory advice for still learning coder

2009-10-03 Thread Ken Thomases
On Oct 3, 2009, at 2:38 AM, Rick C. wrote: i'm having a few memory issues where my memory climbs over time although using leaks it shows i have no leaks. Leaks aren't the only way to use excessive memory. For example, if you keep allocating objects and putting them in a collection somewher

Re: releasing a object containing others in a array

2009-10-03 Thread Ken Thomases
On Oct 3, 2009, at 3:10 AM, Nick Rogers wrote: I have a class as following: @interface NodeTypeOrph : NSObject { int count; ItemTypeOrph*key[4]; // Warning: indexing starts at 0, not 1 NodeTypeOrph*branch[5]; // Fake pointers to ch

Re: memory advice for still learning coder

2009-10-03 Thread Ken Thomases
On Oct 3, 2009, at 9:17 AM, Rick C. wrote: 5. returning i am not doing. :-( maybe a bad error on my part. in the thread method my first line i alloc/init an autorelease pool and the last line i release the pool. should my last line be return? the method is void. Allowing the method t

Re: memory advice for still learning coder

2009-10-03 Thread Ken Thomases
Oh, and I forgot to respond to this: On Oct 3, 2009, at 9:17 AM, Rick C. wrote: 4. i don't believe i'm having a problem with the arrays being accessed the same time by different threads. although i am not using a lock. If I'm understanding what you're saying, you're courting disaster. I

Re: Problem using filewrappers under snow leopard

2009-10-07 Thread Ken Thomases
This isn't related to the bug you're asking about, but it's gone by twice, so I need to comment on it: On Oct 7, 2009, at 11:33 AM, Eagle Offshore wrote: return [[NSFileWrapper alloc] initDirectoryWithFileWrappers:fileWrappers]; This is a leak. The caller is not expecting to receive ow

Re: Active Read/Write of NSTask

2009-10-08 Thread Ken Thomases
On Oct 6, 2009, at 6:30 PM, Kevin Ferguson wrote: I am running into a problem when the binary to be executed contains a scanf statement. I want the user to see results and type in input in real time (like the debugger for standard C tools in xcode). The issue is that as soon as the task hit

Re: Hide an Item on Desktop

2009-10-08 Thread Ken Thomases
On Oct 8, 2009, at 6:37 PM, I. Savant wrote: On Oct 8, 2009, at 7:24 PM, Maggie Zhang wrote: Does anyone know if it's possible to programmatically hide an single item (e.g. a file or a mounted disk or a directory) from the Desktop? Rename it so that it starts with a period. "Dot-files" ar

Re: Binding to currently selected object in a list?

2009-10-09 Thread Ken Thomases
On Oct 9, 2009, at 5:08 PM, A B wrote: Is there a way to bind an ivar to the currently selected object of a list which is being represented in an NSTableView via bindings? Unfortunately there does not seem to be a "selectedObject" key (though there is one for "selectedObjects"). Binding t

Re: Document architecture - stop it from opening untitled documents?

2009-10-10 Thread Ken Thomases
On Oct 9, 2009, at 8:57 PM, aaron smith wrote: On Fri, Oct 9, 2009 at 6:52 PM, aaron smith wrote: Hey All, quick question. I'm trying to figure out how to stop untitled documents from opening when the application first runs. I've been looking on google, and tried some different combinations o

Re: NSInvocationOperations and background Threads

2009-10-17 Thread Ken Thomases
On Oct 16, 2009, at 8:01 AM, John Love wrote: In my app, I have a very long for-loop It appears however, that in my app there is no background Thread that begins and the reason for that is because my app's window stays in the background until all NSOperations are complete. Any clues? I

Re: Programming Style: Method Definition with or without a semicolon.

2009-10-17 Thread Ken Thomases
On Oct 17, 2009, at 2:24 AM, Uli Kusterer wrote: What do project templates have to do with code completion? The comments don't mention how to customize code completion stubs either. Did I overlook something? For controlling code completion, search for "XCCodeSenseFormattingOptions" on thi

Re: NSInvocationOperations and background Threads

2009-10-18 Thread Ken Thomases
On Oct 18, 2009, at 7:26 AM, John Love wrote: Thanks for your prompt reply, I really appreciate it. You're welcome. I have revamped my code to have just one NSInvocationOperation whose selector contains the long for-loop. [...] the long for-loop is within -doAllOperations. OK, as far i

Re: Beach balling on mach_msg_trap

2009-10-21 Thread Ken Thomases
On Oct 21, 2009, at 2:17 AM, Nathan Day wrote: I am getting a beach balling in an application I am working on, I would of investigated more but I have noticed that some other apps on my computer seem to be doing the same thing. If I move my applications window it free up the block allowing

Re: 2 Questions about the project "With and Without bindings"

2009-10-23 Thread Ken Thomases
On Oct 23, 2009, at 4:19 PM, Michael de Haan wrote: When adding a bookmark, the bookmark object is initialized thus: - init { if (self = [super init]) { title = @"new title"; self.creationDate = [NSDate date]; } return self; } **property declarations for title and c

Re: Getting a handle on inf

2009-10-26 Thread Ken Thomases
On Oct 26, 2009, at 2:11 PM, Ian Piper wrote: On 26 Oct 2009, at 18:45, Greg Parker wrote: On Oct 26, 2009, at 11:26 AM, Ian Piper wrote: So I am guessing that when I get a float displayed as "inf" this is not the string it seems to be. Also, it looks like the string value of whatever is c

Re: Seemingly Documentation confusion?

2009-10-31 Thread Ken Thomases
On Oct 30, 2009, at 1:59 AM, Scott Anguish wrote: I’ve fixed these two docs. You’ll see them around turkey time. ... by which he presumably means the U.S. Thanksgiving holiday, November 26th this year. (In case anybody was confused. :) Cheers, Ken

Re: Asynchronous downloading again

2009-10-31 Thread Ken Thomases
On Oct 31, 2009, at 11:19 PM, DKJ wrote: The 2-file example was a simplified case I posted when I was asking whether the method would work. I actually have half-a-dozen or so data files to download. (It can vary.) I'm using the delegate to save the files to disk under different names, so

Re: Keeping NSTimeInterval updated with current time

2009-11-02 Thread Ken Thomases
On Nov 2, 2009, at 7:10 PM, Graham Cox wrote: On 03/11/2009, at 10:10 AM, PCWiz wrote: What I want to do is around every 5 minutes, update the timeInterval to be consistent with the current time. The problem is that I need to do this update for a large number of instances of the object. O

Re: Crash invoking Front Row - WTF?

2009-11-02 Thread Ken Thomases
On Nov 2, 2009, at 7:20 PM, Graham Cox wrote: A user is reporting a crash with my app where the crash causes the system to bring up Front Row. Has anyone ever seen anything like this, or can offer an explanation for it? I can't even see how an app could bring up Front Row if it wanted to, l

Re: Best pattern for similar objects with differences

2009-11-04 Thread Ken Thomases
On Nov 4, 2009, at 12:47 PM, Paul Bruneau wrote: 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 door

Re: How to retrieve document type?

2009-11-05 Thread Ken Thomases
On Nov 5, 2009, at 2:11 PM, Fritz Anderson wrote: On 5 Nov 2009, at 1:58 PM, Laurent Daudelin wrote: I'd like to retrieve the document type of a given file and display it like the Finder does, like "Portable Document Format (PDF)" or "Microsoft Word document". How can I do that? Start y

Re: NSOperationQueue for NSXMLParser object

2009-11-05 Thread Ken Thomases
On Nov 5, 2009, at 8:12 PM, Chris Purcell wrote: //Parse the XML - (void) parseXML:(NSTimer *)timer { XMLParser *parser = [[XMLParser alloc] initWithURL:@"Location of the XML" delegate:self]; [queue addOperation:parser]; [parser release]; //th

Re: NSTextView won't update via NSThread

2009-11-06 Thread Ken Thomases
On Nov 5, 2009, at 6:20 AM, Dalton Hamilton wrote: Does anyone have any idea why NSTextView won't update when the code is a thread? Yes, because Cocoa generally doesn't support manipulating the GUI from any thread other than the main thread. Read through this: http://developer.apple.com/m

Re: Derived properties

2009-11-11 Thread Ken Thomases
In addition to what Greg said: On Nov 11, 2009, at 1:52 PM, Christian Ziegler wrote: A basic question here is, for any method which might as well be a property and of course doesn't have any parameters, is it ok to use dot-notation or should'nt you do that. You shouldn't use dot-notation f

Re: Callback when OS delivers console msg for my process?

2009-11-13 Thread Ken Thomases
On Nov 13, 2009, at 2:53 PM, Trygve Inda wrote: Also... NSURL* imgURL = [NSURL fileURLWithPath:path]; CGImageSourceRefimgRef; CGImageSourceStatus imgStatus; imgRef = CGImageSourceCreateWithURL (imgURL, nil); CGImageSourceGetStatus (imgRef) returns kCGImageStatusComplete Wh

Re: Accessing FilesOwner fm controller

2009-11-16 Thread Ken Thomases
On Nov 16, 2009, at 1:21 PM, Harry Plate wrote: > I am writing a plugin to another application, and I must manage my own NIBs. > But, what I am having trouble with is communicating with "File's Owner". > When I instantiate the NIB, I pass my class as owner - then when the > controller is called v

Re: Stack-based C++ class to wrap NSAutoreleasePool

2009-11-16 Thread Ken Thomases
On Nov 16, 2009, at 1:50 PM, Clark Cox wrote: > Though, if you're planning on returning an > autoreleased object, you're already assuming that there is an > autorelease pool in place, in which case, there is no need to wrap the > local function in your own pool. > You wouldn't want to wrap such a

Re: EXC_BAD_ACCESS when calling NSOpenPanel

2009-11-25 Thread Ken Thomases
On Nov 23, 2009, at 6:51 PM, Darren Wheatley wrote: > I have the following code as the action from a button click: > > - (IBAction)chooseFile:(id)sender; > { >NSOpenPanel *openPanel = [NSOpenPanel openPanel]; You haven't retained this panel. If you want this object to live beyond the curre

Re: performSelector doesn't work for modal window

2010-03-12 Thread Ken Thomases
On Mar 12, 2010, at 10:34 AM, Alexander Bokovikov wrote: > Unfortunately NSButton click is called when button is pressed, but not when > it is released. This is incorrect. You can click in a button, hold, drag out of the button, and release, and the button won't perform its action. The action

Re: How to show a progress without multithreading?

2010-03-13 Thread Ken Thomases
On Mar 13, 2010, at 10:23 PM, Quincey Morris wrote: > On Mar 13, 2010, at 19:33, Alexander Bokovikov wrote: > >> I have a time-consuming procedure, and I'd like to show its progress. I >> can't use multi-threading for some technical reason. >> I'm looking for a way to update a progress indicator

Re: Case sensitive fileName

2010-03-17 Thread Ken Thomases
On Mar 17, 2010, at 12:35 PM, Andreas Mayer wrote: > Am 17.03.2010 um 17:46 Uhr schrieb Kevin Wojniak: > >> NSLog(@"displayNameAtPath: %@", [[NSFileManager defaultManager] >> displayNameAtPath:path]); > > Note that -displayNameAtPath: will give you the localized name if one should > exist. >

Re: Using Set/Array KVC operators

2010-03-19 Thread Ken Thomases
On Mar 18, 2010, at 6:15 PM, Sam Krishna wrote: > I have two arrays of NSDictionaries that I'm trying to "uniquely merge" by > making sure that no two dictionaries have duplicate contents. I came up with > one solution, but I wanted to see if the community had an answer that > involved using on

Re: Lock a file in cocoa

2010-03-19 Thread Ken Thomases
On Mar 19, 2010, at 4:59 AM, Nikhil Khandelwal wrote: > Is there any way to lock a file in cocoa? I want to lock a file on desktop > programmatically so that I can't move that file to trash until I unlock the > file. I recommend against doing that. Locking the file in this sense should probabl

Re: Lock a file in cocoa

2010-03-19 Thread Ken Thomases
On Mar 19, 2010, at 1:36 PM, Charles Srstka wrote: > On Mar 19, 2010, at 11:04 AM, Jens Alfke wrote: > >> On Mar 19, 2010, at 5:17 AM, Don Quixote de la Mancha wrote: >> >>> How long do you need to prevent its removal? Just holding the file >>> open should prevent it from being deleted. >> >>

Re: ATTR_CMN_CHGTIME

2010-03-22 Thread Ken Thomases
On Mar 21, 2010, at 6:01 PM, gMail.com wrote: > Also, the man says that getattrlist and setattrlist don't work on all the > volumes. So, how can I know whether I can call these APIs? The man page for getattrlist says: > The best way to test whether a volume supports this function is to simply >

Re: Details and the concepts related to the Nib Window

2010-03-22 Thread Ken Thomases
On Mar 22, 2010, at 5:07 PM, Abhinav Tyagi wrote: > Whenever we drag an object from the Interface builder to our Nib window > (like we do for a controller object), it means that we are instantiating the > object of a class or interface. But where actually can i see it being > instantiated. What d

Re: NSTreeController, NSBrowser image setting

2010-03-23 Thread Ken Thomases
On Mar 23, 2010, at 9:22 PM, Tony Romano wrote: > I'm using a NSTreeController and bindings to contain the data for a > NSBrowser. Data from my objects is being displayed fine. I want to add an > image to the entries in the browser. From what I gather, I need to implement > the willDisplayCe

Re: NSNotificationCenter and a modal window - a problem

2010-03-24 Thread Ken Thomases
On Mar 24, 2010, at 2:11 AM, Alexander Bokovikov wrote: >[[NSNotificationCenter defaultCenter] addObserver:anObj > > selector:@selector(getData:) >

Re: Allowing incoming connections.

2010-03-24 Thread Ken Thomases
On Mar 24, 2010, at 2:50 AM, John C. Randolph wrote: > So, I've got this app that connects to RTSP streams, and I'd rather not nag > the user every time it's launched with that "Do you wan the application to > accept incoming network connections?" dialog box. Anyway to have the user > authori

Re: Trouble forking my project

2010-03-25 Thread Ken Thomases
On Mar 25, 2010, at 12:23 PM, davel...@mac.com wrote: > On Mar 25, 2010, at 11:12 AM, Sean McBride wrote: > >> That's all fine and good until you need to change a xib (or worse, >> nib). xibs are neither diffable nor auto-mergeable. In my experience, >> they are the single biggest PITA when try

Re: Prevent NSWindow from hiding with app

2010-03-25 Thread Ken Thomases
On Mar 25, 2010, at 1:10 PM, fabian wrote: > Is it possible to prevent a window from hiding when NSApp is hidden, so it > always stays on screen? I only want the menu bar to go away. That doesn't make any sense. You "want the menu bar to go away"? So there would be no menu bar? Or so that som

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 2:28 AM, Alexander Bokovikov wrote: > On 26.03.2010, at 23:10, Fritz Anderson wrote: > >> On 26 Mar 2010, at 11:12 AM, Alexander Bokovikov wrote: >> >>> Is there any notification or NSWindow delegate method, called immediately >>> after the modal window is shown on screen? I

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 3:23 AM, Alexander Bokovikov wrote: > On 27.03.2010, at 12:48, Ken Thomases wrote: > >> I'm not really sure what you're asking for. A modal window being shown on >> screen is not something that happens spontaneously _to_ your application,

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 5:45 AM, Alexander Bokovikov wrote: > On 27.03.2010, at 1:59 PM, Ken Thomases wrote: > >> I can't see how this is either correct or incorrect >> from the point of view of OOP philosophy. >> OOP involves encapsulation, separation of c

Re: Application crashes with no calls tracing back to my code

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 6:29 AM, Arun wrote: > My application is crashing sometimes with the following crash log. It has no > traces of my code. Can anyone look into the crash log suggest some ideas? Probably a memory management bug. You are over-releasing or under-retaining something. An NSImage,

Re: Application crashes with no calls tracing back to my code

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 7:00 AM, Ken Thomases wrote: > On Mar 27, 2010, at 6:29 AM, Arun wrote: > >> My application is crashing sometimes with the following crash log. It has no >> traces of my code. Can anyone look into the crash log suggest some ideas? > > Probably a mem

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 10:20 AM, Alexander Bokovikov wrote: > On 27.03.2010, at 16:57, Ken Thomases wrote: > >>> "separation of concerns" is just the case. >> >> Except the timing does not impact on separation of concerns. > > I'm not about timing

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 10:30 AM, Alexander Bokovikov wrote: >> I think you are used to Windows programming. Cocoa modal sheets are modal to >> the owning form, not the whole app. > > Modal sheet is not so suitable here. Modal sheet is located "within" the > window which owns it. In my case popup w

Re: How to catch modal window appearance?

2010-03-27 Thread Ken Thomases
On Mar 27, 2010, at 11:01 AM, Alexander Bokovikov wrote: > Finally, one extra question. When modal window runloop starts? Does it start > after the window is shown on screen or before that? If it starts after window > showing then I'd use performSelector:withObject:afterDelay: to be sure that >

Re: NSTask and pseudo TTY

2010-03-28 Thread Ken Thomases
On Mar 28, 2010, at 1:56 PM, James W. Walker wrote: > I've been running NSTask and reading the output using -[NSFileHandle > readInBackgroundAndNotify], but in certain situations there was a problem: > Due to the block buffering of standard output, I wasn't getting notified as > soon as some o

Re: NSTask dilema...

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 1:21 PM, Jean-Nicolas Jolivet wrote: > I have to run a bunch of NSTasks and I'm not sure to proceed considering I > want to be able to update the UI when a task is completed, and I want the > process to be as fast as possible (obviously)... > - I tried launching the tasks on

Re: Random crashes in release but not in debug

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 1:35 PM, Laurent Daudelin wrote: > In any case, what would cause an application built with the debug > configuration to not exhibit this bug at all while the same application built > with the release configuration will crash randomly? Changes in the layout of code or the sta

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 4:32 PM, Jerry Krinock wrote: >[self cancelAllOperations] ; > So you see in NSLog #1 there are 5 operations in the queue. This is > expected, because although the documentation for -cancelAllOperations is a > little vague, it does not say that it *removes* any operation

Re: Runtime check if C function exists

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 4:50 PM, Philip Mobley wrote: > I am wanting to perform a runtime check to see if a particular C function > exists. While in this particular case, the C function I want to use is only > available as part of 10.6 SDK (there are examples of this in archives), but I > want to

Re: -[NSOperationQueue cancelAllOperations] cleans queue, but not immediately?!

2010-03-31 Thread Ken Thomases
On Mar 31, 2010, at 5:03 PM, Jerry Krinock wrote: > So Ken I believe you're saying that the "cancelled" operations become ready > to run immediately, which they do (as no-ops), which removes them from the > queue. In *effect* therefore, "are cancelled before they begin executing" > *does indee

Re: User Experience, Bring App Window back when Clicking Dock Icon

2010-04-01 Thread Ken Thomases
On Apr 1, 2010, at 3:55 AM, Gustavo Pizano wrote: > I was reading a little about the user Experience, but I hadn't been able to > achieve the goal, when I close the window, it closes the it but the app > doesn't terminate but I can't bring it back again, I have set in IB to don't > release when

Re: What is the runtime context of an event tap?

2010-04-03 Thread Ken Thomases
On Apr 3, 2010, at 5:16 PM, Pat Wilson wrote: > When an event tap is created using CGEventTapCreate, which process, or thread > actually runs the callback function? The one which created the tap, the first > responder, ...? The first responder isn't a thread, process, or runtime/execution conte

Re: How do I get a file reference w/o relying on the path?

2010-04-03 Thread Ken Thomases
On Apr 3, 2010, at 5:20 PM, Brad Stone wrote: > I want to store a reference to a file in an ivar that will allow the user to > change the file's name and/or the directory (i.e. the path) and still allow > me to access it. I don't want to create a file (like an ailas). I need to > store the fi

Re: How do I get a file reference w/o relying on the path?

2010-04-04 Thread Ken Thomases
On Apr 3, 2010, at 8:31 PM, Jens Alfke wrote: > Ken, he asked for a reference that wouldn't break if the file were moved or > renamed. Neither FSrefs nor URLs have that property. Yes, they do. From the link I gave

Re: How do I get a file reference w/o relying on the path?

2010-04-04 Thread Ken Thomases
On Apr 4, 2010, at 12:06 PM, Gregory Weston wrote: > Ken Thomases wrote: > >> As of Snow Leopard, alias records are deprecated in favor of bookmark data, >> but, again, it's probably overkill. (Both alias records and bookmark data >> are more suitable if the ref

Re: How do I get a file reference w/o relying on the path?

2010-04-04 Thread Ken Thomases
On Apr 4, 2010, at 12:50 PM, Jens Alfke wrote: > You're saying that if I have a FSRef to a file, then the file is moved, the > FSRef will still reference the moved file and not the location where it used > to be? Yes. They are file-ID-based. > That's surprising to me, because FSRefs were cre

Re: Run Loop in Tool Idles for 60.0 seconds before exitting

2010-04-04 Thread Ken Thomases
On Apr 4, 2010, at 4:06 PM, Jerry Krinock wrote: > while ( >![[AgentPerformer sharedPerformer] isDone] >&& >[[NSRunLoop currentRunLoop] runMode:NSDefaultRunLoopMode > beforeDate:[NSDate distantFuture]]) { > NSLog(@"Did Run") ; >

Re: Run Loop in Tool Idles for 60.0 seconds before exitting [Solved]

2010-04-05 Thread Ken Thomases
On Apr 4, 2010, at 11:00 PM, Jerry Krinock wrote: > On 2010 Apr 04, at 14:44, Ken Thomases wrote: > >> Since you're already using operations, why use the above 'while' loop, >> anyway? Why not use -[NSOperationQueue waitUntilAllOperationsAreFinished]. >

Re: Problems with repetetive execution of netstat using NSTask and NSTimer

2010-04-05 Thread Ken Thomases
On Apr 5, 2010, at 4:05 PM, Kazior Fukacz wrote: > When I run it, it keeps working perfectly fine for a few minutes, then stops > refreshing the IP and prints: > > IPShowX[14917] *** NSTimer discarding exception '*** -[NSCFDictionary > setObject:forKey:]: attempt to insert nil value' that raise

Re: Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1

2010-04-07 Thread Ken Thomases
This has nothing to do with Cocoa. Try the xcode-users list. Regards, Ken On Apr 7, 2010, at 12:40 PM, Ignacio Enriquez wrote: > Hi everybody. > I get this link error: > Command /Developer/usr/bin/llvm-g++-4.2 failed with exit code 1 > every time I try to run my program. > This runs perfectly i

Re: What gets automatically localized?

2010-04-08 Thread Ken Thomases
On Apr 8, 2010, at 2:53 PM, Dave DeLong wrote: > This ticket has popped up on my radar again at work, and I still have a hard > time believing that I have to translate things like "File", "Edit", "Undo", > "Special Characters", etc myself. > > Is that really the case? Apple provides a number o

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Ken Thomases
On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote: > I'm trying to execute a task in the background and parsing the output from > the task along the way. However I get the NSTaskDidTerminateNotification > before all the output from the task has been delivered by > NSFileHandleReadCompletionNotif

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-11 Thread Ken Thomases
On Apr 11, 2010, at 3:18 PM, Rasmus Skaarup wrote: > On 11/04/2010, at 21.17, Ken Thomases wrote: > >> On Apr 8, 2010, at 9:57 AM, Rasmus Skaarup wrote: > >>> [[NSNotificationCenter default

Re: Problem with reading an NSPipe->NSFileHandle to end

2010-04-12 Thread Ken Thomases
On Apr 12, 2010, at 8:46 AM, Rasmus Skaarup wrote: >> Try simplifying your app by eliminating the use of background threads. Or, >> if you feel you must use background threads for long-running computation, >> use them only for handling the data after receiving it. Do everything >> involving l

Re: Help with crash in -[NSKeyValueNestedProperty matchesWithoutOperatorComponentsKeyPath:]

2010-04-15 Thread Ken Thomases
On Apr 15, 2010, at 11:03 AM, wrote: > Unfortunately i have very little data on what was actually going on before > the crash. The crash report itself starts with some important information that you've omitted: the actual nature of the crash. What kind of signal or exception was received?

<    1   2   3   4   5   6   7   8   9   10   >