Re: Proper UTI for accepting files dropped on my table view?

2010-08-10 Thread Kyle Sluder
On Mon, Aug 9, 2010 at 11:53 PM, Rick Mann wrote: > From that I can only get an NSPasteboard, as far as I can tell. 10.6 has a new pasteboard API based around NSPasteboardItem and protocols like NSPasteboardReading that natively understands multiple objects and URLs. You might have better luck us

Re: Proper UTI for accepting files dropped on my table view?

2010-08-10 Thread Rick Mann
Thanks, Kyle. Wow, the sure made it wordy to use. On Aug 9, 2010, at 23:59:45, Kyle Sluder wrote: > On Mon, Aug 9, 2010 at 11:53 PM, Rick Mann wrote: >> From that I can only get an NSPasteboard, as far as I can tell. > > 10.6 has a new pasteboard API based around NSPasteboardItem and > protocol

Re: Proper UTI for accepting files dropped on my table view?

2010-08-10 Thread Kyle Sluder
On Tue, Aug 10, 2010 at 12:04 AM, Rick Mann wrote: > Thanks, Kyle. Wow, the sure made it wordy to use. It's not really that wordy: [somePasteboard readObjectsForClasses:[NSArray arrayWithObject:[NSURL class]] options:[NSDictionary dictionaryWithObject:[NSNumber numberWithBool:YES] forKey: NSPaste

Re: Custom zones...

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 05:18, charlie wrote: > As you can see, the c string is successfully allocated from space in the > custom zone. But the NSString object is allocated from the default zone, > despite having called +[NSObject allocWithZone:]. > > Anyone know the trick to this? Sounds like a b

Re: calling a function in one class from another

2010-08-10 Thread Geoffrey Holden
I'm writing an app which communicates with a server. The protocol that it uses is subject to change, so I'm writing a plugin to support that particular protocol. When, in the future, the protocol changes (as it probably will), I'll only need to change the plugin and not the entire app. That's my

Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Is there a preferred way to use the Math.h functions with CGFloats that is 32 and 64 bit safe? Do some Macros already exist somewhere? Should i even be using Math.h functions in Cocoa? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: calling a function in one class from another

2010-08-10 Thread Graham Cox
On 10/08/2010, at 7:06 PM, Geoffrey Holden wrote: > I'm writing an app which communicates with a server. The protocol that it > uses is subject to change, so I'm writing a plugin to support that > particular protocol. When, in the future, the protocol changes (as it > probably will), I'll only

Re: Math.h functions with CGFloat

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 13:42, steven Hooley wrote: > Is there a preferred way to use the Math.h functions with CGFloats > that is 32 and 64 bit safe? Why would they be unsafe? (They aren't.) It's possible that using the double versions (the ones without the "f" suffix) is inefficient in 32-bit mod

Re: Custom zones...

2010-08-10 Thread Bill Bumgarner
On Aug 10, 2010, at 1:31 AM, Alastair Houghton wrote: > Sounds like a bug to me. While zones are *discouraged* (they're very > definitely an advanced topic and easily misused), I don't think they're > actually deprecated. Their use is deprecated and should be documented as such. Zones wer

Fwd: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Sorry, 'safe' was a bad choice. I do care because i have compiler warnings. I have started defining macros for each function and thought i better check that they didn't already exist. Thankyou On 10 August 2010 14:54, Alastair Houghton wrote: > On 10 Aug 2010, at 13:42, steven Hooley wrote: > >>

Re: Custom zones...

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 14:55, Bill Bumgarner wrote: > On Aug 10, 2010, at 1:31 AM, Alastair Houghton wrote: > >> Sounds like a bug to me. While zones are *discouraged* (they're very >> definitely an advanced topic and easily misused), I don't think they're >> actually deprecated. > > Their use is

Re: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Yes, sorry - i meant /usr/include/math.h Because CGFloat is typedef'd to float on 32bit and double on 64bit i have to swap between, eg, atan and atanf depending on my build settings. I have a framework which is intended to support 32bit and 64bit. I thought this may have been a common scenario a

Re: Math.h functions with CGFloat

2010-08-10 Thread James Montgomerie
You should, I believe, be able to include ('type generic math' - a C99 addition) instead, and then just 'use' the non-suffixed versions of the functions. Hidden macro magic is supposed to then make the compiler call the double or float versions as appropriate for the type used. Having said th

Re: Math.h functions with CGFloat

2010-08-10 Thread Graham Cox
On 11/08/2010, at 12:12 AM, steven Hooley wrote: > Because CGFloat is typedef'd to float on 32bit and double on 64bit i > have to swap between, eg, atan and atanf depending on my build > settings. I have a framework which is intended to support 32bit and > 64bit. Just use atan(). 32-bit floats

Re: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
But then e.g. when building 32-bit i still have to cast the return value or i get the warning:- 'implicit conversion shortens 64-bit value into a 32-bit value' It seems that this warning is my fault because i have added the flag -Wshorten-64-to-32 which isn't enabled by default so maybe it should

Re: Math.h functions with CGFloat

2010-08-10 Thread Graham Cox
On 11/08/2010, at 1:08 AM, steven Hooley wrote: > But then e.g. when building 32-bit i still have to cast the return > value or i get the warning:- > > 'implicit conversion shortens 64-bit value into a 32-bit value' > > It seems that this warning is my fault because i have added the flag > -Wsh

Re: Math.h functions with CGFloat

2010-08-10 Thread Kyle Sluder
On Tue, Aug 10, 2010 at 8:28 AM, Graham Cox wrote: > If your code is working with CGFloat, then the warning isn't very helpful, > because by using CGFloat you've elected to use 32-bit precision. If you want > 'double', use 'double'. The warning could be useful on 64-bit compiles to > indicate t

Re: Math.h functions with CGFloat

2010-08-10 Thread Alastair Houghton
On 10 Aug 2010, at 16:28, Graham Cox wrote: > If your code is working with CGFloat, then the warning isn't very helpful, > because by using CGFloat you've elected to use 32-bit precision. Only on 32-bit. On the 64-bit runtime, CGFloat is a double, not a float, and therein lies the problem. If

Re: Math.h functions with CGFloat

2010-08-10 Thread Sean McBride
On Tue, 10 Aug 2010 16:50:17 +0100, Alastair Houghton said: > seems like a good solution. Indeed. I wish I knew about that before. :) A pity that Cocoa.h includes math.h and not tgmath.h. -- Sean McBride, B. Eng s...

Re: Math.h functions with CGFloat

2010-08-10 Thread Quincey Morris
Excuse me for jumping into this discussion with half a brain, but isn't there another consideration? I was under the impression that C does not have symmetric support for 'double' and 'float'. Specifically, I thought that any (a) expression involving floating point numbers promoted everything t

Re: Math.h functions with CGFloat

2010-08-10 Thread Greg Parker
On Aug 10, 2010, at 10:44 AM, Quincey Morris wrote: > Also, I remember we had a discussion on this list a few months ago concerning > a warning flag that might have been 'Wshorten-64-to-32' or might have been > something vaguely similar, where someone from Apple jumped in to say that > using the

Re: Custom zones...

2010-08-10 Thread charlie
In an effort to simplify the example, I may have made it more complicated. I'm actually trying to create an NSSecureTextField, but I tried to make the example more apple-vs-apples, by showing a c string and an NSString back to back. I tried with: NSSecureTextField NSTextField NSButton NSStr

[iPhone] UITableViewCell Height with UIWebView content

2010-08-10 Thread Sandro Noël
Greetings. I've been trying to set the table view cell's height for a custom tableviewCell containing a UIWebView to display attributed content but i cant's get the height properly. I am using a UITable View with sections, the first section shows a list of child objects and the second section d

Re: Custom zones...

2010-08-10 Thread Jayson Adams
On Aug 10, 2010, at 6:55 AM, Bill Bumgarner wrote: > > On Aug 10, 2010, at 1:31 AM, Alastair Houghton wrote: > >> Sounds like a bug to me. While zones are *discouraged* (they're very >> definitely an advanced topic and easily misused), I don't think they're >> actually deprecated. > > Their

printPanelDidEnd:returnCode:contextInfo: variable isn't updated

2010-08-10 Thread Kevin Walzer
I'm implementing basic printing functionality as a library extension to a GUI toolkit I use (Tk).. The code uses a custom Cocoa class as the delegate for the printPanelDidEnd:returnCode:contextInfo selector (when the print dialog is presented as a sheet). The design of the code is to get the v

Re: [iPhone] UITableViewCell Height with UIWebView content

2010-08-10 Thread glenn andreas
On Aug 10, 2010, at 2:04 PM, Sandro Noël wrote: > Greetings. > > I've been trying to set the table view cell's height for a custom > tableviewCell containing a UIWebView > to display attributed content but i cant's get the height properly. > [snip] > since it is so tedious, Now i'm thinking th

Re: printPanelDidEnd:returnCode:contextInfo: variable isn't updated

2010-08-10 Thread Quincey Morris
On Aug 10, 2010, at 07:55, Kevin Walzer wrote: > - (void)printPanelDidEnd:(NSPrintPanel *)printPanel > returnCode:(int)returnCode contextInfo:(void *)contextInfo { > > printResult = [...] > > } > > @end > > And here's the logic in another function of my code: > >[printPanel beginSheetWi

Handling NSManagedObjectContextDidSaveNotification from different threads

2010-08-10 Thread Rick Mann
We have an app that uses a "main" NSManagedObjectContext (MOC) for all UI-related work, and has background threads that add and update data via their own dedicated MOCs. When they call -save: on their MOC, the "main" MOC gets the NSManagedObjectContextDidSaveNotification and calls -mergeChanges

Re: Math.h functions with CGFloat

2010-08-10 Thread Michael Ash
On Tue, Aug 10, 2010 at 1:44 PM, Quincey Morris wrote: > Excuse me for jumping into this discussion with half a brain, but isn't there > another consideration? > > I was under the impression that C does not have symmetric support for > 'double' and 'float'. Specifically, I thought that any (a) e

Re: Math.h functions with CGFloat

2010-08-10 Thread Rick Mann
On Aug 10, 2010, at 08:35:43, Kyle Sluder wrote: > The correct thing to do is leave the warning enabled and #include . Is available on iOS? (I have code shared among platforms.) -- Rick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: Math.h functions with CGFloat

2010-08-10 Thread Greg Parker
On Aug 10, 2010, at 2:06 PM, Rick Mann wrote: > On Aug 10, 2010, at 08:35:43, Kyle Sluder wrote: >> The correct thing to do is leave the warning enabled and #include . > > Is available on iOS? (I have code shared among platforms.) Yes; it's part of C99. -- Greg Parker gpar...@apple.com

Re: Math.h functions with CGFloat

2010-08-10 Thread Nick Zitzmann
On Aug 10, 2010, at 3:06 PM, Rick Mann wrote: > Is available on iOS? (I have code shared among platforms.) Yes: % find /Developer/Platforms/iPhoneOS.platform -name 'tgmath.h' [...] /Developer/Platforms/iPhoneOS.platform/Developer/usr/lib/clang/1.5/include/tgmath.h /Developer/Platforms/iPhoneOS

Re: Math.h functions with CGFloat

2010-08-10 Thread Rick Mann
Thanks. When I did the in-Xcode file search, it didn't turn up, so I was curious. On Aug 10, 2010, at 14:15:03, Nick Zitzmann wrote: > > On Aug 10, 2010, at 3:06 PM, Rick Mann wrote: > >> Is available on iOS? (I have code shared among platforms.) > > Yes: > > % find /Developer/Platforms/iPh

Clicks while using NSOpenGLContext's setFullScreen?

2010-08-10 Thread Andy O'Meara
Hey guys, quick question for the cocoa gurus here... I'm using NSOpenGLContext's setFullScreen method to run my NSOpenGLContext in fullscreen. However, in that mode, it's not clear how one should get mouse events (or at least clicks). I saw one post a few years ago imply that he used a repe

Re: Math.h functions with CGFloat

2010-08-10 Thread Quincey Morris
On Aug 10, 2010, at 14:00, Michael Ash wrote: > All operators with floating-point arguments must be performed with > double precision. However, the C spec operates according to the > "as-if" rule. The compiler is free to generate ANY code it wishes so > long as the result is the same "as if" it we

CGImage to NSImage, or PDFPage?

2010-08-10 Thread Brian Postow
I'm not sure if this is rightly a Cocoa question or Quartz, so I'm posting on both lists. Sorry for the double... I have a CGImageRef, and I need to put it into a PDFPage. At the moment, the only way I see to do that is to turn it into an NSImage first. I've currently got: NSImage* cgImageToN

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread Quincey Morris
On Aug 10, 2010, at 14:45, Brian Postow wrote: > NSImage* img = [NSImage alloc]; > [img initWithData: imgData]; Well, you definitely don't want to do this. There's no guarantee that the initialized object returned by 'initWithData:' is img, so you could easily be returning an uninit

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread Nick Zitzmann
On Aug 10, 2010, at 3:45 PM, Brian Postow wrote: > Is there something obvious that I'm missing? Yes. If you can require Leopard or later, then just create an NSBitmapImageRep using -initWithCGImage:, then create the NSImage with the size of the CGImage and add that NSBitmapImageRep to the NSIm

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread Brian Postow
On Aug 10, 2010, at 5:57 PM, Quincey Morris wrote: > On Aug 10, 2010, at 14:45, Brian Postow wrote: > >> NSImage* img = [NSImage alloc]; >> [img initWithData: imgData]; > > Well, you definitely don't want to do this. There's no guarantee that the > initialized object returned by 'ini

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread glenn andreas
On Aug 10, 2010, at 4:45 PM, Brian Postow wrote: > > I'm not sure if this is rightly a Cocoa question or Quartz, so I'm posting on > both lists. Sorry for the double... > > I have a CGImageRef, and I need to put it into a PDFPage. At the moment, the > only way I see to do that is to turn it i

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread John Calhoun
On Aug 10, 2010, at 2:45 PM, Brian Postow wrote: > I have a CGImageRef, and I need to put it into a PDFPage. At the moment, the > only way I see to do that is to turn it into an NSImage first. That will work, but it is also possible to subclass PDFPage and override the -[drawWithBox:] method in

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread Brian Postow
On Aug 10, 2010, at 6:03 PM, glenn andreas wrote: > > On Aug 10, 2010, at 4:45 PM, Brian Postow wrote: > >> >> I'm not sure if this is rightly a Cocoa question or Quartz, so I'm posting >> on both lists. Sorry for the double... >> >> I have a CGImageRef, and I need to put it into a PDFPage.

Re: CGImage to NSImage, or PDFPage?

2010-08-10 Thread Brian Postow
On Aug 10, 2010, at 6:02 PM, Nick Zitzmann wrote: > > On Aug 10, 2010, at 3:45 PM, Brian Postow wrote: > >> Is there something obvious that I'm missing? > > Yes. If you can require Leopard or later, then just create an > NSBitmapImageRep using -initWithCGImage:, then create the NSImage with t

NSTextView in NSCollectionView doesn't draw

2010-08-10 Thread Rainer Standke
Hello, In a core data document based app I have a NSTextView inside an NSCollectionView. The text view's value is bound to a core data attribute. When a document is opened the text does not draw in the text view. When the user clicks the view it will draw the text correctly. The text always dr

Looking for a FTP framework

2010-08-10 Thread David Alter
I'm adding FTP support to a Mac application. It actually needs to support SFTP. I need to support upload and downloading. If a connection is dropped I need to be able to re-establish a connection and finish the operation. It looks like there are some choices out there and I wanted to see what peo

Re: [iPhone] UITableViewCell Height with UIWebView content

2010-08-10 Thread Sandro Noël
Glenn thank you, I will revisit the design. as for using Core Text, I read the doc, but unfortunately for me I'm still novice at drawing stuff. I need to read more about it as it is the only way to get exactly what I want from the platform. so it is in the top of the todo list. best regards. S

Exception in -[NSManagedObjectContext save:]

2010-08-10 Thread Rick Mann
We're very frequently seeing an exception down inside -[NSManagedObjectContext save:]. The exception itself is caught somewhere inside -save: and no errors are returned, but the debugger always stops there. Nothing is written to the console. Is there something wrong? There is no way I know of t

Re: Exception in -[NSManagedObjectContext save:]

2010-08-10 Thread Nick Zitzmann
On Aug 10, 2010, at 5:58 PM, Rick Mann wrote: > We're very frequently seeing an exception down inside > -[NSManagedObjectContext save:]. The exception itself is caught somewhere > inside -save: and no errors are returned, but the debugger always stops > there. Nothing is written to the console

Re: [ SOLVED ] Core Data bindings: add entity to relationship

2010-08-10 Thread James Maxwell
Yikes... I finally figured out what I'd done. In fact, my model and bindings were correct. The problem was in trying to access the object hierarchy elsewhere in my code. I had it in mind that I wanted something like Instrument.articulation.name, when in fact my data structure demanded that it b

Is it possible to set UISlider intervals?

2010-08-10 Thread Devraj Mukherjee
Hi all, I am using UISliders in my iOS app. I can't see a way of setting the slide value interval. Is this possible? Or do I have to calculate the change based on the 0.1 increases? Minimum value set to -20 and Max to 20 and I want the slider to increment by 0.5 on a slide. Thanks.

Re: Is it possible to set UISlider intervals?

2010-08-10 Thread Jonathon Kuo
On Aug 10, 2010, at 5:43 PM, Devraj Mukherjee wrote: > Hi all, > > I am using UISliders in my iOS app. > > I can't see a way of setting the slide value interval. Is this > possible? Or do I have to calculate the change based on the 0.1 > increases? > > Minimum value set to -20 and Max to 20 an

Re: Looking for a FTP framework

2010-08-10 Thread Charles Srstka
On Aug 10, 2010, at 6:15 PM, David Alter wrote: > I'm adding FTP support to a Mac application. It actually needs to support > SFTP. I need to support upload and downloading. If a connection is dropped I > need to be able to re-establish a connection and finish the operation. > > It looks like th

-[NSBrowser setReusesColumns:] broken?

2010-08-10 Thread James Bucanek
Greetings, I'm trying to implement an NSBrowser view using the legacy (10.5) compatible delegate methods (i.e. not the 10.6 "item data source" methods). I'd very much like to use the reusesColumns property to recycle my, rather complex, NSMatrix subclasses. However this property appears to

Re: printPanelDidEnd:returnCode:contextInfo: variable isn't updated

2010-08-10 Thread Kevin Walzer
On 8/10/10 4:28 PM, Quincey Morris wrote: Based on the NSLog statements, I can tell that printResult is being correctly updated, but for some reason that value never makes it to the other function. I understand the selector method doesn't return a value; that's why I'm assigning the value to

Re: How to search for specific bindings in IB

2010-08-10 Thread Jerry Krinock
On 2010 Aug 09, at 17:14, Chris Tracewell wrote: > In larger NIB files this can be hard to find and remove. Is there anyway to > search IB for bindings other than selecting individual elements and looking > at the bindings inspector? Not in Interface Builder 3.3.2. The only workaround, when yo

Updating timestamp on save => merge error

2010-08-10 Thread Gideon King
I have a managed object I want to update with a "last saved timestamp" on save. I have the update done on the NSPersistentDocument -saveToURL:ofType:forSaveOperation:error: method. This works fine, except on save as. I know that the save as creates a new document and updates from the managed o

Lake Forest Cocoaheads meeting 8/11, no set topic - come drive the discussion!

2010-08-10 Thread Scott Ellsworth
CocoaHeads Lake Forest will be meeting on the second Wednesday of the month. We will be meeting at the Orange County Public Library (El Toro) community room, 24672 Raymond Way, Lake Forest, CA 92630 Please join us from 7pm to 9pm on Wednesday, 8/11. Due to an unexpected commitment on my part, we