Editing in a tableview without selecting

2009-11-01 Thread Ben Haller
Hi all. I've got an NSTableView that I'd like to be editable. Even if I return YES from -tableView:shouldSelectRow: and YES from tableView:shouldEditTableColumn:row:, however, editing does not actually commence. The row selects, and I've confirmed with logs that both delegate methods a

Re: Editing in a tableview without selecting

2009-11-01 Thread Ben Haller
On 1-Nov-09, at 12:42 PM, Ben Haller wrote: Hi all. I've got an NSTableView that I'd like to be editable. Even if I return YES from -tableView:shouldSelectRow: and YES from tableView:shouldEditTableColumn:row:, however, editing does not actually commence. The row selects, and I've confi

Re: Asynchronous downloading again

2009-11-01 Thread Jens Alfke
On Oct 31, 2009, at 6:50 PM, DKJ wrote: All of the files have to be downloaded before the app can do anything. I get the connectionDidFinishLoading delegate method of my one and only NSURLConnection to call a downloadFinished method at the end of the synchronous downloads, so the app knows

Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)

2009-11-01 Thread Jens Alfke
On Oct 31, 2009, at 12:44 PM, Russell Finn wrote: -- i.e. key, object, key, object; this is what I tried to correct this in my post, as shown above. Yeah, sorry about that; my mistake. (I'm so used to using my $dict, which puts the keys/values in the 'correct' order...) —Jens ___

objectAtIndex

2009-11-01 Thread Nava Carmon
Hi, When I ran Build and Analyze on my code, it has pointed as a possible leak the following statement: NSObject *anObject = [anArray objectAtIndex:i]; anObject wasn't released and here's the question: whether anObject is a copy of actual object, that is a member of anArray or it's the o

Re: objectAtIndex

2009-11-01 Thread Bryan Henry
That line alone does not indicate any memory leaks occurring due to over-retaining objects. You'll need to provide more context (the surrounding code, etc). The object returned by -[NSArray objectAtIndex:] is the actual object (ie. pointer to the actual object's space in memory) stored in t

Re: objectAtIndex

2009-11-01 Thread Sherm Pendley
On Sun, Nov 1, 2009 at 2:44 PM, Nava Carmon wrote: > > NSObject *anObject = [anArray objectAtIndex:i]; ... > Should I release it? No. You didn't create anObject with +alloc or a method beginning with -copy, nor did you send it a -retain message. Therefore you do not own it and must not release it

Does [NSNetService getInputStream:outputStream:] really return retain objects and where does it say that

2009-11-01 Thread Markus Spoettl
Hi, I'm puzzled by a comment in the WiTap iPhone SDK example project that I can't confirm through documentation or header comments. The method and comment is this (AppController.m line 214 onwards): - (void) browserViewController:(BrowserViewController *)bvc didResolveInstance:(NSNetSer

Re: Editing in a tableview without selecting

2009-11-01 Thread Scott
I'm new to Obj-c / Cocoa but this was helpful in figuring out editable table views I was trying to create with IB. Maybe it can help you in your case. http://www.idevgames.com/forum/showpost.php?p=94784&postcount=3 I know I wasn't putting a dictionary object into an array with the same iden

Re: Editing in a tableview without selecting

2009-11-01 Thread Ben Haller
On 1-Nov-09, at 4:22 PM, Scott Waters wrote: I'm new to Obj-c / Cocoa but this was helpful in figuring out editable table views I was trying to create with IB. Maybe it can help you in your case. http://www.idevgames.com/forum/showpost.php?p=94784&postcount=3 I know I wasn't putting a dictiona

Re: Editing in a tableview without selecting

2009-11-01 Thread Graham Cox
On 02/11/2009, at 4:42 AM, Ben Haller wrote: But where? I've been hunting for a -setEditable:YES method somewhere that I need to call, but I haven't found it... Hi Ben, Have you tried -setEditable:YES on the textfield cell you're using for the table column? (Inherited from NSCell). I'm

Re: Does [NSNetService getInputStream:outputStream:] really return retain objects and where does it say that

2009-11-01 Thread Jens Alfke
On Nov 1, 2009, at 1:30 PM, Markus Spoettl wrote: The documentation doesn't back this assertion, neither does the header comment in NSNetServices.h. According to the memory management rules the method should return autoreleased streams. Yes; but that doesn't necessarily mean the streams wi

Commandline Tool Help - NSDistantObject and NSConnection

2009-11-01 Thread aaron smith
hey Folks, quick question. I'm building an app that I'm providing a command line tool for. I have it hooked up and working. However the strange thing is that it works the first time it's run, but then just throws exceptions. I'm using a proxy object, which is exposed through NSConnection, and thr

Re: Does [NSNetService getInputStream:outputStream:] really return retain objects and where does it say that

2009-11-01 Thread Markus Spoettl
On Nov 2, 2009, at 12:51 AM, Jens Alfke wrote: Yes; but that doesn't necessarily mean the streams will go away soon if you don't retain them. An NSStream object is usually scheduled on a runloop, which keeps a reference to it as long as its open, so I believe it will stay around even if not

Re: Editing in a tableview without selecting

2009-11-01 Thread Ben Haller
On 1-Nov-09, at 6:01 PM, Graham Cox wrote: On 02/11/2009, at 4:42 AM, Ben Haller wrote: But where? I've been hunting for a -setEditable:YES method somewhere that I need to call, but I haven't found it... Hi Ben, Have you tried -setEditable:YES on the textfield cell you're using for the

Update an NSMenu / NSMenuItem while it's being displayed on key down?

2009-11-01 Thread aaron smith
Hey all, quick question. What's the best way to go about updating an NSMenu that's currently being shown. For example, I have a button that triggers an NSMenu popup call and I want to detect the option key press and update some of the items in the menu. anyone done this? thanks _

Re: Update an NSMenu / NSMenuItem while it's being displayed on key down?

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 7:31 PM, aaron smith wrote: > What's the best way to go about updating an NSMenu that's currently being > shown. For example, I have a button that triggers an NSMenu popup call and I > want to detect the option key press and update some of the items in the > menu. For this

Re: Editing in a tableview without selecting

2009-11-01 Thread Graham Cox
On 02/11/2009, at 1:04 PM, Ben Haller wrote: I think I will have to construct a test case to see if I can reproduce this in a simple, isolated way. If that test case reproduces the problem, then I will post it somewhere and follow up on the list... Well, setting up a table view in IB,

Re: Editing in a tableview without selecting

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 9:42 AM, Ben Haller wrote: > - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject > forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex You might want to double-check that you didn't typo this in your data source's @implementation. --Kyl

Create an NSCharacterSet constant

2009-11-01 Thread John Joyce
Hi All, Is it possible to create an NSCharacterSet constant? Attempting to do so with the methods for creating an NSCharacterSet naturally fails to compile with "initializer element is not constant" I would ideally like to be able to do this. Is it best just to declare a global constant string

Re: Create an NSCharacterSet constant

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 9:19 PM, John Joyce wrote: > Is it possible to create an NSCharacterSet constant? No. By definition, constants are assigned values at compile time. Objects other than strings can only be created at runtime. There is no way around this fact. > Is it best just to declare a

Re: Create an NSCharacterSet constant

2009-11-01 Thread Graham Cox
On 02/11/2009, at 4:19 PM, John Joyce wrote: Is it possible to create an NSCharacterSet constant? Attempting to do so with the methods for creating an NSCharacterSet naturally fails to compile with "initializer element is not constant" I would ideally like to be able to do this. Is it best j

Re: Create an NSCharacterSet constant

2009-11-01 Thread Matt Neuburg
On Sun, 1 Nov 2009 21:29:25 -0800, Kyle Sluder said: >I'm partial to the following construct: > >+ (Foo *)sharedFoo { > static Foo *sharedFoo; > dispatch_once_t once; > dispatch_once(&once, ^{ sharedFoo = [[foo alloc] init]; } > return sharedfoo; >} Why (I'm really asking, not arguing; I don'

Re: Create an NSCharacterSet constant

2009-11-01 Thread John Joyce
On Nov 1, 2009, at 11:32 PM, Graham Cox wrote: On 02/11/2009, at 4:19 PM, John Joyce wrote: Is it possible to create an NSCharacterSet constant? Attempting to do so with the methods for creating an NSCharacterSet naturally fails to compile with "initializer element is not constant" I woul

Re: Create an NSCharacterSet constant

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 9:49 PM, Matt Neuburg wrote: > Why (I'm really asking, not arguing; I don't know anything about GCD) is > this better than the traditional: It avoids a race condition if +sharedFoo is called simultaneously from different threads, and it's wicked fast (Cmd-DoubleClick dispat

Re: Create an NSCharacterSet constant

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 9:50 PM, John Joyce wrote: >  Category, yeah, that's totally one way I thought about, but I was thinking > more of an enhancement request in Radar. I figured the nature of it > inheriting from NSObject implies there are some kind of optimizations under > the hood (otherwise

Re: Create an NSCharacterSet constant

2009-11-01 Thread Graham Cox
On 02/11/2009, at 4:50 PM, John Joyce wrote: Category, yeah, that's totally one way I thought about, but I was thinking more of an enhancement request in Radar. I figured the nature of it inheriting from NSObject implies there are some kind of optimizations under the hood (otherwise we'd j

Re: Create an NSCharacterSet constant

2009-11-01 Thread John Joyce
On Nov 2, 2009, at 12:04 AM, Graham Cox wrote: On 02/11/2009, at 4:50 PM, John Joyce wrote: Category, yeah, that's totally one way I thought about, but I was thinking more of an enhancement request in Radar. I figured the nature of it inheriting from NSObject implies there are some kind

Re: Editing in a tableview without selecting

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 9:42 AM, Ben Haller wrote:\ >  The only unusual thing about this tableview is that I set it up in code > instead of in IB, so I assume the root of the problem is in my programmatic > setup code.  But where?  I've been hunting for a -setEditable:YES method > somewhere that I

Re: Create an NSCharacterSet constant

2009-11-01 Thread John Joyce
On Nov 1, 2009, at 11:59 PM, Kyle Sluder wrote: On Sun, Nov 1, 2009 at 9:50 PM, John Joyce wrote: Category, yeah, that's totally one way I thought about, but I was thinking more of an enhancement request in Radar. I figured the nature of it inheriting from NSObject implies there are some k

Re: objectAtIndex

2009-11-01 Thread Nava Carmon
Thank you, that answers my question, Nava On Nov 1, 2009, at 10:24 PM, Sherm Pendley wrote: On Sun, Nov 1, 2009 at 2:44 PM, Nava Carmon wrote: NSObject *anObject = [anArray objectAtIndex:i]; ... Should I release it? No. You didn't create anObject with +alloc or a method beginning with -

Re: Create an NSCharacterSet constant

2009-11-01 Thread Kyle Sluder
On Sun, Nov 1, 2009 at 11:03 PM, John Joyce wrote: > I see it as a useful thing to have predefined character sets that don't need > to be managed. So you just want more things like +whitespaceCharacterSet? That makes sense. > At the very least, I will probably submit a radar on adding locale-sp