Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue. I would expect that the app thus remains responsive, but sometimes it is not. A sure way to beach-ball my app is: start it with a few hundred operations (which will take about 20 seconds to fin

Re: Operations Beachball

2012-12-04 Thread Mike Abdullah
You have a performance problem. Thus you should use Instruments to see what is going on, rather than hope we can tell you from vague snippets of code. On 4 Dec 2012, at 10:29, "Gerriet M. Denkmann" wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an N

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 4 Dec 2012, at 17:49, Mike Abdullah wrote: > You have a performance problem. Thus you should use Instruments to see what > is going on, rather than hope we can tell you from vague snippets of code. Maybe I should use Instruments, problem is: I cannot. I start Instruments, select some templ

Re: Operations Beachball

2012-12-04 Thread Roland King
Can you not run Instruments from the 'Profile' button on Xcode? It should start the process and attach to it and go from there. On 4 Dec, 2012, at 7:02 PM, "Gerriet M. Denkmann" wrote: > > On 4 Dec 2012, at 17:49, Mike Abdullah wrote: > >> You have a performance problem. Thus you should use

Re: Operations Beachball

2012-12-04 Thread jonat...@mugginsoft.com
On 4 Dec 2012, at 10:29, Gerriet M. Denkmann wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an NSOperationQueue. > > I would expect that the app thus remains responsive, but sometimes it is not. > > A sure way to beach-ball my app is: start it with

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 4 Dec 2012, at 18:10, Roland King wrote: > Can you not run Instruments from the 'Profile' button on Xcode? It should > start the process and attach to it and go from there. I got the Leaks Instrument to work this way (no Leaks) But all other Instruments just prompted repeatedly for an adm

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 4 Dec 2012, at 18:31, "jonat...@mugginsoft.com" wrote: > > > On 4 Dec 2012, at 10:29, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> >> I would expect that the app thus remains responsive, but

Re: Get the current displayed NSAlert

2012-12-04 Thread Brad O'Hearne
In general -- any alert that requires user attention (especially ones with multiple button alternatives) can be left on the screen indefinitely by a user. If you are monitoring environmental conditions (such as network, server, or Internet reachability) that arise, it is always possible that suc

Re: Get the current displayed NSAlert

2012-12-04 Thread Kyle Sluder
On Dec 4, 2012, at 7:49 AM, Brad O'Hearne wrote: > In general -- any alert that requires user attention (especially ones with > multiple button alternatives) can be left on the screen indefinitely by a > user. If you are monitoring environmental conditions (such as network, > server, or Intern

Re: Layers in NSCollectionView

2012-12-04 Thread Gordon Apple
Sorry for the delay. I¹ve been inaccessible for reasons I won¹t get into. I have tried it without setting any layers in IB. I think you may be correct about the copies. Another thing I don¹t know is if each cell simply uses the prototype to draw in the correct location, or it it does actually ma

Re: Operations Beachball

2012-12-04 Thread jonathan
On 4 Dec 2012, at 11:48, Gerriet M. Denkmann wrote: > > On 4 Dec 2012, at 18:10, Roland King wrote: > >> Can you not run Instruments from the 'Profile' button on Xcode? It should >> start the process and attach to it and go from there. > > I got the Leaks Instrument to work this way (no Le

Beachballing 2

2012-12-04 Thread Gerriet M. Denkmann
My app creates lots of MyOperations (subclass of NSOperation) and puts them into an NSOperationQueue. These operations do not do any I/O - they just use the Cpu. When I make some other app active and then try again to make my app active, my app beach-balls. When all my operations have finished,

NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
I have an app which uses NSOperations inside an NSOperationQueue. These operations do not do any I/O - just Cpu. No swapping is taking place. When I set [ self.operationQueue setMaxConcurrentOperationCount: 1 ] each operation takes on average 200 msec., measured by NSDate. With 2 concurrent ope

Re: Beachballing 2

2012-12-04 Thread Alex Zavatone
WAG - the # of cores - 1? On Dec 4, 2012, at 12:54 PM, Gerriet M. Denkmann wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an NSOperationQueue. > These operations do not do any I/O - they just use the Cpu. > > When I make some other app active and the

Re: Operations Beachball

2012-12-04 Thread Jens Alfke
On Dec 4, 2012, at 3:48 AM, Gerriet M. Denkmann wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an NSOperationQueue. > I would expect that the app thus remains responsive, but sometimes it is not. Welcome to the joys of multithreaded programming. :-P

Re: NSOperation Efficiency

2012-12-04 Thread Jens Alfke
On Dec 4, 2012, at 10:15 AM, Gerriet M. Denkmann wrote: > Is this to be expected? Or does my app has some hidden flaws? If so, where > should I start looking? Instruments. This is exactly what CPU profiling is for. If you can’t get Instruments to work for you, that’s a separate issue, and you

Re: Beachballing 2

2012-12-04 Thread Jens Alfke
On Dec 4, 2012, at 9:54 AM, Gerriet M. Denkmann wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an NSOperationQueue. > These operations do not do any I/O - they just use the Cpu. But in your earlier thread you showed a code snippet that included a co

Re: Operations Beachball

2012-12-04 Thread Charles Srstka
On Dec 4, 2012, at 4:29 AM, Gerriet M. Denkmann wrote: > My app creates lots of MyOperations (subclass of NSOperation) and puts them > into an NSOperationQueue. > > I would expect that the app thus remains responsive, but sometimes it is not. > > A sure way to beach-ball my app is: start it wi

Re: NSOperation Efficiency

2012-12-04 Thread Mike Abdullah
If your operations are purely CPU-bound, the whole point of GCD is to manage this for you. With the default number of concurrent operations, NSOperationQueue does exactly that. Have you tried with that setting? On 4 Dec 2012, at 18:15, "Gerriet M. Denkmann" wrote: > I have an app which uses NS

Re: Beachballing 2

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 01:33, Jens Alfke wrote: > > On Dec 4, 2012, at 9:54 AM, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> These operations do not do any I/O - they just use the Cpu. > > But in your

Re: Beachballing 2

2012-12-04 Thread Jens Alfke
On Dec 4, 2012, at 10:58 AM, "Gerriet M. Denkmann" wrote: > When an operation has finished, it sends a message to the app delegate. Every > 20th time, the app delegate then does: self.aValue = ...some number ... > @property (assign) NSUInteger aValue; // aValue is bound to some NSTextField. >

Re: Beachballing 2

2012-12-04 Thread Chris Hanson
Please don't create lots of different message threads for a single issue/discussion. Sticking to a single thread makes it much easier to follow by keeping all of the context together. Thanks. -- Chris -- cocoa-dev's other moderator ___ Cocoa-de

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 01:55, Mike Abdullah wrote: > If your operations are purely CPU-bound, the whole point of GCD is to manage > this for you. With the default number of concurrent operations, > NSOperationQueue does exactly that. Have you tried with that setting? I have, and it makes my app un

Re: NSOperation Efficiency

2012-12-04 Thread Kyle Sluder
On Tue, Dec 4, 2012, at 10:15 AM, Gerriet M. Denkmann wrote: > I have an app which uses NSOperations inside an NSOperationQueue. These > operations do not do any I/O - just Cpu. No swapping is taking place. > > When I set [ self.operationQueue setMaxConcurrentOperationCount: 1 ] each > operation t

Re: NSOperation Efficiency

2012-12-04 Thread Sean McBride
On Wed, 5 Dec 2012 01:15:11 +0700, Gerriet M. Denkmann said: >I have an app which uses NSOperations inside an NSOperationQueue. These >operations do not do any I/O - just Cpu. No swapping is taking place. Do your operations use a lot of memory? Even though you're not swapping, maybe you're blow

Re: "Dangling reference to an invalid object"

2012-12-04 Thread Mike Abdullah
On 3 Dec 2012, at 18:13, Nick Zitzmann wrote: > > On Dec 1, 2012, at 10:33 AM, Mike Abdullah wrote: > >> I've been trying to hunt down a problem where Core Data will occasionally >> refuse to save with the error " >> Dangling reference to an invalid object". I wrote up the details here: >>

Plug-In failure on OS X 10.8.2 after updating to Oracle Java SE7

2012-12-04 Thread Hariharan Muthu
Hi, I have developed sample ***COCOA-64 bit*** application using Webkit Framework with all plug In settings enabled (setJavaEnabled:YES & setPlugInsEnable:YES). I have tried to load Juniper SSL webvpn url which in turn uses Java applet plug-In to launch VPN connection in the webview. This

Objective C blogs?

2012-12-04 Thread tshanno
Hi, I'm relatively new to objective C and Cocoa but not to C and not to object-orented programming. I've found with other languages that browsing blogs which address different aspects of the language with some occasional code can be useful in terms of learning the ins and outs of the language

How to capture a video stream

2012-12-04 Thread gary . gardner
I have been digging for a couple of weeks now and I have progressed to the point where I have the AVCaptureDevice and the session. Here's what I need help/guidance/assistance on: I want to capture the video images from which ever camera device I select and using those images, real time, take the

NSImage issue in 10.6

2012-12-04 Thread Amy Gibbs
I have the following code that generates images. It works perfectly in 10.5 but doesn't in 10.6. in 10.6 the images are laid on in the right place, - (IBAction)generateKitImages:(id)sender; { NSObject *kit; kit = [[kits selectedObjects] objectAtIndex:0]; NSSt

Re: Objective C blogs?

2012-12-04 Thread Jens Alfke
On Nov 29, 2012, at 3:09 AM, tshanno wrote: > I've done an Internet search but most of the blogs I've found are out of date > and/or don't have regular postings. Anyone have any suggestions for some > blogs I might check out? NSBlog: http://www.mikeash.com/pyblog/ NSHipster: http://nshipster

Re: Objective C blogs?

2012-12-04 Thread Geoffrey Goutallier
Hello, I know about 2 that are great and updated regularly : http://www.mikeash.com/pyblog/ http://nshipster.com Not oriented towards your interests tho, but very great ! Hope they will please you, ++GG On Nov 29, 2012, at 12:09, tshanno wrote: > Hi, > > I'm relatively new to objective C

Re: How to capture a video stream

2012-12-04 Thread jonat...@mugginsoft.com
On 3 Dec 2012, at 06:02, gary.gard...@brokensoftware.com wrote: > I have been digging for a couple of weeks now and I have progressed to the > point where I have the AVCaptureDevice and the session. > > Here's what I need help/guidance/assistance on: > > I want to capture the video images from

Re: How to capture a video stream

2012-12-04 Thread Quincey Morris
On Dec 2, 2012, at 22:02 , gary.gard...@brokensoftware.com wrote: > Can anyone tell me what the next steps are? Any snippets of code that I > can look at? I'm sure I'm not the first to try to do this. Have you looked here? https://developer.apple.com/library/mac/#documentation/AudioVi

Re: How to capture a video stream

2012-12-04 Thread gary . gardner
> > > On 3 Dec 2012, at 06:02, gary.gard...@brokensoftware.com wrote: > >> I have been digging for a couple of weeks now and I have progressed to >> the >> point where I have the AVCaptureDevice and the session. >> >> Here's what I need help/guidance/assistance on: >> >> I want to capture the video

Re: How to capture a video stream

2012-12-04 Thread gary . gardner
> On Dec 2, 2012, at 22:02 , gary.gard...@brokensoftware.com wrote: > >> Can anyone tell me what the next steps are? Any snippets of code that I >> can look at? I'm sure I'm not the first to try to do this. > > Have you looked here? > > > https://developer.apple.com/library/mac/#documentat

Document Types, imported and exported uti's

2012-12-04 Thread Koko
The iOS programming guide says to use the items in the subject line to tell iOS the docs your app can open. I haven done this and installed my app in an iPad. I have DropBox on the iPad and expected to have DropBox recognize my app for opening a file in the box of my type. But it does not recog

Re: NSOperation Efficiency

2012-12-04 Thread Mike Abdullah
On 4 Dec 2012, at 19:01, "Gerriet M. Denkmann" wrote: > > On 5 Dec 2012, at 01:55, Mike Abdullah wrote: > >> If your operations are purely CPU-bound, the whole point of GCD is to manage >> this for you. With the default number of concurrent operations, >> NSOperationQueue does exactly that.

Re: How to capture a video stream

2012-12-04 Thread Quincey Morris
On Dec 4, 2012, at 16:50 , gary.gard...@brokensoftware.com wrote: > The setSampleBufferDelegate:self queue:queue gives a warning in XCode that > says Sending '' to parameter of incompatible type > 'id'' You need to declare the class of 'self' as conforming to the AVCaptureVideoDataOutputSampleBu

Re: How to capture a video stream

2012-12-04 Thread gary . gardner
>> On Dec 2, 2012, at 22:02 , gary.gard...@brokensoftware.com wrote: >> >>> Can anyone tell me what the next steps are? Any snippets of code that >>> I >>> can look at? I'm sure I'm not the first to try to do this. >> >> Have you looked here? >> >> >> https://developer.apple.com/library/mac

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 02:58, Kyle Sluder wrote: > On Tue, Dec 4, 2012, at 10:15 AM, Gerriet M. Denkmann wrote: >> I have an app which uses NSOperations inside an NSOperationQueue. These >> operations do not do any I/O - just Cpu. No swapping is taking place. >> >> When I set [ self.operationQueue s

Re: NSOperation Efficiency

2012-12-04 Thread Kyle Sluder
On Tue, Dec 4, 2012, at 05:02 PM, Gerriet M. Denkmann wrote: > > On 5 Dec 2012, at 02:58, Kyle Sluder wrote: > > > On Tue, Dec 4, 2012, at 10:15 AM, Gerriet M. Denkmann wrote: > >> I have an app which uses NSOperations inside an NSOperationQueue. These > >> operations do not do any I/O - just Cp

Re: NSOperation Efficiency

2012-12-04 Thread Jens Alfke
On Dec 4, 2012, at 7:33 PM, Kyle Sluder wrote: > Yeah, it sounds like you're saturating the thread pool due to > non-CPU-bound operations. NSOpQ is going to spend its entire time > spawning and switching to threads while you append more and more > operations to the queue. Apologies, but I have

Re: NSOperation Efficiency

2012-12-04 Thread Kyle Sluder
On Dec 4, 2012, at 8:00 PM, Jens Alfke <[1]j...@mooseyard.com> wrote: On Dec 4, 2012, at 7:33 PM, Kyle Sluder <[2]k...@ksluder.com> wrote: Yeah, it sounds like you're saturating the thread pool due to non-CPU-bound operations. NSOpQ is going to spend its entire time spawning and switchin

Arc and **

2012-12-04 Thread Gerriet M. Denkmann
I have (using Arc) a method which works fine: NSString *explanation; [ self doSomeThingAndExplain: &explanation ]; Now I decided that sometimes I don't need this explanation. So I changed it to: NSString **explanatioP = urgent ? NULL : &explanation; // <-- "no explicit ownership... [ self doSome

Re: Arc and **

2012-12-04 Thread Roland King
NSString *explanation; [ self doSomeThingAndExplain:( urgent ? NULL : &explanation ) ]; I tried some REALLY ugly casts putting __autoreleasing and __strong here and there around the *s in the explainP but got nowhere, so that's the best I can come up with apart from writing doSomethingAndDontExp

Re: Arc and **

2012-12-04 Thread Greg Parker
On Dec 4, 2012, at 8:56 PM, Gerriet M. Denkmann wrote: > I have (using Arc) a method which works fine: > NSString *explanation; > [ self doSomeThingAndExplain: &explanation ]; > > Now I decided that sometimes I don't need this explanation. So I changed it > to: > > NSString **explanatioP = urge

Re: Arc and **

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 12:59, Greg Parker wrote: > On Dec 4, 2012, at 8:56 PM, Gerriet M. Denkmann wrote: >> I have (using Arc) a method which works fine: >> NSString *explanation; >> [ self doSomeThingAndExplain: &explanation ]; >> >> Now I decided that sometimes I don't need this explanation. So

Re: NSOperation Efficiency

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 11:41, Kyle Sluder wrote: > > On Dec 4, 2012, at 8:00 PM, Jens Alfke wrote: > >> >> On Dec 4, 2012, at 7:33 PM, Kyle Sluder wrote: >> >>> Yeah, it sounds like you're saturating the thread pool due to >>> non-CPU-bound operations. NSOpQ is going to spend its entire tim

Re: Operations Beachball

2012-12-04 Thread Gerriet M. Denkmann
On 5 Dec 2012, at 01:29, Jens Alfke wrote: > > On Dec 4, 2012, at 3:48 AM, Gerriet M. Denkmann wrote: > >> My app creates lots of MyOperations (subclass of NSOperation) and puts them >> into an NSOperationQueue. >> I would expect that the app thus remains responsive, but sometimes it is not.