Re: How to get tiff from clipboard and convert to bmp?

2010-04-02 Thread zhiy xue
Thanks Ken, I have tried it and it works well for me. On Apr 2, 2010, at 1:15 PM, Ken Ferry wrote: On Thu, Apr 1, 2010 at 8:44 PM, Kyle Sluder wrote: On Thu, Apr 1, 2010 at 7:35 PM, zhiy xue wrote: > I want to support get *.tiff data from clipboard, and convert it to bmp > format. Below

Alternative startup for application

2010-04-02 Thread Gideon King
Hi, I would like to have an application I am working on to be able to start up in the normal way from the finder, but also have an alternative startup that users can access in some way, where I will display a panel that most users wouldn't normally want to see. Issues I am having with this are

NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread David Hoerl
Objects: - NSManagedObject *item - some managaged object - NSArray *attributes - an array of the item's attributes Desired Result: - a possibly smaller array of attribites where [item valueForKey:attribute>] != nil. In code, I can simply iterate over the keys, perform the valueForKey, and s

Re: NSDocument and the dreaded "The location of the document XXX cannot be determined"

2010-04-02 Thread Jerry Krinock
On 2010 Apr 01, at 13:50, Martin Wierschin wrote: > I should say that I've overridden my NSDocument's save methods Indeed, you're playing with a highly crafted system there. After adding a "Save As Move" command to an application, I was getting a different but related warning, something like "

Re: NSDocument and the dreaded "The location of the document XXX cannot be determined"

2010-04-02 Thread Joar Wingfors
On 1 apr 2010, at 13.50, Martin Wierschin wrote: > Any help on this would be much appreciated; I've spent way too long on this > silly thing already. Please file a bug report where you outline what you're trying to do: j o a r _

Re: Alternative startup for application

2010-04-02 Thread Jens Alfke
On Apr 2, 2010, at 1:45 AM, Gideon King wrote: > 1. I'm not sure what keyboard or mouse options could be used for this, since > all the character keys change the selection in Finder, and all the normal > modifier keys are used for special functions. So first question is how I can > differentia

Re: Alternative startup for application

2010-04-02 Thread Ashley Clark
On Apr 2, 2010, at 10:30 AM, Jens Alfke wrote: > On Apr 2, 2010, at 1:45 AM, Gideon King wrote: > >> 1. I'm not sure what keyboard or mouse options could be used for this, since >> all the character keys change the selection in Finder, and all the normal >> modifier keys are used for special fu

Re: Creating WebView in code

2010-04-02 Thread Nick Zitzmann
On Apr 1, 2010, at 8:17 PM, Jenny M wrote: > Great, I'm testing that method now. I get everything built alright, > but during the print operation (while the print panel is shown), the > program crashes with the following message in the console: > > - > Debugger() was called! > Th

Re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread Dave DeLong
I can't think of a way to do this without iterating over the entire array. It *might* be possible using key-value coding and fancy keypaths and whatnot, but iteration is going to be far simpler to implement and understand. Dave On Apr 2, 2010, at 8:27 AM, David Hoerl wrote: > Objects: > - NSM

Re: Alternative startup for application

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 08:30, Jens Alfke wrote: > I would have said GetKeys(), but it seems to have been deprecated and removed > in the eyeblink [read: decade] since I last used Carbon. There must be some > modern equivalent for reading the current state of the keyboard? For completeness: The non

CIFilter - output image format

2010-04-02 Thread paul morel
Hi,I have a problem with the output image of my custom CIFilter. Let's say I have a 16 bits image at the input I would like to keep a 16bits image in output.How can I do that? Because so far I have a 8 bits image at the output. Thanks ,Paul

re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread Ben Trumbull
> Objects: > - NSManagedObject *item - some managaged object > - NSArray *attributes - an array of the item's attributes > > Desired Result: > - a possibly smaller array of attribites where [item valueForKey: attribute>] != nil. > > In code, I can simply iterate over the keys, perform the valu

MutableArray losing contents

2010-04-02 Thread Dean Pulsifer
I have looked through the forums, but don't think I have the problems that were described. I have a Cocoa app with a main window and a secondary window. I have a single controller. I don't have a model or a document because I am reading info from the OS and displaying it. In the controller, I h

Re: Detecting which MKAnnotation Detail Disclosure was touched

2010-04-02 Thread Roger Dalal
Help All (please)! I have approximately 80 map annotations on a typical MapKit mapview. I have initialized the annotations with an array generated from a SQLlite database. I need to push a detail view controller once the user touches the annotation Detail Disclosure button on the annotation's C

How to save and restore NSScrollView scroll position?

2010-04-02 Thread James Walker
I have an NSScrollView containing an NSTableView whose content is managed by an NSArrayController. I have a situation where I need to temporarily set the array controller's content to nil, mess with the content, and then hand it back to the array controller, and I'd like to preserve the scroll

Re: Creating WebView in code

2010-04-02 Thread Jenny M
On Fri, Apr 2, 2010 at 9:40 AM, Nick Zitzmann wrote: > That's most likely Flash Player at work, since it's been known to do this. To > work around it, install a dummy SIGINT handler function that does nothing. > See the signal man page for details. > Yup, you're right. That was just something I

Re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread David Hoerl
Having the array of attributes unrolled separately is a little odd. Do you mean you have an array of attribute names from, say the entity, and you want to ask a MO for all its non-nil attribute values and get back an array of matching attribute names for those non-nil values? - Ben Specific

Re: MutableArray losing contents

2010-04-02 Thread Jens Alfke
On Apr 1, 2010, at 8:05 PM, Dean Pulsifer wrote: The second NSBrowser delegate to get hit is willDisplayCell:atRow:column: When I get to this call, the array has 0 objects. The self pointer is still the same. Is the array pointer nil? Sending any message to a nil pointer returns zero (

Re: MutableArray losing contents

2010-04-02 Thread Quincey Morris
On Apr 1, 2010, at 20:05, Dean Pulsifer wrote: > The second NSBrowser delegate to get hit is willDisplayCell:atRow:column: > When I get to this call, the array has 0 objects. The self pointer is still > the same. It's a side issue, but did you check whether the mutable array instance variable w

Re: How to save and restore NSScrollView scroll position?

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 13:15, James Walker wrote: > I have an NSScrollView containing an NSTableView whose content is managed by > an NSArrayController. I have a situation where I need to temporarily set the > array controller's content to nil, mess with the content, and then hand it > back to the

Implied use of Properties

2010-04-02 Thread Dave
Hi All, I came across this code and was wondering if this is normal practice and/or considered good coding style. Given two classes ClassX and ClassY: @interface ClassX { ClassY mClassY; } @property (nonatomic,retain,readonly) ClassY* mClassY @end @interface ClassY { int

Re: MutableArray losing contents

2010-04-02 Thread Dean Pulsifer
The array pointer is not null and it has the same value as when it was full. Yes, it is a member of the controller class. On Fri, Apr 2, 2010 at 4:30 PM, Jens Alfke wrote: > > On Apr 1, 2010, at 8:05 PM, Dean Pulsifer wrote: > > The second NSBrowser delegate to get hit is willDisplayCell:atR

Re: MutableArray losing contents

2010-04-02 Thread Dean Pulsifer
The project is based on some Apple sample code. I took the existing MainMenu.xib with its main window and added another window that included an NSBrowser view. The File's Owner didn't have an obvious link to anything else. I am not using a document. Does this matter? The class of the controlle

Re: Creating WebView in code

2010-04-02 Thread Nick Zitzmann
On Apr 2, 2010, at 2:19 PM, Jenny M wrote: > D'oh, you told me that before and I completely forgot. So I tried > that, but the page still appears blank. I don't want the page to be > visible so I didn't set makeKeyOrderFront. > > > NSRect frame = NSMakeRect(0.0, 0.0, pageSiz

Re: Implied use of Properties

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 13:48, Dave wrote: > Is this normal? Looking at the code it seems hard to see what is going on, > Surely it would be better practice to have an init method that does this? e.g. > > self.mClassY = [[alloc] initWithData: initWithData:someData] It's perfectly normal for a class

Re: Implied use of Properties

2010-04-02 Thread Klaus Backert
Hi, Dave On 2 Apr 2010, at 22:48, Dave wrote: Hi All, I came across this code and was wondering if this is normal practice and/or considered good coding style. Given two classes ClassX and ClassY: @interface ClassX { ClassY mClassY; } @property (nonatomic,retain,readonly) Clas

Re: MutableArray losing contents

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 14:03, Dean Pulsifer wrote: > The project is based on some Apple sample code. I took the existing > MainMenu.xib with its main window and added another window that included an > NSBrowser view. > > The File's Owner didn't have an obvious link to anything else. I am not > u

C typedef for NS ptrs?

2010-04-02 Thread Andy O'Meara
Hey folks, quick question... A have a couple vanilla NS object ptrs (e.g. NSWindow*) that I have to pass through some cross-plaform C++ code until it ends up in a .mm file where where the NS object is accessed. The problem is that in the .cpp code, there's no obvious way to declare a NSWindow

Re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread Ben Trumbull
On Apr 2, 2010, at 1:30 PM, David Hoerl wrote: >> Having the array of attributes unrolled separately is a little odd. Do you >> mean you have an array of attribute names from, say the entity, and you want >> to ask a MO for all its non-nil attribute values and get back an array of >> matching

Re: NSPredicate/NSExpression - can they solve this Core Data problem?

2010-04-02 Thread Dave DeLong
Is the use of SUBQUERY() documented anywhere? The only mention I've seen of it is in the reserved keywords section of the Predicate Format String Syntax guide. Dave On Apr 2, 2010, at 3:42 PM, Ben Trumbull wrote: > NSComparisonPredicate* exprPred = (NSComparisonPredicate*)[NSPredicate >

Re: C typedef for NS ptrs?

2010-04-02 Thread Greg Parker
On Apr 2, 2010, at 2:38 PM, Andy O'Meara wrote: > Hey folks, quick question... > > A have a couple vanilla NS object ptrs (e.g. NSWindow*) that I have to pass > through some cross-plaform C++ code until it ends up in a .mm file where > where the NS object is accessed. The problem is that in the

Re: How to save and restore NSScrollView scroll position?

2010-04-02 Thread James Walker
On 4/2/2010 1:47 PM, Quincey Morris wrote: On Apr 2, 2010, at 13:15, James Walker wrote: I have an NSScrollView containing an NSTableView whose content is managed by an NSArrayController. I have a situation where I need to temporarily set the array controller's content to nil, mess with the con

Re: Alternative startup for application

2010-04-02 Thread Gideon King
Excellent, I like the new way of doing it using NSEvent directly, but I do need to support Leopard. If you launch from Finder holding the Option key, Finder closes the window you launched from, but I can tell people to put it in the dock and launch from there to avoid that. Here's what I'm doi

Re: Creating WebView in code

2010-04-02 Thread Jenny M
On Fri, Apr 2, 2010 at 2:08 PM, Nick Zitzmann wrote: > There's one more thing. WebView loads requests asynchronously, so you need to > block while it is loading the request and laying out the page while taking > some time out to run the run loop. So do something like this: > AHA! Thank you, it

Re: NSDocument and the dreaded "The location of the document XXX cannot be determined"

2010-04-02 Thread Martin Wierschin
Hi Jerry, After adding a "Save As Move" command to an application, I was getting a different but related warning, something like "Document has been moved, do you really want to save it to a new location?" The solution was to sprinkle in an extra invocation of saveToURL:ofType:forSaveOper

Re: Creating WebView in code

2010-04-02 Thread Adam R. Maxwell
On Apr 2, 2010, at 2:08 PM, Nick Zitzmann wrote: > > On Apr 2, 2010, at 2:19 PM, Jenny M wrote: > >> D'oh, you told me that before and I completely forgot. So I tried >> that, but the page still appears blank. I don't want the page to be >> visible so I didn't set makeKeyOrderFront. FWIW, I'm

Re: How to save and restore NSScrollView scroll position?

2010-04-02 Thread Ashley Clark
On Apr 2, 2010, at 5:33 PM, James Walker wrote: > On 4/2/2010 1:47 PM, Quincey Morris wrote: >> On Apr 2, 2010, at 13:15, James Walker wrote: >> >>> I have an NSScrollView containing an NSTableView whose content is >>> managed by an NSArrayController. I have a situation where I need to >>> tempor

Re: Alternative startup for application

2010-04-02 Thread Klaus Backert
On 3 Apr 2010, at 01:15, Gideon King wrote: Excellent, I like the new way of doing it using NSEvent directly, but I do need to support Leopard. - (NSUInteger)modifierFlags Available in Mac OS X v10.0 and later. NSAlternateKeyMask Set if Option or Alternate key is pressed. Available in Mac

Re: Alternative startup for application

2010-04-02 Thread Gideon King
That's the instance method. New in 10.6 is the class method of the same name, which is what I need in this case, since I don't have an event to work with. On 03/04/2010, at 12:09 PM, Klaus Backert wrote: > > On 3 Apr 2010, at 01:15, Gideon King wrote: > >> Excellent, I like the new way of doin

Re: Terminating subtasks reliably

2010-04-02 Thread Michael Ash
On Thu, Apr 1, 2010 at 7:19 PM, Dave Keck wrote: >>> Look like a race condition. The man page says getppid() will not fail, but >>> not what happens after the parent dies. I will test this. >> >> If the parent dies, the process becomes the child of launchd. For a quick >> fix I checked for the par

Re: Alternative startup for application

2010-04-02 Thread Michael Nickerson
On Apr 02, 2010, at 10:12 PM, Gideon King wrote: > That's the instance method. New in 10.6 is the class method of the same name, > which is what I need in this case, since I don't have an event to work with. > > On 03/04/2010, at 12:09 PM, Klaus Backert wrote: > >> >> On 3 Apr 2010, at 01:15,

Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Jerry Krinock
I have a table bound to an array controller containing Foo objects and wanted to enable a "Perform Foo" button whenever there is a non-nil selection. Not trusting those pesky proxy objects you get from an array controller's -selection, I wrote a -selectedFoo method which will return either the

iPhone CoreData TableView not updating

2010-04-02 Thread Arnold Nefkens
Hello List, I'm a newbie on iPhone Programming, so please bear with me. I did the first 7 chapters of "More iPhone 3 Development, tackling iPhone SDK3" from Apress regarding the use of CoreData. In these 7 chapters a lot is explained and finally a series of classes and categories are being bui

Invalidated managed objects

2010-04-02 Thread Gideon King
When I create a document, save it, then save as, then save as again, it duplicates the persistent store, so the managed objects I have been using in my application are all invalidated. Now there are a whole lot of places in my application where I have KVO set up on properties of the managed ob

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 20:25, Jerry Krinock wrote: > Now, NSArrayController has five methods which give the selection in some > form, and they are all documented to be "observable using key-value > observing". So to make this work I implemented a > +keyPathsForValuesAffectingSelectedFoo which retu

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Kyle Sluder
On Fri, Apr 2, 2010 at 8:25 PM, Jerry Krinock wrote: > But I never could get it to work.  By logging, I determined the problem:   > None of these five observers are firing the -selectedFoo getter when the > array and table controller's selection changes.  When I added, as a test, > some other ob

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Kyle Sluder
On Fri, Apr 2, 2010 at 8:25 PM, Jerry Krinock wrote: > + (NSSet*)keyPathsForValuesAffectingSelectedFoo { >    return [NSSet setWithObjects: >        // Shotgun approach.  Try 'em all!! >        @"fooArrayController.selectedObjects", >        @"fooArrayController.selectionIndex", >        @"fooArra

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 21:42, Kyle Sluder wrote: >> + (NSSet*)keyPathsForValuesAffectingSelectedFoo { >>return [NSSet setWithObjects: >>// Shotgun approach. Try 'em all!! >>@"fooArrayController.selectedObjects", >>@"fooArrayController.selectionIndex", >>@"fooArrayC

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Kyle Sluder
On Fri, Apr 2, 2010 at 10:05 PM, Quincey Morris wrote: > On Apr 2, 2010, at 21:42, Kyle Sluder wrote: >> Oh, and also the documentation is quite clear that you can't bind >> through a to-many property. > > Wait, where is the to-many property being bound through? Ugh, that's not what I meant to sa

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Kyle Sluder
On Fri, Apr 2, 2010 at 10:05 PM, Quincey Morris wrote: > Wait, where is the to-many property being bound through? Oh, I see what you're saying. It's not being observed *through*, it's being observed *to*. Which would be okay, I guess, if NSArrayController weren't a bad KVO citizen. Way too much

Re: Detecting which MKAnnotation Detail Disclosure was touched

2010-04-02 Thread John Baldwin
You can use view.annotation in - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)view calloutAccessoryControlTapped:(UIControl *)control John On Thursday Apr 1 6:16 PM, at 6:16 PM, Roger Dalal wrote: > Help All (please)! > > I have approximately 80 map annotations on

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Jerry Krinock
On 2010 Apr 02, Quincey Morris wrote: > I only see 4 distinct keys in your list below, since one of them is > duplicated. Yes, you're correct. There are only 4. > I'm suspicious of the "fooArrayController" part. Is it *just* an instance > variable? It's an IBOutlet, and also there is a gett

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Quincey Morris
On Apr 2, 2010, at 22:17, Jerry Krinock wrote: > So you're telling me that all of the keys in a key path must be > KVO-compliant. I hadn't thought so, because in the key path > "fooArrayController.selection", the fooArrayController is hard-wired to an > IBOutlet and never changes. But now I s

Re: Why doesn't -[NSArrayController selection] et al fire keyPathsForValuesAffectingKey?

2010-04-02 Thread Kyle Sluder
On Fri, Apr 2, 2010 at 8:25 PM, Jerry Krinock wrote: > I solved the problem by eliminating all this code and binding my button's > 'enabled' binding instead to the array controller's 'selection' and, to my > surprise, it worked.  My surprise is because, according to superclass > NSObjectControl