Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Graham Cox
On 25/02/2011, at 3:49 PM, Trygve Inda wrote: > Do you think an app that loads a code bundle from within it's own Resource > folder would be rejected? You would probably be better off asking this on the developer forum for the App Store. My thought are it would be OK, but I'm not certain. It's

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
> > On 25/02/2011, at 11:17 AM, Trygve Inda wrote: > >> So what file would I define this protocol in... > > Another header? > >> The two .h files for the >> unique classes? > > No - just #import the protocol into these headers. > >> It'd be nice if IB let me define a class two different ways

proper use of QuartzCore

2011-02-24 Thread Federico Tessmann
Hi there. I have to rotate an image continuously and I'm using now CALayers as the image containers and I'm rotating thous CALayers by setting its Transform property. Now I have two approaches to keep rotating these layers. 1) Use a displayLink of 30 fps. Use CATransaction, setting setDisableActi

CALayer setting content on separate thread

2011-02-24 Thread Federico Tessmann
Hi, Is it possible to set the content of a CALayer on a separate thread and afterwards (using the proper locking) add this layer to another layer as a sublayer on the main thread? Thanks in advance for any help! Best regards, Federico ___ Cocoa-dev mai

Re: Inconsistent Data in Webkit

2011-02-24 Thread Bruce Cresanta
John, This is what I have: - (void)webView:(WebView *)sender didFinishLoadForFrame:(WebFrame *)frame { // Only report feedback for the main frame. if (frame == [sender mainFrame]){ while([sender isLoading]) {}; //delay until fully loaded

Re: Inconsistent Data in Webkit

2011-02-24 Thread John Joyce
On Feb 25, 2011, at 12:24 PM, Bruce Cresanta wrote: > Hello, > > I've noticed that certain webpages render fine in WebView, but that the > data in the dataSource remains nil.Is this a bug in webkit? Is there a > way to get consistent data? For example, http://www.php.net renders

Re: On NSClassFromString method

2011-02-24 Thread Leon Qiao
Hi Dan, Thanks a lot for your reply. I added the -Objc linker flag. And now it works well. Thanks and best regards Leon 2011/2/25 Dan Treiman > You can fix this by adding the -ObjC linker flag. See related issue: > http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html > This will forc

Re: On NSClassFromString method

2011-02-24 Thread Dave DeLong
On Feb 24, 2011, at 7:24 PM, Graham Cox wrote: > Are you absolutely, definitely without a doubt certain that you spelled the > class name correctly? With the proper capitalization? Dave ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please

Re: On NSClassFromString method

2011-02-24 Thread Dan Treiman
You can fix this by adding the -ObjC linker flag. See related issue: http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html This will force the linker to load classes from the static library Another way is to reference the class directly somewhere in the code such that it has no effect,

Re: On NSClassFromString method

2011-02-24 Thread Kyle Sluder
On Thu, Feb 24, 2011 at 7:19 PM, Leon Qiao wrote: > I got a problem when using the NSClassFromString method to get a class. > The code is used in the google docs library. It failed to get the Class > object, the return value is 0x0. > But I already linked the library, and it works fine when using

Inconsistent Data in Webkit

2011-02-24 Thread Bruce Cresanta
Hello, I've noticed that certain webpages render fine in WebView, but that the data in the dataSource remains nil.Is this a bug in webkit? Is there a way to get consistent data? For example, http://www.php.net renders fine in the browser, but the control's data is never set. Th

Re: On NSClassFromString method

2011-02-24 Thread Graham Cox
On 25/02/2011, at 2:19 PM, Leon Qiao wrote: > Dear all, > > I got a problem when using the NSClassFromString method to get a class. > The code is used in the google docs library. It failed to get the Class > object, the return value is 0x0. > But I already linked the library, and it works fine w

On NSClassFromString method

2011-02-24 Thread Leon Qiao
Dear all, I got a problem when using the NSClassFromString method to get a class. The code is used in the google docs library. It failed to get the Class object, the return value is 0x0. But I already linked the library, and it works fine when using the class itself directly. Anyone who met the sa

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Graham Cox
On 25/02/2011, at 11:17 AM, Trygve Inda wrote: > So what file would I define this protocol in... Another header? > The two .h files for the > unique classes? No - just #import the protocol into these headers. > It'd be nice if IB let me define a class two different ways and linked only > to t

Re: registerUndoWithTarget:selector:object: in or outside of group?

2011-02-24 Thread Graham Cox
On 25/02/2011, at 9:05 AM, Jim Thomason wrote: > This is a braindead simple question, but I couldn't find a definitive > reference. > > Is it better to register an undo action inside or outside of a group? > > i.e., is this preferred: > [] > Or is this: > > [someUndoManager beginUndoGrouping

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
> > On 25/02/2011, at 10:26 AM, Trygve Inda wrote: > >> It seems to be pretty random when using two header files, but a common >> implementation. There should be a way to drag a header to IB and have it >> reinterpret the class, but it just complains that the superclass is wrong. >> >> I guess t

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Graham Cox
On 25/02/2011, at 10:26 AM, Trygve Inda wrote: > It seems to be pretty random when using two header files, but a common > implementation. There should be a way to drag a header to IB and have it > reinterpret the class, but it just complains that the superclass is wrong. > > I guess the issue he

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread Greg Parker
On Feb 24, 2011, at 3:53 AM, Andreas Grosam wrote: > Unfortunately, this doesn't compile yet. This would require that LLVM can be > used for Objective-C++ modules and that the compiler flag > -fobjc-nonfragile-abi2 can be passed to the compiler driver. Try the Xcode 4 GM seed: the LLVM Compiler

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
> > On 25/02/2011, at 7:16 AM, Trygve Inda wrote: > >> I am guessing IB is reading the MyClass.m which has both .h files imported >> with #ifdef > > > I don't think this is true - I have sometimes defined the header for a class > and then set up the interface in IB using that header before I've

Re: dynamic binding in initializers

2011-02-24 Thread Roland King
On 25-Feb-2011, at 12:06 AM, Ken Thomases wrote: > On Feb 24, 2011, at 9:21 AM, Roland King wrote: > >> Were there one designated initializer for a UIView, I'd put my >> initialization code in there, knowing that everything would end up going >> through it. However UIView's (and possibly other

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Graham Cox
On 25/02/2011, at 7:16 AM, Trygve Inda wrote: > I am guessing IB is reading the MyClass.m which has both .h files imported > with #ifdef I don't think this is true - I have sometimes defined the header for a class and then set up the interface in IB using that header before I've even written

registerUndoWithTarget:selector:object: in or outside of group?

2011-02-24 Thread Jim Thomason
This is a braindead simple question, but I couldn't find a definitive reference. Is it better to register an undo action inside or outside of a group? i.e., is this preferred: [someUndoManager beginUndoGrouping]; //do interesting things //end group first [someUndoManager endUndoGrouping]; //the

Re: black flashes when updating CALayer content

2011-02-24 Thread Gideon King
I have seen this too. Exactly the same scenario. I have it on my urgent to-do list to look at, but have not got to it yet. It was first reported to me by a user and we could never reproduce it here, but another user has sent us a file which exhibits the problem on all the machines I have tried.

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
>> >> On 24/02/2011, at 5:56 PM, Trygve Inda wrote: >> >>> The problem is two-fold: >>> >>> 1) How can I have nibs, one with MyObjectClass:NSObject and the other with >>> MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same >>> but with a few #ifdef to have conditional com

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Trygve Inda
> > On 24/02/2011, at 5:56 PM, Trygve Inda wrote: > >> The problem is two-fold: >> >> 1) How can I have nibs, one with MyObjectClass:NSObject and the other with >> MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same >> but with a few #ifdef to have conditional compilation

Re: dynamic binding in initializers

2011-02-24 Thread Kyle Sluder
On Feb 24, 2011, at 8:06 AM, Ken Thomases wrote: > Any class or yours which directly inherits from UIView should cover > initWithFrame: and initWithCoder: and invoke its designated initializer. Any > of its subclasses, though, should only invoke [super > yourDesignatedInitializer:...], not [s

black flashes when updating CALayer content

2011-02-24 Thread Markus Spoettl
Hello, I have a custom layer-hosting NSView with a nested layer hierarchy. The view updates one if its layers in response to mouse-dragging to highlight a selection of things it displays. Sometimes - randomly and very infrequently - I get a very flash of complete blackness or whiteness in th

Re: dynamic binding in initializers

2011-02-24 Thread Ken Thomases
On Feb 24, 2011, at 9:21 AM, Roland King wrote: > Were there one designated initializer for a UIView, I'd put my initialization > code in there, knowing that everything would end up going through it. However > UIView's (and possibly other classes) don't have a designated initializer, > they can

Re: Fast way to grab the screen

2011-02-24 Thread Ken Thomases
On Feb 23, 2011, at 5:39 PM, Kyle Sluder wrote: > On Wed, Feb 23, 2011 at 3:21 PM, Ken Thomases wrote: >> On Feb 23, 2011, at 4:40 PM, Kyle Sluder wrote: >> >>> On Wed, Feb 23, 2011 at 2:17 PM, eveningnick eveningnick >>> wrote: i am trying to write a video grabber, CGWindow API seems pret

Re: Fast way to grab the screen

2011-02-24 Thread Gordon Apple
What I would like is the ability to capture video from the contents of a window, regardless of whether it is on top, or even on the screen. If it contained video, it would also be nice to synchronize capture with the contained video content. (In a perfect world.) I don't know how you would handl

NSNumberFormatter issue with method -setLocale

2011-02-24 Thread Ulf Dunkel
Mac OS 10.6.6 and Xcode 3.2.5: I am playing with NSNumberFormatter stuff for various custom number edit fields, which will e.g. be used to auto-format dpi values, degree values, document measurement values with various format strings, etc. I currently receive an EXC_BAD_ACCESS, with the follo

Re: Using asynchronous APIs with NSOperation

2011-02-24 Thread James Montgomerie
Dave Dribin has written excellent blog posts about this - start here: http://www.dribin.org/dave/blog/archives/2009/05/05/concurrent_operations/ Jamie On 24 Feb 2011, at 15:08, Matt DeFoor wrote: > I have been doing research in preparing to switch from manual > threading to the usage of NSOpera

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread James Bucanek
Thanks to every everyone who contributed to this discussion. In summary... (1) I agree with Greg that simply omitting the ivar declarations when compiling in C (i.e. #ifdef __cplusplus/CPPClass* someCppObj;/#endif) is hazardous. I was thinking that this might be the most pragmatic solution fo

Re: dynamic binding in initializers

2011-02-24 Thread Roland King
On 24-Feb-2011, at 11:02 PM, Dave Zarzycki wrote: > Roland, > > Check this out: > > http://cocoawithlove.com/2008/03/cocoa-application-startup.html > > The code should arguably live in a +initialize method. > > davez it can't - it's per-instance initialization. Were there one designa

Using asynchronous APIs with NSOperation

2011-02-24 Thread Matt DeFoor
I have been doing research in preparing to switch from manual threading to the usage of NSOperation. Because my operations will be executing asynchronous APIs from the CoreServices framework, it appears that I'd be better off using concurrent operations. What is not clear to me is, if I provide a c

Re: dynamic binding in initializers

2011-02-24 Thread Dave Zarzycki
Roland, Check this out: http://cocoawithlove.com/2008/03/cocoa-application-startup.html The code should arguably live in a +initialize method. davez On Feb 24, 2011, at 6:41 AM, Roland King wrote: > I burned myself today with a pattern I've been using for ages. I have lots of > UIV

Re: "Highlight" a window of another application

2011-02-24 Thread Kyle Sluder
On Feb 24, 2011, at 3:17 AM, eveningnick eveningnick wrote: >> I need to somehow "impact" a particular window for the user, make it bold, >> change it's shadow color or add some kind of a frame around it - to remind >> the user that only this particular window is being 'grabbed'. >> Does WindowS

NSRuler for nonlinear measurements

2011-02-24 Thread Carlos Eduardo Mello
Hi everone, I am using a vertical NSRuler with my CustomView-inside-ScrollView set up. I read every piece of documentation there is (guides, reference) and searched the list archives and google but couldn't find anything to help me customize my rulers to be associated with data that does

dynamic binding in initializers

2011-02-24 Thread Roland King
I burned myself today with a pattern I've been using for ages. I have lots of UIView subclasses which could be initialized with initWithFrame: or initWithCoder: so I have one -(void)internalInit method which I call from both of them to do the real work. Of course eventually I went and subclassed

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread Andreas Grosam
On Feb 24, 2011, at 10:43 AM, Gwynne Raskind wrote: > You can use protocols alone to do object creation with a little runtime > trickery. I'm quite fond of this small set of language "extensions": > > I would really prefer that this "extension" below will

Loading SampleHardWarePlugin problem

2011-02-24 Thread sheen mac
Hi All, I download the SampleHardwarePlugin code from apple site.Build and copy it into "/Library/Audio/Plug-Ins/HAL/" and try totake it using NSBundle.But I got error in cosole. Error loading /Library/Audio/Plug-Ins/HAL/SampleHardwarePlugIn.plugin/Contents/MacOS/SampleHardwarePlugIn:  dlopen(

Re: "Highlight" a window of another application

2011-02-24 Thread eveningnick eveningnick
> I need to somehow "impact" a particular window for the user, make it bold, > change it's shadow color or add some kind of a frame around it - to remind > the user that only this particular window is being 'grabbed'. > Does WindowServer allow to perform such kind of operations on any level? > What

Re: Fast way to grab the screen

2011-02-24 Thread Paul M
On 24/02/2011, at 11:06 PM, eveningnick eveningnick wrote: 2) how to grab a mouse pointer too? Like Skype, or ManyCam do, for example? They allow to save an image (or video) together with the cursor. How did they do that? The display buffers dont contain the mouse pointer, it's composited i

Re: "Highlight" a window of another application

2011-02-24 Thread Uli Kusterer
On 24.02.2011, at 10:44, eveningnick eveningnick wrote: > I need to somehow "impact" a particular window for the user, make it bold, > change it's shadow color or add some kind of a frame around it - to remind > the user that only this particular window is being 'grabbed'. > Does WindowServer allow

Re: "Highlight" a window of another application

2011-02-24 Thread Bill Cheeseman
On Feb 24, 2011, at 4:44 AM, eveningnick eveningnick wrote: > What APIs should i look at? Look at Apple's FunkyOverlayWindow sample code. -- Bill Cheeseman - b...@cheeseman.name ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do no

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread Uli Kusterer
On 23.02.2011, at 19:47, James Bucanek wrote: > Specifically, I create an Objective-C++ class that contain C++ object > references and types in its @interface declaration. How can I #import this > into an Objective-C module? The Objective-C won't understand any of the C++ > class names or types.

Re: Fast way to grab the screen

2011-02-24 Thread eveningnick eveningnick
Thank you for the answer So i guess OpenGL is a way to go. And with it, i have two problems: 1) how to select only a particular window to grab? Since im getting a framebuffer contents, i am having the whole screen picture. I need to cut out only a particular region of it - that contains a particu

"Highlight" a window of another application

2011-02-24 Thread eveningnick eveningnick
hi i am writing a small screen video grabber and i would like to have an option there to grab only a particular window. This window may belong to another application, of course. I need to somehow "impact" a particular window for the user, make it bold, change it's shadow color or add some kind of a

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread Gwynne Raskind
On Feb 24, 2011, at 3:58 AM, Andreas Grosam wrote: >> You can't, but you can declare protocols for your ObjC++ classes in separate >> headers then have the ObjC classes interact with "NSObject" instead of >> Foo objects directly. >> >> FooProtocol.h >> >> @protocol Foo >> // methods the pure Ob

How to create a CGColorSpaceRef with DeviceN model?

2011-02-24 Thread Graham Cox
Asking on behalf of someone else: How do you create a CGColorSpaceRef using the DeviceN model? It appears as if would allow spot colours to be specified, but I can't see how to create such a colorspace. --Graham ___ Cocoa-dev mailing list (Cocoa-de

Re: Help Mixing Objective-C & Objective-C++

2011-02-24 Thread Andreas Grosam
On Feb 24, 2011, at 1:18 AM, Lee Ann Rucker wrote: > You can't, but you can declare protocols for your ObjC++ classes in separate > headers then have the ObjC classes interact with "NSObject" instead of > Foo objects directly. > > FooProtocol.h > > @protocol Foo > // methods the pure ObjC cla

Re: IBOutlet to different classes, conditional build

2011-02-24 Thread Graham Cox
On 24/02/2011, at 6:17 PM, Trygve Inda wrote: >> >> On 24/02/2011, at 5:56 PM, Trygve Inda wrote: >> >>> The problem is two-fold: >>> >>> 1) How can I have nibs, one with MyObjectClass:NSObject and the other with >>> MyObjectClass:NSPreferencePane where MyObjectClass is essentially the same >