Update of Typography panel

2012-01-26 Thread Martin Huber
Hi, I am trying to support the Typography panel (available through the Fonts panel). I can get the user settings by implementing -changeAttributes: in the first responder. But if i set a new active font with [[NSFontManager sharedFontManager] setSelectedFont:isMultiple:], an already opened

Re: Bindings crash

2012-01-26 Thread Arved von Brasch
Hi list, This is the error I'm seeing: 2012-01-26 07:54:20.418 FileExplorer[1338:707] NSScanner: nil string argument 2012-01-26 07:54:20.420 FileExplorer[1338:707] NSScanner: nil string argument 2012-01-26 07:54:20.421 FileExplorer[1338:707] NSScanner: nil string argument 2012-01-26

Re: Bindings crash

2012-01-26 Thread Ken Thomases
On Jan 26, 2012, at 4:12 AM, Arved von Brasch wrote: - (NSString *)usedSpace { NSDictionary *systemInfo = [[NSFileManager defaultManager] attributesOfFileSystemForPath: [[NSBundle mainBundle] bundlePath] error: nil]; NSDecimalNumber *total = [NSDecimalNumber

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Todd Freese
The problem seems to be with the embedded alpha channel in the TIF. It is always using the alpha when you try to do anything with the file. Is there an easy way to avoid this? In my case, I need the full image without the alpha. Currently, if you open the TIF and display it, it will only show

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Todd Freese
This might be a bug in the framework. Preview has the same problem with any TIF file with an alpha channel in it. t On Jan 25, 2012, at 9:54 PM, Ken Ferry wrote: NSImage handles everything CGImage does, and this includes CMYK. NSImage loads bitmaps with ImageIO, which is what you'd do at

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Todd Freese
Sorry for all the emails…. This only seems to appear with CMYK TIF files. If anyone has a workaround I would greatly appreciate it. I am really in the bind over this one. Todd On Jan 25, 2012, at 9:54 PM, Ken Ferry wrote: NSImage handles everything CGImage does, and this includes CMYK.

Atta Boys, 4 bags-full

2012-01-26 Thread John Love
The purpose of this document is to give thunderous applause to some very patient folk. But, before I crank up the volume, I would like to share with you a small amount of history. I am within a week of finishing my Universal app, Love Song to America whose purpose is to support all our

Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Andrew
I would like to perform the same logic as the New Terminal Tab at Folder service in Finder in my Cocoa app. The only code I found via Google is all using AppleScript to open the Terminal.app, but nothing I found was a Cocoa interface besides 3rd party terminal apps (iTerm, iTerm2). Is there a

Re: Atta Boys, 4 bags-full

2012-01-26 Thread Hunter Hillegas
Glad you were able to solve your problems but it sounds like you were going to the wrong places for help. It's really not the job of App Review to explain how to use the tools, or to recommend a specific vendor's third party solution… Sounds like you found the forums though, which are perfect

Re: Bindings crash

2012-01-26 Thread Arved von Brasch
Thanks very much for your response. You pointed me in the right direction. On 26/01/2012, at 3:23 PM, Ken Thomases wrote: First, why are you using strings to convert to NSDecimalNumber? Ask the NSNumber for its decimalValue and then use +[NSDecimalNumber decimalNumberWithDecimal:]. That

Re: Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Andrew
Well, I found this: http://code.google.com/p/cdto/source/browse/plugins/terminal/CD2Terminal.m?spec=svn20c4d028f197a6810230ddff969de81c4b23876dr=20c4d028f197a6810230ddff969de81c4b23876d And got the terminal opening in a new window at the path. So I now need to find how I can set the settings and

Re: Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Andrew
Well, I figured it out for myself. Posting here in case anyone else wants to do the same: - (void)openTerminal:(id)sender { TerminalApplication* termApp = [SBApplication applicationWithBundleIdentifier:@com.apple.terminal]; NSString *dir = // Get your directory here NSString *cmd =

Re: Atta Boys, 4 bags-full

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 9:12 AM, John Love wrote: In addition, I tried and tried to get an App Store rep to tell me how to de-pixelate all my images (one of their complaints leading to rejection). Give me the name of a specific piece of software and I'll try to use it (praying that it wasn't

Re: Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 9:13 AM, Andrew wrote: The only code I found via Google is all using AppleScript to open the Terminal.app, but nothing I found was a Cocoa interface besides 3rd party terminal apps (iTerm, iTerm2). Is there a better way than using NSAppleScript to do this? Not that I’m

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 8:25 AM, Todd Freese wrote: The problem seems to be with the embedded alpha channel in the TIF. It is always using the alpha when you try to do anything with the file. Is there an easy way to avoid this? In my case, I need the full image without the alpha. Isn’t it the

Re: boundingRectWithSize problem?

2012-01-26 Thread Tim Schröder
I had exactly the same problem and solved it by using the NSStringDrawingUsesDeviceMetrics option instead of NSStringDrawingDisableScreenFontSubstitution. Tim Am 25.01.2012 um 16:26 schrieb Tony Pollard: Hi folks, I'm having a strange problem with NSAttributedString boundingRectWithSize

Intermittent IKImageBrowserView crash

2012-01-26 Thread Jeffrey J. Early
I have an intermittent crasher that appears to be associated with IKImageBrowserView, but I have been unable to find a technique to get to the source of the problem. I have a dozen crash reports from the last month from beta testers of PhotoLinker, which now uses ARC. The crash reports all

Re: Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 10:22 AM, Andrew wrote: NSString *cmd = [NSString stringWithFormat:@cd \%@\; clear”, dir]; // Assumes bash, which is okay for me, but maybe not others. Watch out — that line has quoting problems. If the path to the directory contains double-quotes, dollar signs,

- (NSPoint)convertBaseToScreen:(NSPoint)point

2012-01-26 Thread koko
The docs say that - (NSPoint)convertBaseToScreen:(NSPoint)point is deprecated and to use - (NSRect)convertRectToScreen:(NSRect)aRect So, does one create a rect whose origin is the point in question and whose size is zero? So here is some code: NSWindow *keyWindow = [NSApp keyWindow];

Re: - (NSPoint)convertBaseToScreen:(NSPoint)point

2012-01-26 Thread Kyle Sluder
On Thu, Jan 26, 2012 at 11:41 AM, koko k...@highrolls.net wrote: The docs say that - (NSPoint)convertBaseToScreen:(NSPoint)point is deprecated and to use - (NSRect)convertRectToScreen:(NSRect)aRect So, does one create a rect whose origin is the point in question and whose size is zero?

ARC and blocks

2012-01-26 Thread Jan E. Schotsman
Hello, This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ... myController.completionHandler = ^(NSInteger result) { [myController

Re: - (NSPoint)convertBaseToScreen:(NSPoint)point

2012-01-26 Thread koko
I did not read far enough … not using 10.7 SDK is my problem. I will take Kyle's suggestion to file a Radar for NSWindow convertPoint (to, from) Screen -koko On Jan 26, 2012, at 2:43 PM, Marco S Hyman wrote: On Jan 26, 2012, at 11:41 AM, koko wrote: But -convertRectToScreen ins in

Re: Open a new terminal tab or window from a Cocoa app at a certain directory without using NSAppleScript?

2012-01-26 Thread Jean-Daniel Dupas
Le 26 janv. 2012 à 20:30, Jens Alfke a écrit : On Jan 26, 2012, at 10:22 AM, Andrew wrote: NSString *cmd = [NSString stringWithFormat:@cd \%@\; clear”, dir]; // Assumes bash, which is okay for me, but maybe not others. Watch out — that line has quoting problems. If the path to the

Re: ARC and blocks

2012-01-26 Thread David Duncan
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote: Hello, This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ...

Re: ARC and blocks

2012-01-26 Thread Jean-Daniel Dupas
Le 26 janv. 2012 à 22:51, Jan E. Schotsman a écrit : Hello, This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ...

Re: ARC and blocks

2012-01-26 Thread Conrad Shultz
On 1/26/12 1:51 PM, Jan E. Schotsman wrote: Hello, This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ... myController.completionHandler =

Re: ARC and blocks

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote: Supposedly this avoids a retain cycle. But where is the cycle? At least two objects are needed for a cycle. What is the second one? The block. When a block is copied (which it has to be, in order to be called later after the calling

Re: ARC and blocks

2012-01-26 Thread Fritz Anderson
On 26 Jan 2012, at 3:51 PM, Jan E. Schotsman wrote: This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; There is a MyViewController object named

Re: ARC and blocks

2012-01-26 Thread Marco Tabini
On 2012-01-26, at 3:51 PM, Jan E. Schotsman wrote: Hello, This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ...

Re: ARC and blocks

2012-01-26 Thread Ken Thomases
On Jan 26, 2012, at 3:51 PM, Jan E. Schotsman wrote: This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ... myController.completionHandler =

Re: ARC and blocks

2012-01-26 Thread Greg Parker
On Jan 26, 2012, at 1:51 PM, Jan E. Schotsman wrote: This code is given in the Transitioning to ARC Release Notes as an example of accomodating blocks in an ARC environment: __block MyViewController *myController = [[MyViewController alloc] init…]; // ... myController.completionHandler =

Re: ARC and blocks

2012-01-26 Thread Jeff Kelley
Without ARC, you would use __block to prevent the block from retaining the object and causing the retain cycle. With ARC, however, the object is retained when you put it into the variable, so to avoid a retain cycle, you have to declare it like so: __unsafe_unretained __block

Re: ARC and blocks

2012-01-26 Thread David Duncan
On Jan 26, 2012, at 2:44 PM, Conrad Shultz wrote: However, __block variables are NOT retained automatically by a block during capture, so this breaks the retain cycle. This is not true under ARC, where __block variables also retain. -- David Duncan

Re: ARC and blocks

2012-01-26 Thread Kyle Sluder
On Thu, Jan 26, 2012 at 2:44 PM, Conrad Shultz con...@synthetiqsolutions.com wrote: However, __block variables are NOT retained automatically by a block during capture, so this breaks the retain cycle. __block variables *are* retained under ARC:

Re: ARC and blocks

2012-01-26 Thread Conrad Shultz
On 1/26/12 4:21 PM, Kyle Sluder wrote: On Thu, Jan 26, 2012 at 2:44 PM, Conrad Shultz con...@synthetiqsolutions.com wrote: However, __block variables are NOT retained automatically by a block during capture, so this breaks the retain cycle. __block variables *are* retained under ARC:

Full-Height Toolbar Item

2012-01-26 Thread Mark Alldritt
Hi Everyone, I'm looking for a way to make a view-based Toolbar Item that occupies the full height of the toolbar (i.e. including the space normally reserved for the toolbar item's label). Xcode 4 does this for its status display, and I have a similar need in my application. The NSToolbar

Re: ARC and blocks

2012-01-26 Thread Abdul Sowayan
Hi, So, when myController is nil'ed out, ARC releases it, and it releases the block in turn. No leaks/abandoned memory. A special form of this is the idiom: __block id mySelf = self; ^{ [mySelf doSomething]; } Wouldn't using __weak instead of __block be better and clearer in the

Re: ARC and blocks

2012-01-26 Thread Roland King
On Jan 27, 2012, at 6:44 AM, Conrad Shultz wrote: On 1/26/12 1:51 PM, Jan E. Schotsman wrote: The block normally would retain variables it captures from its scope, including, in this case, myController. Presumably myController would retain the completionHandler block, ergo a retain

Binding Leak - Turn off Raises For Not Applicable Keys

2012-01-26 Thread Seth Willits
Very simple setup in a test project. I have an array controller with content bound to App Delegate's objects array, and I have a slider control bound to the controller's selection.value. I set App Delegate's objects array to an array with an NSString in it. So the NSString *does not respond*

Re: ARC and blocks

2012-01-26 Thread Marco Tabini
On 2012-01-26, at 6:09 PM, Jeff Kelley wrote: Without ARC, you would use __block to prevent the block from retaining the object and causing the retain cycle. With ARC, however, the object is retained when you put it into the variable, so to avoid a retain cycle, you have to declare it like

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Todd Freese
The issue is that it only loads the pixels that are allowed by the alpha. Almost no graphic program does this. It should load all the pixels and give you the option of using the alpha if needed. Another words, there is no way to just get the full image. From my research, the original TIFF spec

Binding Leak - Turn off Raises For Not Applicable Keys

2012-01-26 Thread Seth Willits
Very simple setup in a test project. I have an array controller with content bound to App Delegate's objects array, and I have a slider control bound to the controller's selection.value. I set App Delegate's objects array to an array with an NSString in it. So the NSString *does not respond*

Re: ARC and blocks

2012-01-26 Thread Greg Parker
On Jan 26, 2012, at 6:04 PM, Marco Tabini wrote: On 2012-01-26, at 6:09 PM, Jeff Kelley wrote: Without ARC, you would use __block to prevent the block from retaining the object and causing the retain cycle. With ARC, however, the object is retained when you put it into the variable, so to

Re: ARC and blocks

2012-01-26 Thread Roland King
On Jan 27, 2012, at 10:04 AM, Marco Tabini wrote: On 2012-01-26, at 6:09 PM, Jeff Kelley wrote: Without ARC, you would use __block to prevent the block from retaining the object and causing the retain cycle. With ARC, however, the object is retained when you put it into the variable, so

Re: ARC and blocks

2012-01-26 Thread Jeff Kelley
On Jan 26, 2012, at 10:45 PM, Roland King wrote: On Jan 27, 2012, at 10:04 AM, Marco Tabini wrote: On 2012-01-26, at 6:09 PM, Jeff Kelley wrote: Without ARC, you would use __block to prevent the block from retaining the object and causing the retain cycle. With ARC, however, the object

afterDelay not working?

2012-01-26 Thread GW Rodriguez
I have a simple NSView class that is an indicator light that I want to flash.   Here are the two methods to perform the flash: -(void) performFlash {     if (ledOn) return;          ledOn = YES;     [selfsetNeedsDisplay:YES];     [selfperformSelector:@selector(endFlash)

Re: How to open CMYK TIF in Cocoa?

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 6:21 PM, Todd Freese wrote: The issue is that it only loads the pixels that are allowed by the alpha. Almost no graphic program does this. It should load all the pixels and give you the option of using the alpha if needed. Another words, there is no way to just get the

Re: afterDelay not working?

2012-01-26 Thread Jens Alfke
On Jan 26, 2012, at 8:56 PM, GW Rodriguez wrote: For some reason the afterDelay method isn't working. I know my simple methods work because when I call endFlash independently it works just fine. I have tried every permutation of the afterDelay method, I tried putting it in the delegate

Re: afterDelay not working?

2012-01-26 Thread GW Rodriguez
Correct, it's not on a different thread. That's why I'm so confused as to why it's not working. :-/ GW Rodriguez Audio Technician South Coast Repertory (c) 909-720-4202 www.gwrodriguez.com On Jan 26, 2012, at 9:12 PM, Jens Alfke j...@mooseyard.com wrote: On Jan 26, 2012, at 8:56 PM, GW

Re: afterDelay not working?

2012-01-26 Thread Dave Keck
I imagine your run loop isn't being allowed to run in the default mode (NSDefaultRunLoopMode). I'd check this by pausing your program at the time that you would expect -endFlash to be called; your stack trace will might indicate that the run loop's being run recursively. Perhaps this occurring