Re: Can't get file type code using [fileAttr valueForKey:NSFileHFSTypeCode]

2008-05-24 Thread Michael Nickerson
On May 23, 2008, at 5:19 PM, Sean McBride wrote: On 5/22/08 4:37 PM, Lynn Barton said: From what I have read quickly since Sean McBride sent his comment, UTIs are not yet implemented to the point where I could get the UTI of every file on my computer. Sure you can. Use

Re: NSCollectionView problems

2008-05-24 Thread Markus Spoettl
Hello again, On May 23, 2008, at 1:20 PM, Markus Spoettl wrote: I have an NSCollectionView set up with bindings to visualize an NSMutableArray. When I call arrayController:setContent: the view (which initially doesn't have a content assigned) displays the items. So far so good. The

Cleaning up a singleton

2008-05-24 Thread Sebastian Nowicki
Hi, I have a bit of an odd problem, which may be the result of a bad design decision. My program wraps around a C library, which internally uses a global variable (structure) to manage things, and has functions to access the data. The library requires me to call a function which allocates

Re: Query about Zip command

2008-05-24 Thread Andrew Farmer
On 23 May 08, at 21:22, parag vibhute wrote: But my requirement is to pass arguments to GUI apps while launching it is it possible using Launch services? I will post my code of NSTask for launching GUI app in 1-2 days as my Mac is in office. GUI applications generally do not take arguments -

NSURLConnection canHandleRequest: succeeds even with no network

2008-05-24 Thread Mike
Why does [ NSURLConnection canHandleRequest: ] return YES even if I turn off all my network connections? I thought this method was supposed to be used for preflighting connection requests? Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: Cleaning up a singleton

2008-05-24 Thread Andrew Merenbach
Hi, Would the following NSApplication methods, placed into your application delegate's code, help at all? - (void)applicationDidFinishLaunching:(NSNotification *)aNotification; - (void)applicationWillTerminate:(NSNotification *)aNotification; Of the latter, the docs say that one should Put

Re: Query about Zip command

2008-05-24 Thread Andreas Mayer
Am 24.05.2008 um 08:08 Uhr schrieb Andrew Farmer: GUI applications generally do not take arguments - opened files are passed using Apple Events. Hence, Launch Services doesn't provide any way to pass arguments. You can use Apple Events yourself, though. See NSWorkspace's -

Re: Cleaning up a singleton

2008-05-24 Thread Andreas Mayer
Am 24.05.2008 um 08:07 Uhr schrieb Sebastian Nowicki: The library requires me to call a function which allocates memory to that global variable, and afterwards call a function which deallocates that memory. My singleton class calls the function to initialise in the init method, but I

Re: Query about Zip command

2008-05-24 Thread Adam R. Maxwell
On May 23, 2008, at 11:08 PM, Andrew Farmer wrote: On 23 May 08, at 21:22, parag vibhute wrote: But my requirement is to pass arguments to GUI apps while launching it is it possible using Launch services? I will post my code of NSTask for launching GUI app in 1-2 days as my Mac is in

Re: Removing the Filename flag in Doc. based Application

2008-05-24 Thread Caleb Strockbine
On May 23, 2008, at 2:51 PM, [EMAIL PROTECTED] wrote: How do I set my document based application to omit the filename reference at the top of each opened document window? Kyle Sluder's explanation is quite informative, but it may also be more complicated than you need. If you really just

Re: Query about Zip command

2008-05-24 Thread parag vibhute
I am launching my app through applet. So passing arguments as command line is only current solution for me. Thanks, Palav On 5/24/08, Andreas Mayer [EMAIL PROTECTED] wrote: Am 24.05.2008 um 08:08 Uhr schrieb Andrew Farmer: GUI applications generally do not take arguments - opened files are

Re: Query about Zip command

2008-05-24 Thread parag vibhute
Sorry for my last email. That comment was incorrect(I was thinking something else). Sorry again. I will try with launchAppWithBundleIdentifier API will let u know the output. Thanks, Palav On 5/24/08, parag vibhute [EMAIL PROTECTED] wrote: I am launching my app through applet. So passing

Re: Cleaning up a singleton

2008-05-24 Thread Sebastian Nowicki
On 24/05/2008, at 3:48 PM, Andreas Mayer wrote: In case you use the notification, there is no need to expose anything. You just register a method of your singleton to receive the NSApplicationWillTerminateNotification and do your cleanup there. On Apple's developer website there are

Core Data dynamic attributes and fetching

2008-05-24 Thread Ben
Hi all, I have a core data object graph using an SQLite store where several entities have an attribute containing a date (eg, birthDate). This is stored as a date type. I am currently implementing an NSPredicateEditor for building smart groups. Each smart group simply saves this

Change the Language of just one Application

2008-05-24 Thread Gerriet M. Denkmann
Somewhere I have read (if my memory is not faulty) that it is possible to lauch an app with some arguments (or environment variables?) changing the preference order of languages. E.g. my preferred language is English, but I want to test the German localization of some app. Xcode allows

Re: NSTextView without word wrap?

2008-05-24 Thread Jonathan Dann
You're welcome, but I'd replace this: const CGFloat LargeNumberForText = 1.0e7; [[textView textContainer] setContainerSize:NSMakeSize(LargeNumberForText, LargeNumberForText)]; with [[textView textContainer] setContainerSize:NSMakeSize(FLT_MAX, FLT_MAX)]; hey presto 1 less line of

Re: File's Owner

2008-05-24 Thread Paul Sargent
On 24 May 2008, at 05:39, Andreas Mayer wrote: I thought, maybe a picture would help: http://www.harmless.de/images/other/files_owner.png Exactly the picture I was about to draw. Johnny Lundy wrote: Saying it connects the nib to an object outside the nib sounds good, but what object is

Re: File's Owner

2008-05-24 Thread Sherm Pendley
On Sat, May 24, 2008 at 6:49 AM, Paul Sargent [EMAIL PROTECTED] wrote: On 24 May 2008, at 05:39, Andreas Mayer wrote: I thought, maybe a picture would help: http://www.harmless.de/images/other/files_owner.png Exactly the picture I was about to draw. Johnny Lundy wrote: Saying it

Re: Accessing colours in NSColorPanel swatch

2008-05-24 Thread Keith Blount
Just for the archives, I found the solution to this on CocoaDev (which I had missed in my original search). Unfortunately it uses private methods, but I wrote an NSColorPanel category to access the swatch colours that should fail safely if the private methods are changed. I've added the

Re: NSURLConnection canHandleRequest: succeeds even with no network

2008-05-24 Thread Sherm Pendley
On Sat, May 24, 2008 at 2:11 AM, Mike [EMAIL PROTECTED] wrote: Why does [ NSURLConnection canHandleRequest: ] return YES even if I turn off all my network connections? I thought this method was supposed to be used for preflighting connection requests? From what I gather, the preflight

Re: How to tell if iTunes is running.

2008-05-24 Thread Mr. Gecko
Thanks I am using this iTunesIsOpen = NO; [iTunesLMenu setTitle: NSLocalizedString(@Launch iTunes,@)]; NSArray *lApplications = [[NSWorkspace sharedWorkspace] launchedApplications]; int a; for (a=0; a[lApplications count]; a++) { NSDictionary *applicationD = [lApplications objectAtIndex:a];

Re: Quit iTunes

2008-05-24 Thread Tommy Nordgren
On 24 maj 2008, at 17.49, Mr. Gecko wrote: How would I quit iTunes. There is a way to launch it with NSWorkspace but how about quit? ___ Send a quit AppleEvent -- Home is not where you

Re: Quit iTunes

2008-05-24 Thread I. Savant
On May 24, 2008, at 12:33 PM, Mr. Gecko wrote: How would I do that? I have been looking for a while and I found aevtquit but I can't find out how to send. Read the documentation:

NSWindow CoreAnimation Delegate not being called

2008-05-24 Thread Milen Dzhumerov
Hi all, I've been playing with CA and I tried to set up one my objects as the delegate for the frame change animation for an NSWindow by using the following code: CABasicAnimation* anim = [window animationForKey:@frame]; anim.delegate = self; [[window animator] setFrame:NSMakeRect(400,

Re: Quit iTunes

2008-05-24 Thread has
Mr. Gecko wrote: How would I quit iTunes. There is a way to launch it with NSWorkspace but how about quit? Send a quit AppleEvent How would I do that? I have been looking for a while and I found aevtquit but I can't find out how to send. Example: #include Carbon/Carbon.h OSStatus

Re: Quit iTunes

2008-05-24 Thread Mr. Gecko
That is slow because it has to compile. but if I can't get this apple event to work than I might do that On May 24, 2008, at 2:23 PM, Tommy Nordgren wrote: On 24 maj 2008, at 18.33, Mr. Gecko wrote: How would I do that? NSAppleScript * script = [[[NSAppleScript alloc]

Re: How to tell if iTunes is running.

2008-05-24 Thread Thomas Engelmeier
On 24.05.2008, at 21:05, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. For third party software you'd be right - Apple does not localize the names of iTunes / iPhoto / iDVD (browse through

Re: How to tell if iTunes is running.

2008-05-24 Thread Jens Alfke
On 24 May '08, at 12:05 PM, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. ... if ([[applicationD objectForKey:@NSApplicationPath] isEqualToString:iTunesPath]) It would be simpler just to

Re: How to tell if iTunes is running.

2008-05-24 Thread Steve Christensen
My version wasn't about using the path for something else; it was only about providing a method that doesn't care what the iTunes application is called. For example, if someone were to rename it iTunes 7.6.2, then your version would stop working. However, as Thomas Engelmeier pointed out

Re: How to tell if iTunes is running.

2008-05-24 Thread Steve Christensen
On May 24, 2008, at 2:11 PM, Jens Alfke wrote: On 24 May '08, at 12:05 PM, Steve Christensen wrote: Would something like this work better? It should deal with localization or if the user renames iTunes for some reason. ... if ([[applicationD objectForKey:@NSApplicationPath]

Re: File's Owner

2008-05-24 Thread Johnny Lundy
I dunno. Your book seems to be one of the few, if not the only, that is not on my bookshelf. If you email me your page on File's Owner, I can give feedback. On May 23, 2008, at 9:59 PM, [EMAIL PROTECTED] wrote: I despair that I am unable to adequately explain the concept and utility of

Re: How many times will a sub-classed NSView be instantiated in a simple Cocoa App?

2008-05-24 Thread Nathan Kinsinger
On May 24, 2008, at 6:09 PM, Graham Reitz wrote: Awesome! Thanks Nathan. That makes a lot more sense to me. Just set the class of the Custom View. What do you specifically mean by 'set the class'? In IB select the view then select the Identity Inspector (cmd-6 or the icon with the i

NSTextField in NSCollectionView aborts editing without notice, solved

2008-05-24 Thread David Carlisle
I have an NSTextField in an NSCollectionView. If I type in a change to the NSTextField, then without hitting tab or clicking elsewhere in the NSCollectionView I click on a popup menu in the window, the NSTextField aborts the edit and loses the information without any kind of notice being

Re: NSWindow CoreAnimation Delegate not being called

2008-05-24 Thread Peter Burtis
I'm no core animation expert, but. This... // self is an NSWindow instance CAAnimation *anim = [CABasicAnimation animation]; [anim setDelegate:self]; [self setAnimations:[NSDictionary dictionaryWithObject:anim forKey:@frame]]; [[self animator]