Reading image from system clipboard

2009-08-02 Thread Deepa
Hi, I am developing an desktop app for which I want to implement a behavior which is similar to 'New from clipboard' of Preview application. I tried using NSPasteboard: // To get file copied to clipboard from Finder NSArray *files = [[NSPasteboard generalPasteboard] propertyListForType:

Re: Design Paterns: +/- Initializers and Subclassing

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 22:26, Quincey Morris wrote: return [ [ [[self class] alloc] init ] autorelease ] ; ('self' refers to the class object because this is a class method) Doh, if that's true, then: return [ [ [self alloc] init ] autorelease ] ; should be good enough. (IIRC, [

Re: Design Paterns: +/- Initializers and Subclassing

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 22:17, Christopher J Kemsley wrote: How do I make the +method call return an initialized object of whatever type the +method was sent to? (so that [CYMethodSubclass method] returns [ [ [CYMethodSubclass alloc] init ] autorelease]) Like this: return [ [ [[self

Design Paterns: +/- Initializers and Subclassing

2009-08-02 Thread Christopher J Kemsley
Ok, so here's the deal: I have a class (CYMethod) that provides a standard interface for multiple implementations of the same type (multiple ways in which to read a file, for instance). Here are its constructors: + (CYMethod*) method { return [ [ [CYMethod alloc] init ] a

Re: Table view data source methods order?

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 22:04, Chase Meadors wrote: I'm having a bit of trouble here with table view data source methods. I have implemented. I have these three: 1) - (NSCell *)tableView:(NSTableView *)sender dataCellForTableColumn:(NSTableColumn *)tableColumn row: (NSInteger)row; 2) - (id)tabl

Table view data source methods order?

2009-08-02 Thread Chase Meadors
I'm having a bit of trouble here with table view data source methods. I have implemented. I have these three: 1) - (NSCell *)tableView:(NSTableView *)sender dataCellForTableColumn: (NSTableColumn *)tableColumn row:(NSInteger)row; 2) - (id)tableView:(NSTableView *)sender objectValueForTableColu

Re: How to set the name of open-with application for a specific file?

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 20:09, Harry Jordan wrote: The place to look is the Launch Services Reference, in particular the LSSetDefaultRoleHandlerForContentType() function. I haven't used the setter functions myself, but it looks reasonable. Hope that helps. My interpretation was the the OP wants to

Re: Bindings/KV Too Magical

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 18:07, Gregory Holden wrote: 1) NSArrayController and canRemove, how does it know? A familiar example to those who ran through Aaron Hillegass' Learning Cocoa Programming. I have an NSArrayController, an NSButton, and an NSTableView - NSArrayController's contentArray is an

Re: Bindings/KV Too Magical

2009-08-02 Thread Chase Meadors
On Aug 2, 2009, at 8:07 PM, Gregory Holden wrote: Some n00b questions about Bindings/KV I'm facing: 1) NSArrayController and canRemove, how does it know? A familiar example to those who ran through Aaron Hillegass' Learning Cocoa Programming. I have an NSArrayController, an NSButton, and a

Re: How to set the name of open-with application for a specific file?

2009-08-02 Thread Harry Jordan
(Not sure why this didn't get sent to the list the first time round, but here it is for the Google bots to pick up) The place to look is the Launch Services Reference, in particular the LSSetDefaultRoleHandlerForContentType() function. I haven't used the setter functions myself, but it looks reaso

Bindings/KV Too Magical

2009-08-02 Thread Gregory Holden
Some n00b questions about Bindings/KV I'm facing: 1) NSArrayController and canRemove, how does it know? A familiar example to those who ran through Aaron Hillegass' Learning Cocoa Programming. I have an NSArrayController, an NSButton, and an NSTableView - NSArrayController's contentArray is a

Cookies Problems

2009-08-02 Thread Chris
Hello I am trying to write a test program that will send a value through a web form, get the cookie information and then relay that cookie information back to the sever. I have setup 3 php pages, which work correctly. The first page displays a web form with one field named "name". The sec

Re: How to set the name of open-with application for a specific file?

2009-08-02 Thread Kyle Sluder
On Aug 2, 2009, at 6:00 PM, MATSUMOTO Satoshi wrote: I have found an undocumented api to do this. Then please don't use it. :) There is no guarantee that undocumented API will continue to function on any previous, future, or even current version of the OS. I think this api is not opened

Re: How to set the name of open-with application for a specific file?

2009-08-02 Thread MATSUMOTO Satoshi
I have found an undocumented api to do this. I think this api is not opened to the public because of the security reason. Satoshi On 2009/07/31, at 22:00, MATSUMOTO Satoshi wrote: Dear Jerry Krinock, On 2009/07/31, at 21:43, Jerry Krinock wrote: Activate Finder. Select a subject document

Design pattern for "per-document" settings

2009-08-02 Thread Graham Cox
Hi all, I'm just thinking through a couple of problems and wondered if anyone had anything to say about it... In my app I have several things that apply on a "per document" level, for example, the mapping from Quartz co-ordinate values to some other measurement system, such as millimetres

Re: From NSTextView to address an NSTextField

2009-08-02 Thread Kyle Sluder
On Aug 2, 2009, at 1:48 PM, Steve Cronin wrote: At runtime if I have access to an instance of NSTextView how can I address the NSTextField? I know I should know this but I having a 'moment'... Your question doesn't make sense. You posted the inheritance diagrams of two different classes,

From NSTextView to address an NSTextField

2009-08-02 Thread Steve Cronin
Folks; NSTextView <- NSText <- NSView <- NSReponder <- NSObject NSTextField <- NSView <- NSReponder <- NSObject At runtime if I have access to an instance of NSTextView how can I address the NSTextField? I know I should know this but I having a 'moment'... Steve

Re: IB TextField Bindings and dragging text

2009-08-02 Thread Andy Lee
On Aug 2, 2009, at 3:17 PM, Steve Cronin wrote: NSDictionary *bindDict = [self infoForBinding:@"value"]; [[bindDict objectForKey:@"NSObservedObject"] setValue:newString forKeyPath:[bindDict objectForKey:@"NSObservedKeyPath"]]; You should probably use NSObservedObjectKey and

Re: incorrect checksum for freed object

2009-08-02 Thread Scott Ribe
> I don't think this problem is down to confusion over memory management > necessarily. Poor choice of words on my part... -- Scott Ribe scott_r...@killerbytes.com http://www.killerbytes.com/ (303) 722-0567 voice ___ Cocoa-dev mailing list (Cocoa-de

Re: IB TextField Bindings and dragging text

2009-08-02 Thread Steve Cronin
Folks; Found the answer: NSDictionary *bindDict = [self infoForBinding:@"value"]; [[bindDict objectForKey:@"NSObservedObject"] setValue:newString forKeyPath:[bindDict objectForKey:@"NSObservedKeyPath"]]; On Aug 2, 2009, at 1:32 PM, Steve Cronin wrote: Folks; I have se

Re: NSURLConnection performance on iPhone

2009-08-02 Thread Greg Guerin
Ben Lachman wrote: The only problem is that I'm seeing lousy download speed, particularly over wifi (~200K/sec over 3G, <100K/sec over wifi). Any ideas as to why this might be or if there is anything I can do to improve things? Make sure the iPhone wifi isn't experiencing high interferenc

Re: IB TextField Bindings and dragging text

2009-08-02 Thread Quincey Morris
On Aug 2, 2009, at 11:32, Steve Cronin wrote: Within the performDragOperation there is a [self setString:newString]; This, unsurprisingly, does NOT update the bindings mechanism. Is there a way that I can 'flash' the bindings mechanism from within the custom text field or do I need to build ou

IB TextField Bindings and dragging text

2009-08-02 Thread Steve Cronin
Folks; I have several text fields bound to a mutable dictionary in the window controller. Works fine. I want to provide drag-n-drop text snippets into these text fields. I have all the drag-n-drop working just fine -- (uses custom text fields and the window field editor) Within the perfor

Re: incorrect checksum for freed object

2009-08-02 Thread Alastair Houghton
On 1 Aug 2009, at 20:21, kvic...@pobox.com wrote: At 12:09 PM -0600 8/1/09, Scott Ribe wrote: Still though, Shawn's basic point is right: Ken is confused about memory management *somewhere* in his code. well... i'm not sure i'd use the word confused, as i do understand memory management

Re: How to change focus ring color?

2009-08-02 Thread Benjamin Dobson
NSBezierPath's -setClip. http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSBezierPath_Class/Reference/Reference.html#/ /apple_ref/occ/instm/NSBezierPath/setClip On 2 Aug 2009, at 11:46:27, Squ Aire wrote: Nonetheless, can you (or someone else in here) tell us

Re: NSURLConnection performance on iPhone

2009-08-02 Thread Alastair Houghton
On 2 Aug 2009, at 06:50, Ben Lachman wrote: I'm working on a small iPhone project this weekend that among other things downloads some medium sized video files. To do this I set up a NSURLConnection and use an NSOutputStream to write the data to my apps' documents folder as it arrives. The

RE: How to change focus ring color?

2009-08-02 Thread Squ Aire
Nonetheless, can you (or someone else in here) tell us what guides and documents we should read in order to be able to make our entirely custom focus rings that draw outside the frame like the default one does? It would be nice to know for future reference. Can it be done entirely with Cocoa Gr

Re: IPhone Textview question

2009-08-02 Thread Alastair Houghton
On 1 Aug 2009, at 19:30, Development wrote: I left out a crucial bit of information not realizing it was crucial. I was using the NSURLConnection synchronous request every 4 seconds on the main thread. Erm, yeah, that'll do it. As a general rule of thumb, you don't want to be doing synch

Re: How to change focus ring color?

2009-08-02 Thread Rob Keniger
On 02/08/2009, at 4:29 PM, Graham Cox wrote: I may be wrong, but my understanding was that this sets up some sort of special mode in the graphics context that draws the focus ring as a special case. If you notice, the ring is not a simple solid colour but some kind of gradient. I also thin