How do I make one thread wait until another thread exits?

2009-02-12 Thread Oleg Krupnov
This seems a trivial question for a multi-threading app, but I haven't been successful in implementing this in Cocoa. I've got deadlocks and strange logs for seemingly no reason. Here's my problem: There is the main thread that starts a worker NSOperation to do some job (-[NSOperationQueue

[iPhone] Abort/remove all running/pending animations

2009-02-12 Thread Ruotger Skupin
Hi, I'm resizing and moving the content of a UIScrollView in the - scrollViewDidEndZooming:withView:atScale: method including the removing/adding of views. This usually results in the content bouncing more or less uncontrollable. My question: Is it possible to remove/abort *all* (really

Garbage Collection and NSManagedObject

2009-02-12 Thread Samuel Strupp
Hi guys i have problem with the garbage collector. May App is a CoreData App (not document based). If i try to change the database and load a new one. The grabage collector collects the old NSMangedObjects from the old store. But this happens in the gabage collector thread. The

Saving IKImageBrowser Order and Content?

2009-02-12 Thread Chunk 1978
topic says it all. i have installed an IKImageBrowser which allows me to drop images and reorder them. it would be great to be able to automatically save the dropped images as well as their order so that the next time the app starts and the image browser loads up everything is still there. can

Re: Reading packets from an audio file

2009-02-12 Thread Michael Ash
On Thu, Feb 12, 2009 at 6:17 AM, rethish reth...@newtok.com wrote: Hi all, I need to append an newly recorded audio file with the end of an existing file. I use the function , AudioFileOpenURL ( [snip] This is completely off-topic here. You'll probably get much better results on the

Re: How do I make one thread wait until another thread exits?

2009-02-12 Thread Michael Ash
On Thu, Feb 12, 2009 at 4:25 AM, Oleg Krupnov oleg.krup...@gmail.com wrote: This seems a trivial question for a multi-threading app, but I haven't been successful in implementing this in Cocoa. I've got deadlocks and strange logs for seemingly no reason. Here's my problem: There is the main

Re: Garbage Collection and NSManagedObject

2009-02-12 Thread I. Savant
On Thu, Feb 12, 2009 at 9:52 AM, Samuel Strupp str...@synium.de wrote: i have problem with the garbage collector. May App is a CoreData App (not document based). If i try to change the database and load a new one. It's not clear what you mean here. Be *very* specific (and show code). --

newbie question on creating .png files

2009-02-12 Thread Smith, Steven (MCP)
Hi folks, I'm relatively new to Cocoa and need some direction on creating .png files. I need to create 365 png files (one for each day of the year) to be used as tags by other folks (eg JAN01.png JAN2.png...DEC31.png). I think I understand the draw/graphics concept, but I've been unable to get

Re: Saving IKImageBrowser Order and Content?

2009-02-12 Thread douglas welton
I will assume that you are using an array controller to handle the backing data for you IKImageBrowserView. If so, all you will need to do is archive the array controller's arrangedObjects (or content plus any filter predicate) and save it to a file - perhaps using NSArray's handy-dandy

Re: Garbage Collection and NSManagedObject

2009-02-12 Thread Samuel Strupp
Hi I simply want to delete the actual database (SQL Database) and load a new one. First: all controllers which hold refs to NSManagedObjects will be deleted. Then the i call [[NSGarbageCollector defaultCollector] collectExhaustively]; Then i disconnect from the database. This is the

Re: NSTextView and keyDown: in the responder chain

2009-02-12 Thread Ross Carter
On Feb 11, 2009, at 10:21 PM, Tom wrote: However, I've found that when an NSTextView receives a keyDown event that doesn't handle, it doesn't bother to send the event down the responder chain and just calls NSBeep(). I expect that there isn't a keyDown event that NSTextView doesn't

Re: How do I make one thread wait until another thread exits?

2009-02-12 Thread Oleg Krupnov
Thanks, Mike. I assume that I need to also use #define OPERATION_NOT_FINISHED 0 and condLock = [[NSConditionLock alloc] initWithCondition: OPERATION_NOT_FINISHED]; Right? I have a doubt here, however. What if the cancel message is sent even before the worker thread had the possibility to

Re: newbie question on creating .png files

2009-02-12 Thread Jean-Daniel Dupas
Le 12 févr. 09 à 16:31, Smith, Steven (MCP) a écrit : Hi folks, I'm relatively new to Cocoa and need some direction on creating .png files. I need to create 365 png files (one for each day of the year) to be used as tags by other folks (eg JAN01.png JAN2.png...DEC31.png). I think I

Re: Garbage Collection and NSManagedObject

2009-02-12 Thread I. Savant
On Thu, Feb 12, 2009 at 10:55 AM, Samuel Strupp str...@synium.de wrote: I simply want to delete the actual database (SQL Database) and load a new one. Okay. First: all controllers which hold refs to NSManagedObjects will be deleted. What do you mean deleted? Do you just mean you're

Re: newbie question on creating .png files

2009-02-12 Thread Felix Franz
On 12.02.2009, at 17:14, Jean-Daniel Dupas wrote: Unfortunately, I don't think you can save an NSImage as a PNG (it only supports the TIFFRepresentation method). You can create a new NSBitmapImageRep using the TIFFRepresentation and use representationUsingType:properties: to get the

Re: Garbage Collection and NSManagedObject

2009-02-12 Thread I. Savant
On Thu, Feb 12, 2009 at 11:23 AM, I. Savant idiotsavant2...@gmail.com wrote: Are you *sure* that's the problem? It may not be. My first suspect is that I don't see anywhere that you're actually tearing down the right parts of the Core Data stack (the context and the persistent store). ...

Re: Saving IKImageBrowser Order and Content?

2009-02-12 Thread Chunk 1978
hi douglas, i am not using an array controller... my current method is copying images to the pasteboard (they are produced images from within the app) and writing them to a folder when they are dropped into the image browser. i'm assuming it shouldn't be too difficult to incorporate an array

Re: Design Question

2009-02-12 Thread David Duncan
On Feb 12, 2009, at 9:50 AM, David Blanton wrote: Do I understand correctly that if a layer with explicit animations is hidden the animation is still running? Yes, animations always run, regardless of the hidden state of a layer (hidden is just another render attribute). -- David Duncan

Re: Design Question

2009-02-12 Thread David Blanton
So besides hiding a layer I should also removeAnimationForKey: Thanks! On Feb 12, 2009, at 11:16 AM, David Duncan wrote: On Feb 12, 2009, at 9:50 AM, David Blanton wrote: Do I understand correctly that if a layer with explicit animations is hidden the animation is still running? Yes,

Re: Saving IKImageBrowser Order and Content?

2009-02-12 Thread douglas welton
Two things: 1) when I typed NSArrayController into the search field on the ADC site, I got 209 possible places where you could begin your search for info on how to use NSArrayController bindings with IKImageBrowserView. If none of these is sufficient or you are a novice to the binding

Re: newbie question on creating .png files

2009-02-12 Thread David Duncan
On Feb 12, 2009, at 8:28 AM, Felix Franz wrote: You can create a new NSBitmapImageRep using the TIFFRepresentation and use representationUsingType:properties: to get the PNG-data: NSData* TIFFData = [img TIFFRepresentation]; NSBitmapImageRep* bitmapImageRep = [NSBitmapImageRep

Proper NSOperation isCancelled handling

2009-02-12 Thread Alex Curylo
So I'm a bit confused about how my NSOperation subclass should implement the cancel method. The documentation says that isCancelled is a KVO-compliant property. So I figured that calling [super cancel] ought to take care of that. But it doesn't. Doesn't appear to do anything, actually,

Re: Transparent Image

2009-02-12 Thread Benjamin Dobson
On 12 Feb 2009, at 04:37:35, Michael Ash wrote: On Wed, Feb 11, 2009 at 3:41 PM, Christian Graus christian.gr...@gmail.com wrote: Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in the Mac world ? Awesome !! I've found plenty of

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
24 hours later, still completely stumped on this one. The sticking point seems to be that Apple's NSTextFieldCell is doing something that is not clearly defined in the Key-Value Observing/Key-Value coding documentation to allow the following to work [column bind: @value toObject:

Re: Transparent Image

2009-02-12 Thread Corbin Dunn
On Feb 11, 2009, at 8:37 PM, Michael Ash wrote: On Wed, Feb 11, 2009 at 3:41 PM, Christian Graus christian.gr...@gmail.com wrote: Please file a bug and request this functionality. OK - that would not have occurred to me at all. That works in the Mac world ? Awesome !! I've found plenty of

Re: Binding to custom NSCell

2009-02-12 Thread Corbin Dunn
On Feb 12, 2009, at 1:18 PM, Ken Tozier wrote: 24 hours later, still completely stumped on this one. The sticking point seems to be that Apple's NSTextFieldCell is doing something that is not clearly defined in the Key-Value Observing/Key-Value coding documentation to allow the following

Re: Communication between objects

2009-02-12 Thread Jason Wiggins
Thanks all to who replied for taking the time to sort me out. Your replies have and will be helpful to my understanding of what goes on. I'll let it sink into my head a bit more in the morning (It's 3:16am here in Sydney). Kind regards to all, Jason

Converting a CMYK NSImage to RGB

2009-02-12 Thread Ron Aldrich
Folks, I'm having an issue where CMYK images aren't being recognized by my quartz compositions, so I need to convert them to RGB for display. I've written a routine to do it, but its causing problems. NSImageRep* theImageRep = [inputImage bestRepresentationForDevice: [NSDictionary

CALayer wierdness

2009-02-12 Thread David Blanton
I set up a CALayer is shows in the iPhone Simulator does not show in the iPhone How can that be? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact

Re: CALayer wierdness

2009-02-12 Thread Brian Christensen
On Feb 12, 2009, at 21:23, David Blanton wrote: I set up a CALayer is shows in the iPhone Simulator does not show in the iPhone How can that be? I doubt anyone can answer your question without seeing relevant code snippets. /brian

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
Hmmm. Making my cell a subclass of NSTextFieldCell solved the problem. I would dearly love to get a look at the the source for NSTextFieldCell to see what it's doing, behind-the-scenes, that makes this binding work. In general, it would be a boon to developers if Apple would open up the

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
Just for kicks, I tried stepping back a level and making my cell a subclass of NSActionCell and that works too. So it seems that whatever magic Apple is performing happens inside NSActionCell. On Feb 12, 2009, at 11:09 PM, Ken Tozier wrote: Hmmm. Making my cell a subclass of

Re: Window Max Zoom Size

2009-02-12 Thread John C. Randolph
On Feb 12, 2009, at 9:42 AM, Anthony Smith wrote: What is the best way to set the max zoom size for NSWindow? I was able to implement a solution by overriding zoom but that feels rather invasive so I'm assuming there's probably a better way. Check the docs for -windowWillResize:toSize:.

Re: memory leak analyzer tools

2009-02-12 Thread John C. Randolph
On Feb 10, 2009, at 11:32 PM, Valentin Dan wrote: Hi, What tools are there to analyze memory leaks in programs ? Is there something that would tell the exact location of the leak (the object that's not being released) ? Try /Developer/Applications/Instruments. It has a template

Re: Transparent Image

2009-02-12 Thread Michael Ash
On Thu, Feb 12, 2009 at 5:48 PM, Corbin Dunn corb...@apple.com wrote: For what it's worth, filing bugs is *very* worthwhile. It lets Apple know what issues are important to developers and what problems they are encountering. Logging duplicates is also fine, as it gives us an idea of what

Re: Binding to custom NSCell [Solved]

2009-02-12 Thread Ken Tozier
After looking at NSActionCell, I noticed the setControlView method and this seems to be the missing link. NSActionCell sets it's control view while NSCell does not. When I manually set the control view for my custom cell to the table that contains it, viola! It works. So, for any other

Chnaging icon of running app

2009-02-12 Thread Erg Consultant
Is it possible to change the icon of a running app after it has already been started? My app has no .icns file not will it - but I want to set it to some other bundle's icon after my app has already launched. I've seen discussions in the archives about how to change the Dock icon, but not the

Re: Chnaging icon of running app

2009-02-12 Thread Rick Langschultz
Adium has a great example of what you're looking to do Sent from my iPhone On Feb 12, 2009, at 10:57 PM, Erg Consultant erg_consult...@yahoo.com wrote: Is it possible to change the icon of a running app after it has already been started? My app has no .icns file not will it - but I want

Re: memory leak analyzer tools

2009-02-12 Thread Alex Kac
CLANG worked quite well for us. On Feb 12, 2009, at 10:45 PM, John C. Randolph wrote: On Feb 10, 2009, at 11:32 PM, Valentin Dan wrote: Hi, What tools are there to analyze memory leaks in programs ? Is there something that would tell the exact location of the leak (the object that's not

Re: CALayer wierdness

2009-02-12 Thread David Blanton
The Simulator is not case sensitive when it comes to file names. The file name in the project is Level 1 top.png Capital L This code yields a nil provider in the iPhone, ergo no layer contents imageFileName = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@level 1

[SOLVED] Re: NSTextView and keyDown: in the responder chain

2009-02-12 Thread Tom
On 13/02/2009, at 1:58 AM, Ross Carter wrote: On Feb 11, 2009, at 10:21 PM, Tom wrote: However, I've found that when an NSTextView receives a keyDown event that doesn't handle, it doesn't bother to send the event down the responder chain and just calls NSBeep(). I expect that there

Matching String With ObjectForKey?

2009-02-12 Thread Chunk 1978
how can i equate an NSString to an ObjectForKey (which is also an NSString)? kinda driving me crazy. -=-=-=- NSString *desktopPlist = [@~/Library/Preferences/com.apple.desktop.plist stringByExpandingTildeInPath]; NSString *originalDesktopBackgroundImage = NSDictionary

Re: Matching String With ObjectForKey?

2009-02-12 Thread Volker in Lists
Hi, you compare objects with == but what you really want is isEqualToString: since you want to compare the string contents. Cheers, Volker ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: Matching String With ObjectForKey?

2009-02-12 Thread John C. Randolph
On Feb 12, 2009, at 10:45 PM, Chunk 1978 wrote: if ([defaults objectForKey:@OriginalBackground] == pathy) .. but they are the same! aren't they?! Nope. You're comparing two addresses, not the contents of the objects at those addresses. Try: if ([[defaults

Re: Matching String With ObjectForKey?

2009-02-12 Thread Chunk 1978
ahh... that old trap again ;)... thanks guys On Fri, Feb 13, 2009 at 1:56 AM, John C. Randolph j...@mac.com wrote: On Feb 12, 2009, at 10:45 PM, Chunk 1978 wrote: if ([defaults objectForKey:@OriginalBackground] == pathy) .. but they are the same! aren't they?! Nope. You're