Re: problem bringing up print dialog for epson printer in 64-bit mode

2011-05-20 Thread Nick Zitzmann
On May 20, 2011, at 4:41 PM, Ken Victor wrote: > the following problem only occurs when i run my app in 64-bit mode; i.e., it > does not happen when i run in 32-bit mode. my environment is snow leopard > 10.6.7 running on a mac pro. > > when i call: > -[NSPrintPanel > beginSheetWithPrin

Re: The simplest way to fade out a view

2011-05-20 Thread Gustavo Pizano
u r welcome. On May 20, 2011, at 11:50 PM, Nick wrote: > Great that did the trick :-) > Thanks, Gustavo > > 2011/5/21 Gustavo Pizano > >> Hello nick. >> >> Try putting the fromValue also, I had some problems also with the blink, >> but right now I can't think of what I did to solve it, too mu

problem bringing up print dialog for epson printer in 64-bit mode

2011-05-20 Thread Ken Victor
the following problem only occurs when i run my app in 64-bit mode; i.e., it does not happen when i run in 32-bit mode. my environment is snow leopard 10.6.7 running on a mac pro. when i call: -[NSPrintPanel beginSheetWithPrintInfo:modalForWindow:delegate:didEndSelector:contextInfo:] i

Re: Fire-and-forget controllers with blocks

2011-05-20 Thread Ken Thomases
On May 20, 2011, at 9:10 AM, Dave Zarzycki wrote: > One could naively and wrongly "fix" this by decoupling the init method: > > controller = [[MyImportController alloc] init]; >// "controller" is now non-nil and safe to capture > [controller setCleanupBlock: ^{ [controller rel

Re: "About" menu item is greyed out.

2011-05-20 Thread Graham Cox
On 21/05/2011, at 8:20 AM, JAMES ROGERS wrote: > IB Inspector indicates the item is enabled. But when I build and run the app, > it is greyed out. > I am new to cocoa development and have no idea where to look other than IB. Is the menu item connected to an action? The default action should be

"About" menu item is greayed out.

2011-05-20 Thread JAMES ROGERS
IB Inspector indicates the item is enabled. But when I build and run the app, it is greyed out. I am new to cocoa development and have no idea where to look other than IB. JIM ROGERS jimrogers_w4...@me.com http://web.me.com/jimrogers_w4atk ___ Cocoa-

Re: The simplest way to fade out a view

2011-05-20 Thread Gustavo Pizano
Nick try to put the fillMode property of the animation also something like alphaAnimation.fillMode = kCAFillModeForwards; and removeOnCompletion to NO; no matter what key you put when adding the animation to the layer, the imprtant is the key you use when creating the animation, so "opacity"

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
Great that did the trick :-) Thanks, Gustavo 2011/5/21 Gustavo Pizano > Hello nick. > > Try putting the fromValue also, I had some problems also with the blink, > but right now I can't think of what I did to solve it, too much wine!!! :P > > maybe put the remove on competition to NO. :S > > > >

Re: The simplest way to fade out a view

2011-05-20 Thread Gustavo Pizano
Hello nick. Try putting the fromValue also, I had some problems also with the blink, but right now I can't think of what I did to solve it, too much wine!!! :P maybe put the remove on competition to NO. :S On May 20, 2011, at 10:21 PM, Nick wrote: > Chase, > thank you for your responses. >

Re: NSDatePicker, selecting elements, and field editors

2011-05-20 Thread Philip Dow
On May 20, 2011, at 3:27 PM, Nick Zitzmann wrote: > That's how to _set_ date picker elements, not _select_ them. > > Anyway, I did figure out how to do this. Apparently the only way to > programmatically select a date picker element is to use private > NSDatePickerCell methods, but to unselect

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
My view is "backed layered" - the checkbox "Needs CA Layer" is selected for both the main view of the window, and for this theView. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the li

Re: NSDatePicker, selecting elements, and field editors

2011-05-20 Thread Nick Zitzmann
On May 20, 2011, at 2:21 PM, Howard Siegel wrote: > 2. How do I select and unselect date picker elements programmatically? > > setDatePickerElements: > > Sets a bitmask that indicates which visual elements of the date picker are > currently shown, and which won't be usable because they are hid

Re: NSDatePicker, selecting elements, and field editors

2011-05-20 Thread Howard Siegel
On Fri, May 20, 2011 at 11:51, Nick Zitzmann wrote: > I read TFM and searched TFW, and could not find answers to two questions I > have about NSDatePicker: > > > > 2. How do I select and unselect date picker elements programmatically? > setDatePickerElements: Sets a bitmask that indicates

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
Chase, thank you for your responses. I actually tested both your code and the code of Gustavo. For me the result was the same - the opacity changes back to 1.0 when the animation had finished and then i hide it, which still causes blinking... Before the animation starts, i need to set the opacity

Re: XML Resource Release

2011-05-20 Thread Bing Li
Dear Gary, The Help of Xcode says the returned C string is automatically freed just as a returned object would be released. That means I don't need to release or autorelease xmlStr? Thanks, Bing On Sat, May 21, 2011 at 3:28 AM, Gary L. Wade wrote: > In your Xcode text window, hold down the opti

Re: Can't create temporary file

2011-05-20 Thread Quincey Morris
On May 20, 2011, at 12:44, Sean McBride wrote: > They appear to have already thought about it, as NSFileManager.h says: Given the pervasiveness with which NSURL-based methods were planted across the entire API landscape, I think it was pretty easy to conclude that the NSFileManager-based API di

Re: Can't create temporary file

2011-05-20 Thread Sean McBride
On Thu, 19 May 2011 22:43:06 -0700, Joar Wingfors said: >> [[NSData data] writeToURL: myURL options: 0 error: &error]; > > >Or: > > [[NSFileManager defaultManager] createFileAtPath: path contents: nil >attributes: nil]; > >...but yeah, it doesn't take an URL, and it doesn't return an er

Re: The simplest way to fade out a view

2011-05-20 Thread Chase Latta
Did you try making that change in your code? If yes, is your view layer backed? I work mainly on iOS so I could be missing something but the code worked without blinking for me on 10.6. What is happening, as I think I understand it, is that by setting the opacity of your view's layer to 0.

Re: XML Resource Release

2011-05-20 Thread Gary L. Wade
In your Xcode text window, hold down the option key and double click on NSString. You will be given the option of viewing an overview of the class. Click on the icon in the upper right side of the window that looks like a book. This will show you a view of the documentation for NSString. When l

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
Chase, the animation itself worked and works - either with your code or with Gustavo's. But after the animation finishes, the opaqueness of the view again becomes 1.0 again. Then the "animationDidStop" gets called and the view disappears. But before disappearing, it annoyingly blinks (so, the opaq

Re: The simplest way to fade out a view

2011-05-20 Thread Chase Latta
> How could i force the animation to actually change the alpha value > from 1.0 to 0.0 and make it stay 0.0 unless i change it back? Change your code to look like this: CABasicAnimation * alphaAnimation = ... ... [[theView layer] setOpacity:0.0]; // Set your opacity here [[theView laye

Re: XML Resource Release

2011-05-20 Thread Bing Li
Dear Evadne and all, I appreciate so much for your replies! You change the return value from (const char *) to (NSString *). In my system, since I need to send the XML to a server via BSD socket. I have to convert it to (const char *). But I got another problem. If autoreleasing xmlStr or releas

NSDatePicker, selecting elements, and field editors

2011-05-20 Thread Nick Zitzmann
I read TFM and searched TFW, and could not find answers to two questions I have about NSDatePicker: 1. Is it possible to make NSDatePicker use a custom field editor, and if so, then how? My NSWindow delegate already returns one in its -windowWillReturnFieldEditor:... method, and I can confirm t

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
Gustavo, thanks for the response. Unfortunately, this idea makes the view to blink.. The view fades away, but then when alpha reaches 0.0 it becomes 1.0 (and the view becomes opaque again for a little while) and after that the view becomes hidden as that callback is being called. I tried setting "

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

2011-05-20 Thread Jerry Krinock
Thank you all. On 2011 May 19, at 15:52, Greg Parker wrote: > You should file a bug report Bug ID# 9476726 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the modera

Re: Incremental parsing/highlighting in an NSTextView via shouldChangeTextInRange delegate method

2011-05-20 Thread Ross Carter
On May 19, 2011, at 1:23 PM, Martin Schürrer wrote: > 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 strin

Re: Fire-and-forget controllers with blocks

2011-05-20 Thread Ben
On 20 May 2011, at 15:10, Dave Zarzycki wrote: > On May 20, 2011, at 5:48 AM, Ben wrote: > >> MyImportController *controller = nil; >> CleanupBlock cleanup = ^{ >> [controller release]; >> // Other stuff >> }; >> controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup

Re: [NSLock dealloc] Exception

2011-05-20 Thread Bing Li
Dear Nick and all, Thanks so much for your replies! I have got the reason of the exception. When sending a message successfully, SendMessage is returned without unlocking. The structure, try/catch/finally, is a good solution to the potential problem. Best regards, Bing On Fri, May 20, 2011 at

Re: Thumbnail view like iPhone Photos app

2011-05-20 Thread Matt Neuburg
On Tue, 17 May 2011 20:35:58 +0800, Leon Qiao said: >Dear all, > >I used to ask one question about NSCache. Actually, I need to build a view >like the 'Photos' application. >Now it works, but need to be improved: the speed of dragging, loading images >is not good enough. >Please give me some gener

Re: Fire-and-forget controllers with blocks

2011-05-20 Thread Kyle Sluder
On Fri, May 20, 2011 at 5:48 AM, Ben wrote: > controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup copy] > autorelease]]; Nitpick: the caller of -initWithCleanupBlock: should not be responsible for the memory management of the block. Rather, -initWithCleanupBlock: should copy

Re: [NSLock dealloc] Exception

2011-05-20 Thread Nick Zitzmann
On May 20, 2011, at 9:11 AM, Bing Li wrote: > Dear all, > > I am implementing a TCP client to send messages with BSD sockets. A BOOL > variable, isConnected, is used to detect if the TCP connection is built. > Since the client must be accessed by multiple threads, a NSLock, > isConnectedLock is

Re: [NSLock dealloc] Exception

2011-05-20 Thread Charles Srstka
On May 20, 2011, at 10:11 AM, Bing Li wrote: > Dear all, > > I am implementing a TCP client to send messages with BSD sockets. A BOOL > variable, isConnected, is used to detect if the TCP connection is built. > Since the client must be accessed by multiple threads, a NSLock, > isConnectedLock is

[NSLock dealloc] Exception

2011-05-20 Thread Bing Li
Dear all, I am implementing a TCP client to send messages with BSD sockets. A BOOL variable, isConnected, is used to detect if the TCP connection is built. Since the client must be accessed by multiple threads, a NSLock, isConnectedLock is used. When testing, after invoking the methods, Connect a

Re: The simplest way to fade out a view

2011-05-20 Thread Gustavo Pizano
CAAnimation isn't that complicated. CABasicAnimation * alphaAnimation = [CABasicAnimation animationWithKeyPath:@"opacity"]; alphaAnimation.delgate = self; alphaAnimation.removedOnCompletition = YES; alphaAnimation.autoreverses = NO; alphaAnimation.timingFunction = [CAMediaTimingFunction functi

Re: XML Resource Release

2011-05-20 Thread Bing Li
Dear Jeff and all, I appreciate so much for your help! After reading the document from apple.com, I changed my code as follows. It must be fine. Best regards, Bing + (const char *) CreateSignInMessage: (NSString *)peerKey PN: (NSString *)peerName PW:(NSString *)password { NSXMLElement *r

Re: Fire-and-forget controllers with blocks

2011-05-20 Thread Dave Zarzycki
On May 20, 2011, at 5:48 AM, Ben wrote: > MyImportController *controller = nil; > CleanupBlock cleanup = ^{ > [controller release]; > // Other stuff > }; > controller = [[MyImportController alloc] initWithCleanupBlock:[[cleanup copy] > autorelease]]; > [controller start]; > // The con

Fire-and-forget controllers with blocks

2011-05-20 Thread Ben
Hi list, I've been tidying up a codebase which can now make use of block-based APIs and all is working quite nicely. However, in several places I have controllers which I want to setup and launch and then clean up when they're done. What I used to do was like this: - (void)startImport {

Re: Why RunLoop?

2011-05-20 Thread Zajkowski, James
On May 17, 2011, at 12:54 PM, Bing Li wrote: > So I think RunLoop can be replaced. Do you think so? Without trying to offend, your questions sound like you're trying to write Java in Objective-C. I suggest you go with the way Cocoa does things on Cocoa platforms rather than trying to force a d

Re: The simplest way to fade out a view

2011-05-20 Thread Nick
This sample works exactly as mine - the button remains on the screen completely opaque and the suddenly disappears after 0.25 secs pass. (Snow Leopard) So i guess unless i find time to read that huge guide about Core Animation and manage to adapt CAAnimation, i will use that approach with [[myview

Re: Why RunLoop?

2011-05-20 Thread Uli Kusterer
On 17.05.2011, at 21:12, Wim Lewis wrote: > On 17 May 2011, at 9:54 AM, Bing Li wrote: >> But I noticed that Cocoa threading provides wait/pulse-like synchronization >> techniques, such as Condition. I believe these techniques can be used to >> control a thread which has a while-true loop. So I thi

Cocoa Touch (iPhone/iPad): List of notifications?

2011-05-20 Thread Jeffrey Walton
Hi All, I have an application with UIFileSharingEnabled. If the device is tethered, a user can use iTunes (or other programs) to drop new files or delete existing files. I would like to detect the changes. Is there a 'directory change' (or similar) notification? 'Notification Programming Topics'