Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Stephen J. Butler
On Mon, Feb 9, 2009 at 1:20 AM, Ken Ferry wrote: > On Sun, Feb 8, 2009 at 9:39 PM, Michael Ash wrote: >> This really needs a qualifier: NSImage *can* create hidden windows to >> manage resources. To be more specific, NSImage can create an >> NSCachedImageRep, which in turn creates NSWindows. The

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Ken Ferry
On Sun, Feb 8, 2009 at 9:39 PM, Michael Ash wrote: > On 2/8/09, Stephen J. Butler wrote: > > One thing to watch out for -- and it's generated some traffic on this > > list recently -- is that NSImage creates hidden windows to manage > > resources. So if you're loading many, many, many images,

Re: CGFloat and 64 Bit

2009-02-08 Thread Clark Cox
On Sun, Feb 8, 2009 at 3:52 AM, Gerriet M. Denkmann wrote: > When I build a Cocoa Project with 32/64 bit, this line gets a warning: >NSSize a = NSMakeSize( 11.2, 22.4); > which went away using: >NSSize a = NSMakeSize( (CGFloat)11.2, (CGFloat)22.4); > Is this the only and correct wa

Re: CGFloat and 64 Bit

2009-02-08 Thread Nick Zitzmann
On Feb 8, 2009, at 4:52 AM, Gerriet M. Denkmann wrote: When I build a Cocoa Project with 32/64 bit, this line gets a warning: NSSize a = NSMakeSize( 11.2, 22.4); which went away using: NSSize a = NSMakeSize( (CGFloat)11.2, (CGFloat)22.4); Is this the only and correct way to use

Creating audio files in iphone

2009-02-08 Thread Mahaboob
I'm using a table view to show all the audio files. When I'm selecting one file among these and click on the record button, the newly recording sound should be attached to the end of the selected file. I'm referring the SpeakeHere example of apple. But in the documentation, I found a method that i

Constrained layer-backed control stops responding

2009-02-08 Thread Alejandro Rodriguez
Hello, I have a NSView that is layer-backed (setWantsLayer:YES) and when I add it to another subview it works fine. But if I use a CAConstraint to chage it's location then controls inside the view stop responding to events. Any clues anyone? Thanks and regards, Alejandro

Re: Mixing C++ and Objective-C

2009-02-08 Thread Michael Ash
On Sun, Feb 8, 2009 at 8:42 PM, Peter N Lewis wrote: > At 12:29 -0800 7/2/09, Steve Wart wrote: > >> It works fine in 10.5.6 with XCode 3.1 if I change the file type of >> BasicOpenGLView.m to sourcecode.cpp.objcpp. > > You normally use the extension .mm for Objective C++ code. > > At 10:41 +0900

Re: How do I unit test an object delegate?

2009-02-08 Thread Michael Ash
On Sun, Feb 8, 2009 at 10:50 PM, Sean DeNigris wrote: > I'm unit testing a cocoa app in xcode by injecting a test bundle into the > executable, so the unit tests get run at the end of every build. > > Example: > > @interface AppController : NSObject { >... >IBOutlet NSButton* start

Re: CGFloat and 64 Bit

2009-02-08 Thread Rob Keniger
On 09/02/2009, at 3:37 PM, Rob Keniger wrote: Try this: NSSize a = NSMakeSize( 11.2f, 22.4f); The "f" suffix is a hint to the compiler that it's a float value. To clarify further, the compiler treats number literals with a decimal point as a double, so you need to use the f suffix to hav

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Michael Ash
On 2/8/09, Stephen J. Butler wrote: > One thing to watch out for -- and it's generated some traffic on this > list recently -- is that NSImage creates hidden windows to manage > resources. So if you're loading many, many, many images, NSImage can > lockup the Window Server. This really needs

Re: CGFloat and 64 Bit

2009-02-08 Thread Rob Keniger
On 08/02/2009, at 9:52 PM, Gerriet M. Denkmann wrote: When I build a Cocoa Project with 32/64 bit, this line gets a warning: NSSize a = NSMakeSize( 11.2, 22.4); which went away using: NSSize a = NSMakeSize( (CGFloat)11.2, (CGFloat)22.4); Is this the only and correct way to use N

CGFloat and 64 Bit

2009-02-08 Thread Gerriet M. Denkmann
When I build a Cocoa Project with 32/64 bit, this line gets a warning: NSSize a = NSMakeSize( 11.2, 22.4); which went away using: NSSize a = NSMakeSize( (CGFloat)11.2, (CGFloat)22.4); Is this the only and correct way to use NSMakeSize() ? Looks kind of ugly. A somehow related q

Re: Mixing C++ and Objective-C

2009-02-08 Thread Steve Wart
Thanks Peter. I realized after posting my question that it wasn't actually Cocoa-related, nor even Objective-C related - the error was a result of my inexperience with C++. Apologies to everyone for posting off-topic. I appreciate that this is a high-volume list and didn't intend to distract from

Re: Core Data: Delete stops at first object in Cascade

2009-02-08 Thread Jerry Krinock
I got a suggestion off-list that maybe cascade-deleting would be inhibited if the relation was "optional". In my real project, all my relationships are optional. The "Delete Rule" documentation makes no mention of "optional" settings affecting what happens, but I thought I'd test this sug

Re: Drag and drop images to other application using NSFilesPromisePboardType

2009-02-08 Thread Dikshith Rai
The reason I used only NSFilesPromisePboardType and not NSFilenamesPboardType is:My app data is stored as a package. Instead of extracting image from the package while I initiate dragging, I do it when the destination asks for the data that is promised to it. I personally feel NSFilesPromi

How do I unit test an object delegate?

2009-02-08 Thread Sean DeNigris
I'm unit testing a cocoa app in xcode by injecting a test bundle into the executable, so the unit tests get run at the end of every build. Example: @interface AppController : NSObject { ... IBOutlet NSButton* startButton; NSSpeechSynthesizer* speechSynthesizer; } @impl

Re: Mixing C++ and Objective-C

2009-02-08 Thread Peter N Lewis
At 12:29 -0800 7/2/09, Steve Wart wrote: It works fine in 10.5.6 with XCode 3.1 if I change the file type of BasicOpenGLView.m to sourcecode.cpp.objcpp. You normally use the extension .mm for Objective C++ code. At 10:41 +0900 9/2/09, Peter N Lewis wrote: At 13:12 -0800 7/2/09, Steve Wart wr

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread David Blanton
Yeah, I think I will switch to ... pathForResource:ofType: I did read the bit about Window Server and NSImage ... On Feb 8, 2009, at 5:11 PM, Stephen J. Butler wrote: On Sun, Feb 8, 2009 at 5:40 PM, David Blanton wrote: Kyle and Stephen ... great comments - so there are three w

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Stephen J. Butler
On Sun, Feb 8, 2009 at 5:40 PM, David Blanton wrote: > Kyle and Stephen ... great comments > >- so there are three ways to get the image file > > what criteria should I use in deciding which to use ? I think it's mostly preference. My impression is that most experienced Cocoa developers

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread David Blanton
Kyle and Stephen ... great comments - so there are three ways to get the image file what criteria should I use in deciding which to use ? On Feb 8, 2009, at 4:21 PM, Kyle Sluder wrote: On Sun, Feb 8, 2009 at 4:48 PM, Stephen J. Butler wrote: Just a comment... you should probably be

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Kyle Sluder
On Sun, Feb 8, 2009 at 4:48 PM, Stephen J. Butler wrote: > Just a comment... you should probably be using pathToResource:ofType: here. Or use +[NSImage imageNamed:] and use -[NSBitmapImageRep CGImage] on its first representation... _level1.contents = (id)NSImage imageNamed:@"Level 1 top"] re

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Stephen J. Butler
On Sun, Feb 8, 2009 at 2:54 PM, David Blanton wrote: >NSString* imageFileName = [[[NSBundle mainBundle] resourcePath] > stringByAppendingPathComponent:@"Level 1 top.png"]; Just a comment... you should probably be using pathToResource:ofType: here. NSString* imageFileName = [[NSBundle m

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread David Blanton
Yep. I realized after posting that .contents takes id. _level1.contents = (id)CGImageCreateWithPNGDataProvider(provider, NULL, true, kCGRenderingIntentDefault); clears the warning ... maybe I should not code and drink beer on Sunday unless it is Windows code. On Feb 8, 2009, at 2:30 P

Re: passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread Keary Suska
On Feb 8, 2009, at 1:54 PM, David Blanton wrote: NSString* imageFileName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Level 1 top.png"]; CGDataProviderRef provider = CGDataProviderCreateWithFilename([imageFileName UTF8String]); _level1 = [[CA

passing argument 1 of 'setContents:' from incompatible pointer type

2009-02-08 Thread David Blanton
NSString* imageFileName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"Level 1 top.png"]; CGDataProviderRef provider = CGDataProviderCreateWithFilename([imageFileName UTF8String]); _level1 = [[CALayer layer] retain]; _level1.contents = CGImageCre

Re: Animated toolbar

2009-02-08 Thread Christian Graus
>> Fair enough. >> I guess that brings this discussion to a close, so thanks to >> everyone who >> responded. It's been very valuable to me, even if it didn't go in the >> direction I was hoping. It's certainly convinced me that our >> toolbar needs >> to go, although what we replace it with, I h

Fwd: Borderless and resize - Solved

2009-02-08 Thread Geert B . Clemmensen
Hello all, There is nice article on borderless windows here: http://www.cocoadev.com/index.pl?BorderlessWindow The thing I had overseen/ignored is at the bottom: Ok, in my sleep deprivation i didn't realize that my window was set to be moveable by the background, so it was tryin

Borderless and resize

2009-02-08 Thread Geert B. Clemmensen
Hello all, I have a borderless subclassed NSWindow with own subclassed NSView as contentView. Overriding the content view's mouseDown: and do [win setFrame:newFrame display:YES]; in order to resize the window works, well kinda, the displaying appear jagged. If the exact same ever

Re: NSProgressIndicator (spinning) on a dark background?

2009-02-08 Thread Michael Hanna
I was trying to solve this problem before too. I thought you could get the CIImage of the individual frames of the progress indicator and apply an Invert filter on it. I'm not even sure if it'd work though ... I never implemented it and It's probably simpler to just use the AMIndeterminateProgressI

Re: Read lines from very large text file

2009-02-08 Thread Michael Ash
On Sun, Feb 8, 2009 at 2:44 AM, Joar Wingfors wrote: > > On Feb 7, 2009, at 7:13 PM, Michael Ash wrote: > >>> What's wrong is that they won't allow you to specify the text encoding to >>> use. The same thing is true for the *deprecated* method >>> "+stringWithCString:" by the way. >> >> That is in

[Q] NSTextField and binding: What gets called?

2009-02-08 Thread admin
I' override an NSTextField to handle re-size if text size changes. Problem is it only reacts on text input by the user [self textDidChange:] but not if changed through binding because [self textDidChange:] is never called. Which of the methods do I need to override in order to get notice of

Re: -[NSTreeController moveNode:toIndexPath:] broken?

2009-02-08 Thread Rob Keniger
2009/2/8 Tomas Franzén > Hi, > > I recently began exploring NSTreeController, but I'm experiencing problems > with its moveNode:toIndexPath:. It's new to Leopard, but seems to be > consistently moving nodes to incorrect indexes. There's a previous list post > about exactly this, but without repli

Re: How to draw text with fade out effect?

2009-02-08 Thread Oleg Krupnov
Wow, Ken! It works like magic (the second method I mean). Thank you very much. I think I would never guess it myself. For those who will reuse this code, don't forget to save/restore the graphics context because CGContextClipToMask modified the clipping region. Sorry for late thanking, I had to p

Re: -[NSTreeController moveNode:toIndexPath:] broken?

2009-02-08 Thread Jonathan Fewtrell
I recently began exploring NSTreeController, but I'm experiencing problems with its moveNode:toIndexPath:. It's new to Leopard, but seems to be consistently moving nodes to incorrect indexes. There's a previous list post about exactly this, but without replies. http://lists.apple.com/archives/coc

Re: IB v7.03 appears to corrupt an xib last generated by IB v7.02

2009-02-08 Thread Stephen Bannasch
At 10:38 PM -0500 2/7/09, Kyle Sluder wrote: Interface Builder is currently on version 3.1.2 (build 677). I have no idea what version number you're talking about here. I misinterpreted the what the version # in this line in the xib file: - + versions 7.02 and 7.03 are the versions of