Creating an NSSocketPort on an available port?

2008-03-11 Thread Mac QA
Hi, I have a little program that creates an NSSocketPort for use in Distributed Objects, and also advertises itself over Bonjour. So, something like this... // This server will wait for responses on port 3121 receivePort = [[NSSocketPort alloc] initWithTCPPort:3121]; connection = [NSConnection co

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Kyle Sluder
On Tue, Mar 11, 2008 at 3:14 AM, Mac QA <[EMAIL PROTECTED]> wrote: > The NSSocketPort class doesn't seem to have a way to get the port when > you just alloc & init like this. So How can you advertise over Bonjour > for a generic dynamically determined port selected at runtime? Grab the underlyi

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Jean-Daniel Dupas
Addind those lines after your port creation should alow you to reuse it after a quick restart: int yes = 1; setsockopt([receivePort socket], SOL_SOCKET, SO_REUSEADDR, (void *)&yes, sizeof(yes)); else you will have to get the socket adress after it's creation and extract port from it. You

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Jean-Daniel Dupas
As far as I know, the only reliable way to get users accounts is to use DirectoryServices but Apple do not provide Obj-C API for Directory Services. There is an obj-C wrapper in the DSTools project of Darwin (http://www.opensource.apple.com/darwinsource/ ), so you may have a look at it. Anyway

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Mac QA
On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > As far as I know, the only reliable way to get users accounts is to > use DirectoryServices ... you also have to be aware > that the local user list storage has change between 10.4 and 10.5 Thanks for the info. Sounds none too convenient

warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
I have a line of code: xmppStream = [[XMPPStream alloc] initWithDelegate:self]; That when compiled, receives a warning: warning: assignment from distinct Objective-C type Now, what's odd to me, is if I change the source code to this: xmppStream = [XMPPStream alloc]; [x

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Ron Fleckner
On 11/03/2008, at 7:19 PM, Stuart Malin wrote: I have a line of code: xmppStream = [[XMPPStream alloc] initWithDelegate:self]; That when compiled, receives a warning: warning: assignment from distinct Objective-C type Not sure of the actual reason, but if you both forward declare t

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
Ron -- thanks for the quick reply. I do have the XMPPStream class declared in the .h file where the variable is declared. And the .m does import the XMPPStream header file. After all, without those, I'd get outright errors :-) On Mar 10, 2008, at 10:42 PM, Ron Fleckner wrote: On 11/

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 09:51, Andrew Farmer a écrit : On 11 Mar 08, at 01:01, Mac QA wrote: On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: As far as I know, the only reliable way to get users accounts is to use DirectoryServices ... you also have to be aware that the local user list storage

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Julien Jalon
1) All init methods should return (id) not a specific class2) your initWithDelegate: is likely too generic as a name and its signature conflicts with an other one. Since [XMPPStream alloc] is typed id, the compiler might not be sure of what method signature you want to use for -initWithDelegate:

Re: [Moderator] iPhone discussion here - RETRACTION

2008-03-11 Thread Gustavo Eulalio
That`s funny, because in the iPhone SDK intro videos we're instructed to get more information here, in this list. I wish they'd make up their mind. -- Gustavo Eulalio [EMAIL PROTECTED] On Mon, Mar 10, 2008 at 7:45 PM, Scott Anguish <[EMAIL PROTECTED]> wrote: > Apparently there has been some mis

Quit application when window closes

2008-03-11 Thread Felipe Monteiro de Carvalho
Hello, How can I implement the behavior that the application closes when my window closes? The application contains no nib files and doesn't use the interface builder, it's every thing done by code. thanks, -- Felipe Monteiro de Carvalho ___ Cocoa-de

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Andrew Farmer
On 11 Mar 08, at 01:01, Mac QA wrote: On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: As far as I know, the only reliable way to get users accounts is to use DirectoryServices ... you also have to be aware that the local user list storage has change between 10.4 and 10.5 Thanks for th

shared NSImage from bundle

2008-03-11 Thread Torsten Curdt
While I know I can load an image like this image = [[NSImagealloc] initWithContentsOfFile: [[NSBundlemainBundle] pathForResource:@"someimage" ofType:@"PNG"]]; all my NSDocument should be OK to share the same instance. Creating class level singleton accessors seem a little too much work. Is

Re: shared NSImage from bundle

2008-03-11 Thread Jean-Daniel Dupas
The method your looking for is + (void)initialize { } Warning: This method can be called more than once (if a subclass does not override it) so you should do something like this. @implementation Foo + (void)initialize { if ([Foo class] == self) { // load your images

Re: Quit application when window closes

2008-03-11 Thread Ron Fleckner
On 11/03/2008, at 9:22 PM, Felipe Monteiro de Carvalho wrote: Hello, How can I implement the behavior that the application closes when my window closes? The application contains no nib files and doesn't use the interface builder, it's every thing done by code. thanks, -- Felipe Monteiro de

Pragmatic use of private framework class (in this case OSADictionary)

2008-03-11 Thread [EMAIL PROTECTED]
Hello I had previously posted the excerpt below with regard to browsing AppleScript dictionaries from within cocoa apps: Are OSADictionaryView and OSADictionaryController as featured in the IB 3 Open Scripting Kit plug-in viable in cocoa? The OSAKit header contains no interface for these cl

Re: CIImage (TIFFRepresentation) memory leak

2008-03-11 Thread slasktrattenator
Thanks a bunch! That worked great. No more leaking. On Tue, Mar 11, 2008 at 4:46 AM, Rob Keniger <[EMAIL PROTECTED]> wrote: > I had problems with this too, and I use a workaround I found somewhere > where you render to a CGImageRef in the context of the current window. > Here's a dump of the co

Re: shared NSImage from bundle

2008-03-11 Thread Torsten Curdt
Thanks!! Perfect On 11.03.2008, at 11:17, Jean-Daniel Dupas wrote: The method your looking for is + (void)initialize { } Warning: This method can be called more than once (if a subclass does not override it) so you should do something like this. @implementation Foo + (void)initialize {

Re: [Moderator] iPhone discussion here - RETRACTION

2008-03-11 Thread I. Savant
On Mar 11, 2008, at 6:31 AM, Gustavo Eulalio wrote: That`s funny, because in the iPhone SDK intro videos we're instructed to get more information here, in this list. I wish they'd make up their mind. Though I made the joke that I blame Scott, it's just that - a joke. Keep in mind that he's

Check box cell in NSTableView

2008-03-11 Thread Ivan C Myrvold
I can not get my check boxes in an NSTableColumn to show the mixed state. The first time I click an empty check box, it shows as if it is checked, it should have been mixed. The next time I click it, it still shows checked, this time correct. The third time I click it, it is shown unchecked, a

Is CoreData dead?

2008-03-11 Thread Greg Robertson
Not sure if this is the best place to post this question but here goes. I am thinking about developing a Mac and iPhone app that would use CoreData to store application data. Personally I like CoreData and its rapid development on the Mac side of XCode/Interface Builder. When I gave the iPhone SD

Re: Is CoreData dead?

2008-03-11 Thread I. Savant
> When I gave the iPhone SDK a spin and went thru the documentation I noticed > that CoreData is not mentioned although SQLite as a data store is. Does this > mean that CoreData is not supported on the iPhone and may eventually be > phased out? 1 - We're not allowed to "speculate" about the iP

Re: [Moderator] iPhone discussion here - RETRACTION

2008-03-11 Thread Hamish Allan
On Tue, Mar 11, 2008 at 12:56 AM, has <[EMAIL PROTECTED]> wrote: > #1 - The first rule of iPhone SDK is, you do not talk about iPhone SDK. > > #2 - The second rule of iPhone SDK is, you DO NOT talk about iPhone SDK. The one-and-a-halfth rule of iPhone SDK is, you are welcome to talk about iPhon

Re: NSURLDownload and userInfo

2008-03-11 Thread Trygve Inda
> Or, yet another solution: > Just subclass NSURLConnection (say MyUserInfoURLConnection), add a > userInfo ivar, drop in some accessors, and you are good to go. :) > [userInfoConnection userInfo]; My code is: NSURLRequest*urlRequest = [NSURLRequest requestWithURL:theURL cachePolicy:NSURLReq

Re: Is CoreData dead?

2008-03-11 Thread Mark Dawson
You can't talk about the iPhone SDK publicly -- you have to ask Apple directly (the developer relations people). You could probably ask for Core Data; however I'm sure that Core Data being gone is no more indicative of it being gone (for everything) than Ethernet is because it wasn't in the Mac

Re: Is CoreData dead?

2008-03-11 Thread Stephane Sudre
On Mar 11, 2008, at 14:01, Greg Robertson wrote: Not sure if this is the best place to post this question but here goes. ... If there is a better place to post this question please let me know as well. Bug Reporter > Enhancement request ___ C

Re: Check box cell in NSTableView

2008-03-11 Thread Stephane Sudre
On Mar 11, 2008, at 13:15, Ivan C Myrvold wrote: I can not get my check boxes in an NSTableColumn to show the mixed state. The first time I click an empty check box, it shows as if it is checked, it should have been mixed. A mixed state can not be determined by a click. What a click should

Re: [Moderator] iPhone discussion here - RETRACTION

2008-03-11 Thread Brady Duga
On Mar 11, 2008, at 3:31 AM, Gustavo Eulalio wrote: That`s funny, because in the iPhone SDK intro videos we're instructed to get more information here, in this list. I wish they'd make up their mind. Presumably they did not want to make two sets of videos, one for the beta instructing them

Is CoreData dead? [RESOLVED]

2008-03-11 Thread Greg Robertson
This issue has been resolved using Bug Reporter > Enhancement request at developer.apple.com Thanks Greg ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

Re: NSURLDownload and userInfo

2008-03-11 Thread Jens Alfke
On 10 Mar '08, at 8:06 PM, Ben Lachman wrote: I don't know if I agree with the working with the APIs bit. I think it's obvious that the APIs expect a single delegate to be able to handle multiple objects using it concurrently, thus the passing of the object that is delegating to the deleg

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Keary Suska
on 3/11/08 1:50 AM, [EMAIL PROTECTED] purportedly said: > Ron -- thanks for the quick reply. > > I do have the XMPPStream class declared in the .h file where the > variable is declared. > And the .m does import the XMPPStream header file. > After all, without those, I'd get outright errors :-) >

Re: Check box cell in NSTableView

2008-03-11 Thread Ivan C Myrvold
It doesn't matter if I do the [myCheckBox setState:NSMixedState]; the result is the same, the checkbox is shown as checked. If I however use the same code (or even click all the three states) in an ordinary check box (not cell), everything works as I expect it to do. This makes me suspect t

Re: Cocoa way to get list of user accounts?

2008-03-11 Thread Dave Camp
On Mar 10, 2008, at 11:00 PM, Mac QA wrote: I am seeking the nice clean Cocoa way of getting a list of user accounts on the local system. Ultimately in the form of an NSArray of NSStrings of user account short names. There must be a way without parsing obscure system files, or spawning off NSTas

Re: Check box cell in NSTableView

2008-03-11 Thread stephane
On Mar 11, 2008, at 3:58 PM, Ivan C Myrvold wrote: It doesn't matter if I do the [myCheckBox setState:NSMixedState]; the result is the same, the checkbox is shown as checked. If I however use the same code (or even click all the three states) in an ordinary check box (not cell), everything

Re: Check box cell in NSTableView

2008-03-11 Thread Mike Abdullah
I suspect here that you need to learn a little more about how NSTableView works. There is NOT one cell per row, so call -setState: basically does nothing. instead, NSTableView creates copies of the cell, sets the properties, and uses that to draw. How are you supplying data to the table - d

Re: Check box cell in NSTableView

2008-03-11 Thread [EMAIL PROTECTED]
I recently put together a sequence of interlinked NSTableViews using checkbox cells. It displays the mixed state without problem. So no bug I think. I used a datasource in this case, as below. - (id)tableView:(NSTableView *)aTableView objectValueForTableColumn:(NSTableColumn *)aTableColumn row

[MEET]: Los Angeles CocoaHeads Thursday March 13th 7:30pm

2008-03-11 Thread Rob Ross
Howdy LA CocoaHeads! Gautam Godse will be giving us a presentation on XCode 3 and how it compares to XCode 2. We may also spend a little time talking about ZFS, gossiping about the iPhone SDK, and whatever else we can come up with :) We meet on Thursday at the offices of E! Entertainment

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Mac QA
On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: > struct sockaddr_in* addr4; > NSData *data = [receivePort address]; > if (data) { > addr4 = (struct sockaddr_in *)[data bytes]; > port = ntohs(addr4->sin_port); > } Any clue why something like this would produce an "error: d

Re: Creating an NSSocketPort on an available port?

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 17:30, Mac QA a écrit : On 3/11/08, Jean-Daniel Dupas <[EMAIL PROTECTED]> wrote: struct sockaddr_in* addr4; NSData *data = [receivePort address]; if (data) { addr4 = (struct sockaddr_in *)[data bytes]; port = ntohs(addr4->sin_port); } Any clue why something like this

Re: Button on a button

2008-03-11 Thread Erik Buck
There is this example of buttons on a button: http://www.stepwise.com/Articles/Technical/NSCell.html But from your description, I suspect you want Core Animation Layers: http://developer.apple.com/documentation/Cocoa/Conceptual/CoreAnimation_guide/Introduction/Introduction.html __

cross development ppc intel problem

2008-03-11 Thread vinay
I'm fairly new to XCode and mac development and am trying build a universal binary that I started designing on leopard intel. When I finally got my hands on a ppc tiger machine to test the UI looks completely different. The main issue is that the icons for my buttons are "zoomed in" on the ppc(prob

To unmount a volume

2008-03-11 Thread Nick Rogers
Hi, How can I unmount a volume knowing its POSIX path (/dev/rdisk1) and knowing its mounted name (Volumes/TREK)? Is there any API to do that in cocoa? Wishes, Nick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin req

Working with large files and Memory

2008-03-11 Thread Carl E. McIntosh
Can you please give advice about handling large data files with memory management techniques? I am attempting to read three large files (1 GB, 208 MB, 725 MB) sequentially and place the data into arrays for processing. Here is my psuedocode: 1) Import a file into NSString. NSString *a

Where are the [hidden] nibs and other resources?

2008-03-11 Thread James Hober
In the Finder, when I open up my app's package, I find all my nib files and other resources. If I open the package of an Apple app, some nibs and other resources are in there, but many are not. Where are they? Why aren't they there? Can I hide my stuff, too? Should I hide my stuff, too

Re: cross development ppc intel problem

2008-03-11 Thread Dave Hersey
You should run the IB compatibility check for the version of the OS you're targeting. It sounds like your button images are set to scale, which isn't supported prior to 10.5. Open your nib and click the "info" button if you're using IB3. Then set the target OS. If you click on the entries,

Re: Working with large files and Memory

2008-03-11 Thread Clark Cox
On Tue, Mar 11, 2008 at 9:54 AM, Carl E. McIntosh <[EMAIL PROTECTED]> wrote: > Can you please give advice about handling large data files with memory > management techniques? I am attempting to read three large files (1 > GB, 208 MB, 725 MB) sequentially and place the data into arrays for > proc

Re: Where are the [hidden] nibs and other resources?

2008-03-11 Thread matt . gough
Maybe you aren't looking in their localized resource folders? Matt On 11 Mar 2008, at 18:08, James Hober wrote: In the Finder, when I open up my app's package, I find all my nib files and other resources. If I open the package of an Apple app, some nibs and other resources are in there, b

Re: Working with large files and Memory

2008-03-11 Thread Jean-Daniel Dupas
Le 11 mars 08 à 17:54, Carl E. McIntosh a écrit : Can you please give advice about handling large data files with memory management techniques? I am attempting to read three large files (1 GB, 208 MB, 725 MB) sequentially and place the data into arrays for processing. Here is my psuedocode:

Re: Where are the [hidden] nibs and other resources?

2008-03-11 Thread Nathan Duran
On Mar 11, 2008, at 10:08 AM, James Hober wrote: In the Finder, when I open up my app's package, I find all my nib files and other resources. If I open the package of an Apple app, some nibs and other resources are in there, but many are not. Where are they? Why aren't they there? Can

Re: Where are the [hidden] nibs and other resources?

2008-03-11 Thread stephane
On Mar 11, 2008, at 6:08 PM, James Hober wrote: In the Finder, when I open up my app's package, I find all my nib files and other resources. If I open the package of an Apple app, some nibs and other resources are in there, but many are not. Where are they? Somewhere else : maybe these

Re: To unmount a volume

2008-03-11 Thread Randall Meadows
On Mar 11, 2008, at 11:03 AM, Nick Rogers wrote: Hi, How can I unmount a volume knowing its POSIX path (/dev/rdisk1) and knowing its mounted name (Volumes/TREK)? Is there any API to do that in cocoa? NSWorkspace -unmountAndEjectDeviceAtPath:? ___

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
Brilliant Julien! Thank you! I had always been curious why initializers returned id, since their return could be made specific to the class. I've been doing what I've done in many classes, and some give me grief, and not others. Both of your assessments are correct. To validate #1, if I

Re: Displaying at appropriate time after text layout...?

2008-03-11 Thread Steve Shepard
Hi Keith, I saw this same behavior on Leopard (but not on Tiger). My memory of the specific details is a little vague, but I believe there is a bug where the view hierarchy does not recognize needsDisplay when the view is invalidated during background layout. I was able to work around the problem

Re: Quit application when window closes

2008-03-11 Thread Kevin Dixon
Your window controller will need the method - (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)inSender { return YES; } and then you need to specify the window controller as the delegate for the application [NSApp setDelegate:self]; I do that in awakeFromNib, but y

Re: Core Data MOM configurations and renaming...

2008-03-11 Thread Martin Linklater
On 7 Mar 2008, at 23:13, Martin Linklater wrote: Hi - I'm having some problems with MOM configurations. I have been playing about with some data models and have duplicated and renamed one. When I initialise the MOM using the datamodel name I get results that don't make sense. Here's a snipp

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Julien Jalon
It depends on what you mean by "bad"... it is clearly bad Cocoa coding style (*). It also lead to a lot of typing problems when subclassing you classes. If the compiler can't decide which methods your code is referring to, it can end up use the wrong signature producing incorrect code. For example,

Re: Core Animation Choppyness

2008-03-11 Thread Jonathan Dann
On 10 Mar 2008, at 22:40, Scott Anguish wrote: if you stop the animation of the replaceSubview... is that no longer choppy? This is one of the most expensive animations possible. That fixed it, looks great now! It was a flickering NSPopUpButton that was causing me grief. also, are all

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Chris Hanson
On Mar 11, 2008, at 1:19 AM, Stuart Malin wrote: The interface for the XMPPStream initializer is: - (XMPPStream*) initWithDelegate:(id)initialDelegate; The canonical return type of an -init method is (id). So the above should be: - (id)initWithDelegate:(id)initialDelegate

Re: Working with large files and Memory

2008-03-11 Thread Jens Alfke
On 11 Mar '08, at 10:18 AM, Jean-Daniel Dupas wrote: The first advice I can give you is "do not load the whole file into memory". Absolutely. Use read stream to read chunk of data and process them. (see NSInputStream or NSFileHandle). Or if the file is simple ascii text with newlines, y

Re: To unmount a volume

2008-03-11 Thread Mike Abdullah
Check out -[NSWorkspace unmountAndEjectDeviceAtPath:] Mike. On 11 Mar 2008, at 17:03, Nick Rogers wrote: Hi, How can I unmount a volume knowing its POSIX path (/dev/rdisk1) and knowing its mounted name (Volumes/TREK)? Is there any API to do that in cocoa? Wishes, Nick

Re: NSBundle wierdness in OCUnit target:

2008-03-11 Thread Chris Hanson
On Mar 10, 2008, at 6:57 PM, William Hunt wrote: On Mar 10, 2008, at 6:29 PM, Chris Hanson wrote: On Mar 10, 2008, at 4:44 PM, William Hunt wrote: When I call: NSLog( @"bundlePath: %@", [[NSBundle mainBundle] bundlePath] ); I get: 2008-03-10 16:41:18.565 otest[3819:80f] bundlePath: /Devel

Re: Check box cell in NSTableView

2008-03-11 Thread Ivan C Myrvold
I have worked with NSTableView code for more than 6 years, but I am sure I have not learned everything there is to learn. Yes, I know there usually is 1 shared cell in NSTableColumn. You are wrong in stating that there can not be more than a shared cell in an NSTableColumn. I am using bindi

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
Thanks Chris. You are right on -- I had more than one method signature with the same, generic style name. My rationale for departing from the canonical approach is because then I get a bit of extra type checking at compile time. Given the canonical approach of returning id, one can define

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Mike Abdullah
On 11 Mar 2008, at 21:09, Stuart Malin wrote: Thanks Chris. You are right on -- I had more than one method signature with the same, generic style name. My rationale for departing from the canonical approach is because then I get a bit of extra type checking at compile time. Given the c

NSTableView + delete button?

2008-03-11 Thread Kevin Dixon
I'm using an NSTableView, and I want to be able to remove items from the list by pressing the delete key on the keyboard. What is the procedure to receive a message when a key is pressed and the table view has focus? Thanks, -Kevin ___ Cocoa-dev mailin

Re: NSTableView + delete button?

2008-03-11 Thread j o a r
On Mar 11, 2008, at 3:03 PM, Kevin Dixon wrote: I'm using an NSTableView, and I want to be able to remove items from the list by pressing the delete key on the keyboard. What is the procedure to receive a message when a key is pressed and the table view has focus? Subclass NSTableView an

Launch Daemon Best Practices?

2008-03-11 Thread Karl Moskowski
I'm working on a utility that has to be running even if no one is logged in. A bit of research leads me to think I should implement it as a launch daemon, with a separate configuration UI. Am I on the right track, or is there a better approach? Any pointers to sample code? I assume I'm go

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Stuart Malin
Thanks everybody who replied. From the conversation, I now understand why the two line version didn't have the compiler warning while the one line version did: once the +alloc was assigned to an ivar, the compiler then knew which of the multiple -init methods to use. I thought I was adding v

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Quincey Morris
On Mar 11, 2008, at 14:09, Stuart Malin wrote: My rationale for departing from the canonical approach is because then I get a bit of extra type checking at compile time. Personally I prefer the factory method approach, a la [NSArray array] etc: In your header file: + (XMPPStream

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread j o a r
On Mar 11, 2008, at 3:49 PM, Quincey Morris wrote: Personally I prefer the factory method approach, a la [NSArray array] etc: Note that factory class methods typically also return id for the same reason that init methods return id (NSArray, NSString, et.c.). This in contrast to shared i

Re: NSTableView + delete button?

2008-03-11 Thread Quincey Morris
On Mar 11, 2008, at 15:12, j o a r wrote: On Mar 11, 2008, at 3:03 PM, Kevin Dixon wrote: I'm using an NSTableView, and I want to be able to remove items from the list by pressing the delete key on the keyboard. What is the procedure to receive a message when a key is pressed and the tabl

Re: Launch Daemon Best Practices?

2008-03-11 Thread Hamish Allan
On Tue, Mar 11, 2008 at 10:30 PM, Karl Moskowski <[EMAIL PROTECTED]> wrote: > I assume I'm going to have to get the GUI to write settings to / > Library/Preferences/, and notify the daemon of to reload changes via > distributed objects. Why not do it the other way round? Update settings via di

Window not showing

2008-03-11 Thread Mr. Gecko
Hello I am having trouble showing a window. I am sure IBOutlet NSWindow *progressPanel; is connected to the window in interface builder, I am sure mine [progressPanel orderFront:self]; works because I did it for the main window at start up. One thing I'm not sure about is my method to sho

Re: Launch Daemon Best Practices?

2008-03-11 Thread Karl Moskowski
On 11-Mar-08, at 7:05 PM, Hamish Allan wrote: On Tue, Mar 11, 2008 at 10:30 PM, Karl Moskowski <[EMAIL PROTECTED]> wrote: I assume I'm going to have to get the GUI to write settings to / Library/Preferences/, and notify the daemon of to reload changes via distributed objects. Why not do it

Re: NSURLDownload and userInfo

2008-03-11 Thread Ben Lachman
On Mar 11, 2008, at 10:42 AM, Jens Alfke wrote: I don't know if I agree with the working with the APIs bit. I think it's obvious that the APIs expect a single delegate to be able to handle multiple objects using it concurrently, thus the passing of the object that is delegating to the dele

NSTask and process group IDs

2008-03-11 Thread Hamish Allan
Hi, I'm writing an app that uses an NSTask to spawn a long-lived process. When my app is force-quit or otherwise SIGKILLed, the spawned process gets re-parented and hangs around indefinitely. I was hoping to use process groups to tackle this, but although setpgid() reports success, it doesn't seem

Re: Launch Daemon Best Practices?

2008-03-11 Thread Hamish Allan
On Tue, Mar 11, 2008 at 11:16 PM, Karl Moskowski <[EMAIL PROTECTED]> wrote: > Do processes run by launchd automatically write their preference > plists to /Library/Preferences/ using NSUserDefaults? If they're running as root, probably; but NSUserDefaults saves you from having to care about suc

Re: Quit application when window closes

2008-03-11 Thread Felipe Monteiro de Carvalho
Thanks for the answers, this indeed works very well. Delegates are quite easy to work with! But what if I wanted to have a "main window". i.e. the application only closes when this window is closed? I did a small search, and I see I can set a delegate for windowWillClose, but I wonder if this is t

Re: NSTask and process group IDs

2008-03-11 Thread Nir Soffer
On Mar 12, 2008, at 01:24, Hamish Allan wrote: I'm writing an app that uses an NSTask to spawn a long-lived process. When my app is force-quit or otherwise SIGKILLed, the spawned process gets re-parented and hangs around indefinitely. I was hoping to use process groups to tackle this, but altho

Re: Launch Daemon Best Practices?

2008-03-11 Thread Chris Suter
On 12/03/2008, at 10:16 AM, Karl Moskowski wrote: Why not do it the other way round? Update settings via distributed objects, and have the daemon write them to /Library/Preferences. Good idea. Thanks, Hamish. I'm not so sure it's a good idea. The problem is that it relies on your daemon r

Re: Launch Daemon Best Practices?

2008-03-11 Thread Hamish Allan
On Wed, Mar 12, 2008 at 12:18 AM, Chris Suter <[EMAIL PROTECTED]> wrote: > I'm not so sure it's a good idea. The problem is that it relies on > your daemon running which whilst might be true most of the time, it > might not be—if it's restarting for example. I personally would write > the defa

Re: NSTableView + delete button?

2008-03-11 Thread Kevin Dixon
> > On Mar 11, 2008, at 3:03 PM, Kevin Dixon wrote: > >> I'm using an NSTableView, and I want to be able to remove items from >> the >> list by pressing the delete key on the keyboard. What is the >> procedure to >> receive a message when a key is pressed and the table view has focus? > > > Subclas

Re: NSTask and process group IDs

2008-03-11 Thread Hamish Allan
On Tue, Mar 11, 2008 at 11:53 PM, Nir Soffer <[EMAIL PROTECTED]> wrote: > My solution was to open a pipe to the child process, and have the child > process read from the pipe in the background. When the parent process die, > the pipe will be closed and the child can quit. Good idea. I might attem

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread mmalc crawford
On Mar 11, 2008, at 3:59 PM, j o a r wrote: On Mar 11, 2008, at 3:49 PM, Quincey Morris wrote: Personally I prefer the factory method approach, a la [NSArray array] etc: Note that factory class methods typically also return id for the same reason that init methods return id (NSArray, NS

Re: NSTableView + delete button?

2008-03-11 Thread j o a r
On Mar 11, 2008, at 5:47 PM, Kevin Dixon wrote: to catch the pressing of delete on the NSTableView. This works, but reminds me of BASIC...Is there a better way to do this, to make sure I'm getting the delete key, say even on international keyboards? See "NSDeleteCharacter" and similar

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread Quincey Morris
On Mar 11, 2008, at 17:56, mmalc crawford wrote: Moreover, a problem with using the "factory method approach" is that they return autoreleased objects. If you have a particular need to be concerned about performance (as you might especially in a resource-constrained environment), it is gen

Re: Launch Daemon Best Practices?

2008-03-11 Thread Karl Moskowski
On 11-Mar-08, at 8:18 PM, Chris Suter wrote: On 12/03/2008, at 10:16 AM, Karl Moskowski wrote: Why not do it the other way round? Update settings via distributed objects, and have the daemon write them to /Library/Preferences. Good idea. Thanks, Hamish. I'm not so sure it's a good idea.

Re: Launch Daemon Best Practices?

2008-03-11 Thread Chris Suter
On 12/03/2008, at 12:39 PM, Karl Moskowski wrote: Why would that location be wrong? If your preferences aren't user specific, I don't think they should be there. You also shouldn't be running your daemon as root unless you absolutely have to. After Hamish's original response, I thought

Controlling line tightening

2008-03-11 Thread John Stiles
I'm using line tightening in some of my dialogs and 99% of the time it works great, but there are a few aspects of it that don't work for my app. In particular, when line tightening kicks in, first it attempts to shrink the text to fit the box, which is awesome. But when it still doesn't fit ev

Re: Controlling line tightening

2008-03-11 Thread John Stiles
Whoops, this is easy! [myParagraphStyle setLineBreakMode:NSLineBreakByClipping]; I guess I didn't get enough sleep last night :) I don't think this completely addresses my question—when the text field gets too full, it looks like it does lose its tightening—but it's good enough for m

Re: Controlling line tightening

2008-03-11 Thread John Stiles
Gah, I spoke too soon. This "solution" actually disables tightening entirely. So I'm back to square one. Please help! John Stiles wrote: Whoops, this is easy! [myParagraphStyle setLineBreakMode:NSLineBreakByClipping]; I guess I didn't get enough sleep last night :) I don't think th

Problem with NSDragPboard

2008-03-11 Thread Jamie Phelps
Hi, all. I am working on the Hillegass chapter that covers drag and drop, and I have the following method in my code. - (void)writeStringToPasteboard:(NSPasteboard *)pb { NSLog(@"Writing %@ to pasteboard [EMAIL PROTECTED]",self.string, pb); // Copy string data to the pasteboard. [pb

Re: NSURLDownload and userInfo

2008-03-11 Thread Adam Leonard
Hi, Oh, sorry, replace everything in that message with NSURLDownload, same idea. I agree with your original approach, especially if you just need to store an int (or an NSNumber in this case). There is a reason almost every delegate method in Cocoa passes the delegate object as a parameter

Re: Working with large files and Memory

2008-03-11 Thread Carl McIntosh
Thank you to both for your good advice. I will look into this. Carl. On Tuesday, March 11, 2008, at 04:49PM, "Jens Alfke" <[EMAIL PROTECTED]> wrote: > >On 11 Mar '08, at 10:18 AM, Jean-Daniel Dupas wrote: > >> The first advice I can give you is "do not load the whole file into >> memory". > >Ab

Prevent click through (Tiger and Leopard)

2008-03-11 Thread Marc Respass
Hi All, I am confused about how to prevent click through. My document puts up a window when a button is clicked. I disable the button then display the other window. If the user clicks off the other window (it resigns key), then I close it and re-enable the button. But the main window beco

Re: Problem with NSDragPboard

2008-03-11 Thread Dave Hersey
The only thing I can see is that the docs say that you need to send the pasteboard the "types" or "availableTypeFromArray:" selectors before sending "stringForType:", so maybe you're getting screwy log results without that. Does it change if you add a [pb types]; before the last NSLog? -

Re: Prevent click through (Tiger and Leopard)

2008-03-11 Thread Jens Alfke
On 11 Mar '08, at 9:36 PM, Marc Respass wrote: I am confused about how to prevent click through. I don't _think_ this is related to "click-through", as in buttons in inactive windows still responding to clicks. Click-through doesn't happen for buttons explicitly marked as disabled. My d

Re: Problem with NSDragPboard

2008-03-11 Thread Jens Alfke
On 11 Mar '08, at 8:13 PM, Jamie Phelps wrote: // Copy string data to the pasteboard. [pb setString:self.string forType:NSStringPboardType]; You need to declare the type(s) on the pasteboard, before setting the data. —Jens smime.p7s Description: S/MIME cryptographic signat

Re: warning: assignment from distinct Objective-C type

2008-03-11 Thread mmalc crawford
On Mar 11, 2008, at 6:11 PM, Quincey Morris wrote: Moreover, a problem with using the "factory method approach" is that they return autoreleased objects. If you have a particular need to be concerned about performance (as you might especially in a resource-constrained environment), it is g

  1   2   >