Re: configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error

2010-06-30 Thread Jerry Krinock
On 2010 Jun 30, at 16:42, Chris Idou wrote: > According to the doco, the above method is used to "customise creation of the > persistent store" especially with regards to the store type. In my documentation, it's a little different: "Configures the receiver’s persistent store coordinator with

Re: How to revert to an unedited document & window?

2010-06-30 Thread Brad Stone
That was the suggestion I needed. Thank you. Here's what I did in the windowControler: [doc removeWindowController:self]; [[self managedObjectContext] rollback]; [doc close]; and then I use my normal routine to reload the document. On Jun 29, 2010, at 12:23 PM, Jerry Krinock wrote: > > On

configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error

2010-06-30 Thread Chris Idou
According to the doco, the above method is used to "customise creation of the persistent store" especially with regards to the store type. So I've been using the below code, which works perfectly fine for NSBinaryStoreType and NSXMLStoreType, but with NSSQLiteStoreType I get lots of merge erro

Re: NSString ambiguities

2010-06-30 Thread Douglas Davidson
On Jun 30, 2010, at 3:02 PM, Ariel Feinerman wrote: > If we read whole file as a NSString, will be any conversions between \r\n, > \r, \n? Then if not, will be -componentsSeparatedByCharactersInSet: > [NSCharacterSet newlineCharacterSet] create empty strings in Win \r\n case? > So what is the bes

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Laurent Daudelin
On Jun 30, 2010, at 17:48, Greg Parker wrote: > On Jun 30, 2010, at 2:42 PM, Laurent Daudelin wrote: >> Yes, I know that, but can you send an instance method to a class object? > > Yes, you can. Every class object is itself an instance of NSObject. > Therefore, every class object also responds t

NSString ambiguities

2010-06-30 Thread Ariel Feinerman
Hi, If we read whole file as a NSString, will be any conversions between \r\n, \r, \n? Then if not, will be -componentsSeparatedByCharactersInSet: [NSCharacterSet newlineCharacterSet] create empty strings in Win \r\n case? So what is the best: [NSCharacterSet newlineCharacterSet] or [NSCharacterSe

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Greg Parker
On Jun 30, 2010, at 2:42 PM, Laurent Daudelin wrote: > Yes, I know that, but can you send an instance method to a class object? Yes, you can. Every class object is itself an instance of NSObject. Therefore, every class object also responds to all of NSObject's instance methods. http://sealiesof

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Dave Carrigan
On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote: > Well, isn't -respondsToSelector: an instance method? if ([[Someclass class] respondsToSelector:@selector(classSelector)]) { // yup } -- Dave Carrigan d...@rudedog.org Seattle, WA, USA _

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Laurent Daudelin
On Jun 30, 2010, at 17:41, Kyle Sluder wrote: > On Jun 30, 2010, at 2:35 PM, Laurent Daudelin > wrote: > >> On Jun 30, 2010, at 16:55, Greg Parker wrote: >> >>> >>> Is there some reason you can't call -respondsToSelector: on the class >>> object? >>> >> >> Well, isn't -respondsToSelector:

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Kyle Sluder
On Jun 30, 2010, at 2:35 PM, Laurent Daudelin wrote: > On Jun 30, 2010, at 16:55, Greg Parker wrote: > >> >> Is there some reason you can't call -respondsToSelector: on the class >> object? >> > > Well, isn't -respondsToSelector: an instance method? Remember that NSObject is a root class.

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Laurent Daudelin
On Jun 30, 2010, at 16:55, Greg Parker wrote: > On Jun 30, 2010, at 12:43 PM, Laurent Daudelin wrote: >> I need to check for backward compatibility whether a given class object >> responds to a selector. I found the function 'class_respondsToSelector()' >> which the doc says is defined in 'runti

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Greg Parker
On Jun 30, 2010, at 12:43 PM, Laurent Daudelin wrote: > I need to check for backward compatibility whether a given class object > responds to a selector. I found the function 'class_respondsToSelector()' > which the doc says is defined in 'runtime.h'. Is there some reason you can't call -respon

Re: class_respondsToSelector() in runtime.h?

2010-06-30 Thread Dave DeLong
#import Dave Sent from my iPhone On Jun 30, 2010, at 1:43 PM, Laurent Daudelin wrote: > I need to check for backward compatibility whether a given class object > responds to a selector. I found the function 'class_respondsToSelector()' > which the doc says is defined in 'runtime.h'. However

class_respondsToSelector() in runtime.h?

2010-06-30 Thread Laurent Daudelin
I need to check for backward compatibility whether a given class object responds to a selector. I found the function 'class_respondsToSelector()' which the doc says is defined in 'runtime.h'. However, I can't find that header anywhere. Does anybody know where that header might be? No, it's not

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 17:37, Michael Ash wrote: > While we're being pedantic, note that == is not always the same as > "binary equivalence". For example, 0.0 == -0.0, and x != x when x = > NAN. That's a good point. I spoke inaccurately. > Using == can make sense when you know that your values are

Re: NSOpenPanel won't allow selecting aliases

2010-06-30 Thread Sean McBride
On Tue, 29 Jun 2010 20:34:11 -0700, Seth Willits said: >Yes. I didn't quite realize that's what was happening. Hmm. So now I >have to figure out how allow aliases through in my delegate method. >Since they don't just pop up as folders, I have to find something that >identifies them as aliases to f

Re: Calling javascript from Cocoa 'facelessly'

2010-06-30 Thread Michael Ash
On Wed, Jun 30, 2010 at 1:01 PM, Geoffrey Holden <45rpmli...@googlemail.com> wrote: > I realize that this is a hell of a big query, and I'm not entirely sure that > I've given enough information for anyone to help answer it.  At the very > least, I guess I'm hoping for a reference to some really

Re: Tracking multiple NSURLConnections

2010-06-30 Thread aglee
(Coming late to this thread...) I recently used both approaches.  Subclassing NSURLConnection worked nicely and was quick to code when I had just one kind of delegate behavior.  When I had to add other kinds of delegate behavior I switched to the multiple-delegate-classes approach and used pla

Calling javascript from Cocoa 'facelessly'

2010-06-30 Thread Geoffrey Holden
My company has a webpage (internal, sadly, so I can't let you have a link to look at) which is entirely driven by Javascript, and which requires authentication to access (the authentication too is driven by Javascript, rather than by the more normal https sign in methods). The website is a) ugl

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Michael Ash
On Wed, Jun 30, 2010 at 11:11 AM, Alastair Houghton wrote: > On 30 Jun 2010, at 15:56, Frederick Bartram wrote: > >> Hope that I am not being too pedantic but imo you should never test for >> 'equality' ('==') when using machine real data types. > > Sometimes you really do want binary equivalence

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 15:56, Frederick Bartram wrote: > Hope that I am not being too pedantic but imo you should never test for > 'equality' ('==') when using machine real data types. Sometimes you really do want binary equivalence, and in that case == may be the right thing to use. Normally, tho

Re: Best way to compare CGFloats (Rick B.)

2010-06-30 Thread Frederick Bartram
I am stuck with floats (doubles, to be precise) comparison. Machine 'real-numbers' such as floats and doubles should be thought of as intervals or neighborhoods near the mathematical number. Tests for 'equality' of machine reals should never use machine equality '==' operators. 'Equality'

Re: Best way to compare CGFloats

2010-06-30 Thread Rimas M.
On Wed, Jun 30, 2010 at 1:06 PM, Alastair Houghton wrote: > I think they test for exact equality.  Whether that's documented or not I'm > not certain, but disassembling those functions appears to support that > conclusion. I see. Hope that will not cause any unexpected problems. For now I am goin

Re: NSImage drawing on 10.5 issue [SOLVED]

2010-06-30 Thread Graham Cox
On 30/06/2010, at 10:22 PM, Graham Cox wrote: >> Given that this problem is fixed in newer OSes, I would be tempted to just >> turn off the cache in 10.5. > > > Hi Ken, thanks for the suggestion. > > I've tried that, but the results are strange - I'm not sure I really > understand what's goi

Re: NSImage drawing on 10.5 issue

2010-06-30 Thread Graham Cox
On 30/06/2010, at 10:22 PM, Graham Cox wrote: > Do I need to manipulate the cache setting for the PDF image rep itself? The answer must be 'no', since there's no API to do so... --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: NSImage drawing on 10.5 issue

2010-06-30 Thread Graham Cox
On 30/06/2010, at 6:36 PM, Ken Ferry wrote: > On Mon, Jun 28, 2010 at 8:24 PM, Graham Cox wrote: > I have an NSImage which I generate by specifically creating a NSPDFImageRep > and adding that to an empty image. Later this same image rep is used to write > the image as a PDF file to disk. > >

Re: Best way to compare CGFloats

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 10:46, Rimas M. wrote: > In my case I am interested in x's and y's comparison. Not points as > themselves. But your suggestion gave me another question, which I have > never thought about before - how NSEqualPoints, ...Rects etc works? I > guess they *must* be safe to use, becau

Re: Best way to compare CGFloats

2010-06-30 Thread Rimas M.
Thanks everyone for answers. Now situation is more clear. On Wed, Jun 30, 2010 at 12:14 PM, Alastair Houghton wrote: > > fabs is the right way to do this in most cases, *but* with co-ordinate values > it may be that you are actually more interested in the distance of one point > from the other-

CALayer-hosting view and child NSView's

2010-06-30 Thread Oleg Krupnov
Hi, I'd like to create a custom view based on Core Animation, namely, a layer-hosting view. In other words, I'd like to directly manipulate layers in my code rather than using children NSView's. The custom view is like a matrix consisting of cells. Each cell is represented with a separate CALayer

Re: Best way to compare CGFloats

2010-06-30 Thread Alastair Houghton
On 30 Jun 2010, at 09:35, Rimas M. wrote: > So question is, what is the most efficient (performance side) and > simplest (coding side) way to compare those bastards? > > At the moment I am thinking about: > > a) BOOL _floatsOrDoublesAreEqual = ( (float)C.x == (float)D.x); > > b) BOOL _floatsOrD

Re: Best way to compare CGFloats

2010-06-30 Thread Jean-Daniel Dupas
Le 30 juin 2010 à 10:35, Rimas M. a écrit : > Hello, > > I am stuck with floats (doubles, to be precise) comparison. > In part of my app, I am dealing with NSPoint components (x, y) > comparison. On 32bit architecture NSPoint components are floats, and > direct comparison ( float1 == float2 ) wo

Re: Best way to compare CGFloats

2010-06-30 Thread Roland King
I usually use fabs() and compare to some small number for things like this, it explicitly says what your tolerance for 'same' is and if your points are going through a series of calculations, it's easy to get them to differ in the lower order bits however you cast them. On 30-Jun-2010, at 4:3

Re: NSImage drawing on 10.5 issue

2010-06-30 Thread Ken Ferry
On Mon, Jun 28, 2010 at 8:24 PM, Graham Cox wrote: > I have an NSImage which I generate by specifically creating a NSPDFImageRep > and adding that to an empty image. Later this same image rep is used to > write the image as a PDF file to disk. > > An interface displays these images, either loaded

Best way to compare CGFloats

2010-06-30 Thread Rimas M.
Hello, I am stuck with floats (doubles, to be precise) comparison. In part of my app, I am dealing with NSPoint components (x, y) comparison. On 32bit architecture NSPoint components are floats, and direct comparison ( float1 == float2 ) works fine. But on 64bit, they are doubles and '==' does not

Re: OpenAL and OGG

2010-06-30 Thread Eric Wing
On 6/29/10, Development wrote: > Can open al not read ogg files? I'm attempting to load a short ogg clip and > I keep getting random errors. > > getOpenALAudioData: ExtAudioFileOpenURL FAILED, Error = 1954115647 > 2010-06-29 15:13:53.965 MixPad[12402:207] error attaching audio to buffer: > a003 >