Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 22:43 , Joar Wingfors wrote: > Or: > > [[NSFileManager defaultManager] createFileAtPath: path contents: nil > attributes: nil]; > > ...but yeah, it doesn't take an URL, and it doesn't return an error on > failure. Good topic for an enhancement request on Foundation I

Re: Can't create temporary file

2011-05-19 Thread Joar Wingfors
On 19 maj 2011, at 16.48, Quincey Morris wrote: >> It seems Cocoa is lacking in file-creation APIs (none URL-based, none return >> an error object). > > How about: > > [[NSData data] writeToURL: myURL options: 0 error: &error]; Or: [[NSFileManager defaultManager] createFileAtP

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 22:31 , Quincey Morris wrote: > On May 19, 2011, at 21:53, Rick Mann wrote: > >> But frankly, that's a kludge. Cocoa is full of inconsistencies (like >> NSFileManager/NSFileHandle lacking modern file creation methods) forcing the >> (ab)use of another API. Sure, it works (I

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 21:53, Rick Mann wrote: > But frankly, that's a kludge. Cocoa is full of inconsistencies (like > NSFileManager/NSFileHandle lacking modern file creation methods) forcing the > (ab)use of another API. Sure, it works (I'm guessing), but it's ugly. It's in the eye of the behold

Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method

2011-05-19 Thread Martin Schürrer
Hi, I want to highlight @mentions, #hashtags and links in an NSTextView as the user types. I've been thinking I'd implement this via the shouldChangeTextInRange delegate method. My plan is as follows: I'm going to construct the new string (via stringByReplacingCharactersInRange:affectedCharRange

Re: Installing application on a network onto several computers

2011-05-19 Thread Joe Wollard
In a small scenario like that, you'd probably be pretty happy with something like Apple Remote Desktop (although it's expensive if this is a one off scenario). Basically you'd install ARD on the teacher's workstation and then push the pkg out to the rest of the classroom through that software.

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 21:50 , Quincey Morris wrote: > On May 19, 2011, at 21:46, Rick Mann wrote: > >> >> On May 19, 2011, at 16:48 , Quincey Morris wrote: >> >>> On May 19, 2011, at 11:55, Rick Mann wrote: >>> It seems Cocoa is lacking in file-creation APIs (none URL-based, none ret

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 21:46, Rick Mann wrote: > > On May 19, 2011, at 16:48 , Quincey Morris wrote: > >> On May 19, 2011, at 11:55, Rick Mann wrote: >> >>> It seems Cocoa is lacking in file-creation APIs (none URL-based, none >>> return an error object). >> >> How about: >> >> [[NSData da

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 19, 2011, at 16:48 , Quincey Morris wrote: > On May 19, 2011, at 11:55, Rick Mann wrote: > >> It seems Cocoa is lacking in file-creation APIs (none URL-based, none return >> an error object). > > How about: > > [[NSData data] writeToURL: myURL options: 0 error: &error]; That req

Re: Can't create temporary file

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 11:55, Rick Mann wrote: > It seems Cocoa is lacking in file-creation APIs (none URL-based, none return > an error object). How about: [[NSData data] writeToURL: myURL options: 0 error: &error]; ___ Cocoa-dev mailing list

Re: Can't create temporary file

2011-05-19 Thread Rick Mann
On May 14, 2011, at 2:22 , Quincey Morris wrote: > On May 13, 2011, at 22:46, Rick Mann wrote: > >> Any idea what I'm doing wrong? > > > Well, this seems relevant: > > > http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/NSFileHandle_Class/Referenc

Re: "Use them from only one thread at a time"

2011-05-19 Thread Greg Parker
On May 19, 2011, at 3:40 PM, Sean McBride wrote: > On Thu, 19 May 2011 15:32:07 -0700, Greg Parker said: >> There are several cases involved here: >> >> 1. You may use an instance on any thread, as long as every use is >> synchronized such that only one thread uses that instance at a time. >> 2. Y

Re: "Use them from only one thread at a time"

2011-05-19 Thread Sean McBride
On Thu, 19 May 2011 15:32:07 -0700, Greg Parker said: >There are several cases involved here: > >1. You may use an instance on any thread, as long as every use is >synchronized such that only one thread uses that instance at a time. >2. You may create an instance on any thread, and must not use it

Re: "Use them from only one thread at a time"

2011-05-19 Thread Justin Anderson
I think there's actually a typo in the second sentence. If you look in the Thread-Safe section above that, it refers to instances: "The following classes and functions are generally considered to be thread-safe. You can use the same instance from multiple threads without first acquiring a lock."

Re: "Use them from only one thread at a time"

2011-05-19 Thread Greg Parker
On May 19, 2011, at 3:06 PM, Sean McBride wrote: > On Thu, 19 May 2011 14:31:23 -0700, Quincey Morris said: >> On May 19, 2011, at 13:56, Sean McBride wrote: Would it be correct to restate it like this… "In most cases, although you can allocate instances of these classes on >>>

Re: The simplest way to fade out a view

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 15:01, Nick wrote: > No, only fade out (and fade in) effects are needed. I just added frame > movement to see if animation works at all. Animation does work, but > the fade does not happen - no matter, if the frame is moved > simultaneously or not. Here's my actual code for do

Re: "Use them from only one thread at a time"

2011-05-19 Thread Sean McBride
On Thu, 19 May 2011 14:31:23 -0700, Quincey Morris said: >On May 19, 2011, at 13:56, Sean McBride wrote: > >>> Would it be correct to restate it >>> like this… >>> >>> "In most cases, although you can allocate instances of these classes on >>> any thread, each instance must receive messages only

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
No, only fade out (and fade in) effects are needed. I just added frame movement to see if animation works at all. Animation does work, but the fade does not happen - no matter, if the frame is moved simultaneously or not. 2011/5/20 Gustavo Pizano : > So you want to move an object then fade it out

Re: The simplest way to fade out a view

2011-05-19 Thread Gustavo Pizano
So you want to move an object then fade it out right? AFAIK NSViewAnimation its for simply animations, triggering other animations after a previous one has completed may not work with this. What about using CABasicAnimation instead and call the delegate methods when it stops to trigger the fa

Re: "Use them from only one thread at a time"

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 13:56, Sean McBride wrote: >> Would it be correct to restate it >> like this… >> >> "In most cases, although you can allocate instances of these classes on >> any thread, each instance must receive messages only from the thread >> which allocated it." > > I believe so. I d

Re: "Use them from only one thread at a time"

2011-05-19 Thread Stephen J. Butler
On Thu, May 19, 2011 at 3:56 PM, Sean McBride wrote: > On Thu, 19 May 2011 13:22:32 -0700, Jerry Krinock said: > >>"Thread-Unsafe Classes.  The following classes and functions are >>generally not thread-safe. In most cases, you can use these classes from >>any thread as long as you use them from o

Re: The simplest way to fade out a view

2011-05-19 Thread Chase Latta
What about using a timer. Something like this: - (IBAction)fadeOut:(id)sender; { [[NSAnimationContext currentContext] setDuration:5.0]; [[self.myView animator] setAlphaValue:0.0]; [NSTimer scheduledTimerWithTimeInterval:5.0 target:self selector:@selector(toggleMyViewState:) userInfo:n

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
I only added this "NSViewAnimationEndFrameKey" just to make sure that any animation happens at all. Yeah it does  happen. But the button just does not fade out - with or without this NSViewAnimationEndFrameKey. It waits for 5.0 seconds (as i specified) and suddenly disappear. It just feels like i r

Re: "Use them from only one thread at a time"

2011-05-19 Thread Sean McBride
On Thu, 19 May 2011 13:22:32 -0700, Jerry Krinock said: >"Thread-Unsafe Classes. The following classes and functions are >generally not thread-safe. In most cases, you can use these classes from >any thread as long as you use them from only one thread at a time." > >I'm confused by the second sen

Re: The simplest way to fade out a view

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 13:14, Nick wrote: > Weirdly enough, this does not work: > NSLog(@"started"); > NSViewAnimation *viewAnimation = [[NSViewAnimation alloc] > initWithViewAnimations: > > [NSArray arrayWithObjects

Re: -[NSWindow orderOut:] vs. -[NSWindow performClose:]

2011-05-19 Thread Kyle Sluder
On Thu, May 19, 2011 at 1:34 PM, Jeff Johnson wrote: > Wouldn't you want to tie a notification to the OK action rather than to the > window closing? I don't know if you have a Cancel too, but if so, you > wouldn't want that to bring the window forward. I'm using the window closing notification

Re: -[NSWindow orderOut:] vs. -[NSWindow performClose:]

2011-05-19 Thread Jeff Johnson
On May 18, 2011, at 1:35 PM, Kyle Sluder wrote: > On Wed, May 18, 2011 at 11:24 AM, Jeff Johnson > wrote: >> On May 17, 2011, at 9:37 PM, Kyle Sluder wrote: >> >>> When the panel is summoned, I want the panel to remember the >>> "document" window on whose toolbar item the user clicked, or none i

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
Well since that didn't work, I guess the way to go is to use CoreAnimation layers. Now the achievement is to figure out how to fade out a view with "small blood" possible :-) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post adm

Re: "Use them from only one thread at a time"

2011-05-19 Thread Jeff Kelley
While that’s true for some classes (NSManagedObjectContext springs to mind) I think a more general way to say it would be “In most cases, although you can allocate instances of these classes on any thread, refrain from messaging an instance from more than one thread simultaneously.” Jeff Kelley

"Use them from only one thread at a time"

2011-05-19 Thread Jerry Krinock
From the Apple's "Threading Programming Guide"… "Thread-Unsafe Classes. The following classes and functions are generally not thread-safe. In most cases, you can use these classes from any thread as long as you use them from only one thread at a time." I'm confused by the second sentence. Wou

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
Weirdly enough, this does not work: NSLog(@"started"); NSViewAnimation *viewAnimation = [[NSViewAnimation alloc] initWithViewAnimations: [NSArray arrayWithObjects:

Re: The simplest way to fade out a view

2011-05-19 Thread Gustavo Pizano
funny, I can't say it has happened to me as I always use CAAnimation . On May 19, 2011, at 9:27 PM, Quincey Morris wrote: > On May 19, 2011, at 11:22, Gustavo Pizano wrote: > >> Why will it be a bug?, a fade-in animation goes form 0 to 1 alpha, so at the >> start point the alpha value must 0 n

Re: The simplest way to fade out a view

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 11:22, Gustavo Pizano wrote: > Why will it be a bug?, a fade-in animation goes form 0 to 1 alpha, so at the > start point the alpha value must 0 no? What actually happens in Snow Leopard (IIRC -- it was a few weeks ago that I was using NSViewAnimation) is that the view fades

Re: The simplest way to fade out a view

2011-05-19 Thread Gustavo Pizano
Why will it be a bug?, a fade-in animation goes form 0 to 1 alpha, so at the start point the alpha value must 0 no? On May 19, 2011, at 7:31 PM, Quincey Morris wrote: > On May 19, 2011, at 05:26, Nick wrote: > >> Could you please advice me what would be the best way to "fade out" >> and "fade

Re: I'm given a project.pbxproj file....

2011-05-19 Thread R4EE
Thanks Kyle On May 18, 4:48 pm, Kyle Sluder wrote: > On Wed, May 18, 2011 at 3:31 PM, R4EE wrote: > > A very large THANK YOU to all that took the time to help.  I'm a > > beginner and just discovered the svn command in terminal.  That did > > the trick! > > You will do yourself a great service t

Re: The simplest way to fade out a view

2011-05-19 Thread Quincey Morris
On May 19, 2011, at 05:26, Nick wrote: > Could you please advice me what would be the best way to "fade out" > and "fade in" a view? I tried using [[myView automator] > setAlphaValue:0.0] but after fading out it does not disappear. I need > it to "hide" after it fades out, i.e. a user can't click

Re: The simplest way to fade out a view

2011-05-19 Thread Gustavo Pizano
sorry putting again on the list, you could always ask the animator proxy to do the sutff the only thing you neeed to set is to tell the NSView to accept layers to YES then [[[myview] animator] setAlpha:0.0]; that will fade it . On May 19, 2011, at 7:04 PM, Mikkel Islay wrote: > >>> Yes,

Re: The simplest way to fade out a view

2011-05-19 Thread Mikkel Islay
>> Yes, that's what i want to do, but how to find out when the animation ends? > > Check out that -animationDidStop:finished: delegate method for CAAnimation. Indeed. > I haven't really followed developments on OS X closely, so I welcome > other list members setting me straight, but AFAIK the b

Re: The simplest way to fade out a view

2011-05-19 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 5/19/11 9:45 AM, Nick wrote: > I haven't noticed that all the examples you gave me were about iPhone. > I forgot to mention that i am writing an Mac OS X application.. > > >> How about removing it from its superview after the animation ends? >> >>

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
I haven't noticed that all the examples you gave me were about iPhone. I forgot to mention that i am writing an Mac OS X application.. > How about removing it from its superview after the animation ends? > > Mikkel > > Yes, that's what i want to do, but how to find out when the animation ends? _

Re: iOS: multiple view controllers, one nib?

2011-05-19 Thread Nathan Sims
On May 18, 2011, at 9:12 PM, Shawn Erickson wrote: > initWithNibName:bundle: instantiates a unique object graph from the > objects serialized in the xib each time it is called. This object > graph is connected with the files owner as defined in your xib. I > assume the QuadNViewController class h

Re: The simplest way to fade out a view

2011-05-19 Thread Nick
2011/5/19 Andy Lee : > On May 19, 2011, at 8:26 AM, Nick wrote: >> hello! >> Could you please advice me what would be the best way to "fade out" >> and "fade in" a view? I tried using [[myView automator] > > Do you mean [myView animator]? yes, of course, sorry for mistyping it > >> setAlphaValue:

Re: Installing application on a network onto several computers

2011-05-19 Thread Nick
Thanks for the answers ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription:

Re: How to disable menu item?

2011-05-19 Thread Nick Zitzmann
On May 19, 2011, at 9:05 AM, Vyacheslav Karamov wrote: > Hi all! > > How to disable menu or menu item programmatically? Nick Zitzmann

How to disable menu item?

2011-05-19 Thread Vyacheslav Karamov
Hi all! How to disable menu or menu item programmatically? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
That did it! Thank you! [newItem setKeyEquivalentModifierMask:SRCarbonToCocoaFlags(256)]; On 19.05.2011, at 15:45, Andy Lee wrote: > On May 19, 2011, at 9:24 AM, Martin Batholdy wrote: >> However >> [newItem setKeyEquivalentModifierMask:modifierMask]; >> has no effect / doesn't work. > > I w

Re: The simplest way to fade out a view

2011-05-19 Thread Andy Lee
On May 19, 2011, at 8:26 AM, Nick wrote: > hello! > Could you please advice me what would be the best way to "fade out" > and "fade in" a view? I tried using [[myView automator] Do you mean [myView animator]? > setAlphaValue:0.0] but after fading out it does not disappear. I need > it to "hide" a

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Andy Lee
On May 19, 2011, at 9:24 AM, Martin Batholdy wrote: > However > [newItem setKeyEquivalentModifierMask:modifierMask]; > has no effect / doesn't work. I wonder if ShortcutRecorder stores Carbon masks instead of Cocoa masks. Maybe try converting with SRCarbonToCocoaFlags()? --Andy _

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
> Haven't tried this, but looking at the functions in SRCommon I'd try > something like: > > NSString *keyString = SRStringForKeyCode(18); > NSUInteger modifierMask = 256; > NSMenuItem *myMenuItem = [[[NSMenuItem alloc] initWithTitle:@"My Menu Item" >

Installing application on a network onto several computers

2011-05-19 Thread Nick
Hi I am wondering if Mac OS has any facilities that simplify installing of an application onto several machines in a network? Either programmatically or using scripts. Say, i have 100 mac computers in a class and one teachers computer. Would it be possible to install one application from the teach

Re: set keyEquivalent for an NSMenuItem

2011-05-19 Thread Andy Lee
On May 19, 2011, at 8:42 AM, Martin Batholdy wrote: > Hi, > > I use the ShortcutRecorder framework in order to let the user define a > shortcut for a given action. > > The ShortcutRecorder framework saves the shortcut into the preference plist > in the following form: > > keyCode: 18 > modifi

set keyEquivalent for an NSMenuItem

2011-05-19 Thread Martin Batholdy
Hi, I use the ShortcutRecorder framework in order to let the user define a shortcut for a given action. The ShortcutRecorder framework saves the shortcut into the preference plist in the following form: keyCode: 18 modifiers: 256 (for CMD +1) Now I would like to use this information from the

The simplest way to fade out a view

2011-05-19 Thread Nick
hello! Could you please advice me what would be the best way to "fade out" and "fade in" a view? I tried using [[myView automator] setAlphaValue:0.0] but after fading out it does not disappear. I need it to "hide" after it fades out, i.e. a user can't click on its buttons. [[myView automator] setV

Re: XML Resource Release

2011-05-19 Thread Jeffrey Walton
On Wed, May 18, 2011 at 2:16 PM, Ken Thomases wrote: > On May 18, 2011, at 12:55 PM, Bing Li wrote: > >>        NSXMLElement *root = [NSXMLNode elementWithName:"MessageRoot"]; > > As per Cocoa's memory management conventions, you don't not own the object > returned by -[NSXMLNode elementWithName:

Looking for iPhone App developers

2011-05-19 Thread Ellen Chou
I'm looking for an experienced iPhone developer for 6 months. Location - San Jose, CA Recruiters are not welcomed. Please reply if you are interested. Thanks. Ellen ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ