Re: How to count composed characters in NSString?

2008-09-28 Thread Clark S. Cox III
Sent from my iPhone On Sep 28, 2008, at 21:52, Michael Gardner <[EMAIL PROTECTED]> wrote: On Sep 28, 2008, at 1:17 PM, David Niemeijer wrote: Michael, On 28 sep 2008, at 14:41, Michael Gardner wrote: Upon further investigation, I may be wrong. I based my assertion upon Apple's NSString d

Re: How to count composed characters in NSString?

2008-09-28 Thread Michael Gardner
On Sep 28, 2008, at 1:17 PM, David Niemeijer wrote: Michael, On 28 sep 2008, at 14:41, Michael Gardner wrote: Upon further investigation, I may be wrong. I based my assertion upon Apple's NSString documentation ("Returns the number of Unicode characters in the receiver"), and upon some quic

[ann] MacCode code repository Release 1

2008-09-28 Thread Chris Forsythe
Hi folks, I would like to announce the first release of MacCode. MacCode is a shared source repository, the goal is to get as much sample code and projects into a single location as possible. Read more about the MacCodeproject and download the first release here: http://code.google.com/p

Re: [NSCFNumber intValue]: unrecognized selector

2008-09-28 Thread Steve Rossi
On Sep 26, 2008, at 11:12 PM, Clark Cox wrote: On Fri, Sep 26, 2008 at 8:57 PM, <[EMAIL PROTECTED]> wrote: On Sep 26, 2008, at 11:22 AM, j o a r wrote: On Sep 25, 2008, at 6:22 AM, Steve Rossi wrote: I've deduced that he crash seems to be something timing related which occurs only at a

Re: How to count composed characters in NSString?

2008-09-28 Thread Peter Edberg
On Sep 28, 2008, at 3:05 PM, Peter Edberg wrote: David, Check out CFStringGetRangeOfComposedCharactersAtIndex. It finds the kinds of text boundaries that I think you are interested in. You would just need to iterate over the string calling this for each iteration to find the next boundar

NSTokenField Drag and Drop

2008-09-28 Thread Chris Idou
I've got two NSTokenFields. One is read-only as a palette for dragging and dropping to the other. I've implemented a "Token" class to distinguish between tokens and plain text (NSString). I can pass in arrays of mixed Tokens and NSStrings, and it all displays correctly in both fields. However,

Re: How to count composed characters in NSString?

2008-09-28 Thread Peter Edberg
On Sep 28, 2008, at 12:02 PM, [EMAIL PROTECTED] wrote: -- Message: 1 Date: Sun, 28 Sep 2008 20:17:26 +0200 From: David Niemeijer <[EMAIL PROTECTED]> Subject: Re: How to count composed characters in NSString? To: Cocoa-Dev List

Re: Restoring a .nib's Edit menu

2008-09-28 Thread Tommy Nordgren
On Sep 28, 2008, at 3:32 PM, Matt wrote: I should add that I currently have all the menu items connected, the only ones I can't seem to get working are the Find Next, and Find Previous, and Use Selection For Find. The standard Edit menu in a new .nib does not show any default action for th

Re: How to count composed characters in NSString?

2008-09-28 Thread Kirk Kerekes
Users don't see characters, they see glyphs. If you want your count to maximally agree with user perception, you need to be counting glyphs, not characters. See NSLayoutManager, esp: - (NSRange)glyphRangeForCharacterRange:(NSRange)charRange -- and friends. If you are showing strin

Re: How to count composed characters in NSString?

2008-09-28 Thread Kyle Sluder
On Sun, Sep 28, 2008 at 2:17 PM, David Niemeijer <[EMAIL PROTECTED]> wrote: > I need to be able to display the number of characters to the user in a way > that makes sense to them. If they see 3 I should report 3. I also need it to > cut-off certain input to the number of "real" characters and shou

Re: How to count composed characters in NSString?

2008-09-28 Thread David Niemeijer
Michael, On 28 sep 2008, at 14:41, Michael Gardner wrote: Upon further investigation, I may be wrong. I based my assertion upon Apple's NSString documentation ("Returns the number of Unicode characters in the receiver"), and upon some quick tests I ran. But this reply made me look into the

Re: showing window causes EXC_BAD_ACCESS

2008-09-28 Thread Michael Ash
On Sun, Sep 28, 2008 at 11:01 AM, Scott Ribe <[EMAIL PROTECTED]> wrote: >> Except that in every case I've seen of people getting bit by this, the >> window was still being implicitly retained by the nib's File's Owner. >> You should definitely *not* expect a top-level nib object to go away >> until

Re: How to count composed characters in NSString?

2008-09-28 Thread Michael Ash
On Sat, Sep 27, 2008 at 3:23 PM, David Niemeijer <[EMAIL PROTECTED]> wrote: > Hi, > > I have been trying to find this in the documentation and list archives but > without success so far. What is the best way to count the number of > characters in an NSString taking account of the fact that some cha

Re: Cocoa and "Reveal in Finder..."

2008-09-28 Thread Waqar Malik
[[NSWorkspace sharedWorkspace] selectFile:path inFileViewerRootedAtPath:nil]; On Sep 28, 2008, at 8:30 AM, John Cebasek wrote: Hi All: I've got a couple of functions that do a "Reveal in Finder" that are in Carbon land, and sit on top of the "More..." library. Since quite a few of the

Re: CIPageCurlTransition and starting corner

2008-09-28 Thread douglas welton
HI, To set the angle of this transition, set the input parameter for "inputAngle". As the documentation says, this value may vary between pi (3.14159-ish) and -pi. the value of pi * 3/4 will get you want... later, douglas On Sep 28, 2008, at 10:14 AM, Brad Peterson wrote: Hi all, I'v

Cocoa and "Reveal in Finder..."

2008-09-28 Thread John Cebasek
Hi All: I've got a couple of functions that do a "Reveal in Finder" that are in Carbon land, and sit on top of the "More..." library. Since quite a few of the functions in the "More" library have been marked as deprecated, I'm wondering if there is a Cocoa-sentric way of performing a 'rev

Re: showing window causes EXC_BAD_ACCESS

2008-09-28 Thread Scott Ribe
> Except that in every case I've seen of people getting bit by this, the > window was still being implicitly retained by the nib's File's Owner. > You should definitely *not* expect a top-level nib object to go away > until File's Owner releases it. Sure. The design intent here is that File's Owne

Re: Need to override +(Class) class?

2008-09-28 Thread Dave DeLong
I have a good reason to not be able to do this. InputElements are cross-platform, but InputViews only exist on one platform. As such, the frameworks required to build InputViews will not always be available to the InputElement class. I could get around it, I suppose, if I put in compiler

CIPageCurlTransition and starting corner

2008-09-28 Thread Brad Peterson
Hi all, I've been through the archives, and done quite a bit of playing around with the sample code, too, but I can't figure out how to change CIPageCurlTransition's starting corner. In all of the stuff I've seen so far, the page curl always starts in the upper left corner, which seems somehow

Re: Restoring a .nib's Edit menu

2008-09-28 Thread Matt
I should add that I currently have all the menu items connected, the only ones I can't seem to get working are the Find Next, and Find Previous, and Use Selection For Find. The standard Edit menu in a new .nib does not show any default action for these items. I also tried replacing this submenu wit

Re: How to count composed characters in NSString?

2008-09-28 Thread Michael Gardner
On Sep 28, 2008, at 5:53 AM, Gerriet M. Denkmann wrote: On Sun, 28 Sep 2008 03:27:48 -0500, Michael Gardner <[EMAIL PROTECTED] > wrote: On Sep 27, 2008, at 2:23 PM, David Niemeijer wrote: Hi, I have been trying to find this in the documentation and list archives but without success so far

Re: Need to override +(Class) class?

2008-09-28 Thread John C. Randolph
On Sep 27, 2008, at 7:38 PM, Dave DeLong wrote: My question is, do I need to override the +(Class) class method for each InputElement subclass, and if so how do I make a Class object? The only situations I can think of where you might want to do that is if you're writing some kind of a pro

Restoring a .nib's Edit menu

2008-09-28 Thread Matt
I apologize that this isn't a direct Cocoa question but I'm in a bit of jam here and am desperate for any help. My edit menu was removed accidentally from my app's main nib file. In IB3 I dragged a new Edit menu into the menu bar, but nothing on it is working. I can make some of the items work by d

Re: design pattern for data acquisition in background thread?

2008-09-28 Thread John C. Randolph
On Sep 27, 2008, at 8:10 PM, Joe Keenan wrote: On Sep 27, 2008, at 4:25 PM, Chris Hanson wrote: On Sep 26, 2008, at 3:37 PM, Joe Keenan wrote: Right now, the app controller object sends a message to the device controller, requesting the value of a specified variable. The device contro

Re: How to count composed characters in NSString?

2008-09-28 Thread Gerriet M. Denkmann
On Sun, 28 Sep 2008 03:27:48 -0500, Michael Gardner <[EMAIL PROTECTED]> wrote: On Sep 27, 2008, at 2:23 PM, David Niemeijer wrote: Hi, I have been trying to find this in the documentation and list archives but without success so far. What is the best way to count the number of characters i

Re: Need to override +(Class) class?

2008-09-28 Thread Stuart Rogers
On 28 Sep 2008, at 10:02, Dave DeLong wrote: I'm building an app, and I've got a bunch of interface object definitions called "InputElements". There are a couple subclasses, such as InputElementButton and InputElementSlider. I'm building the interface via an "InputMode" object, that contains a

Making NSTableView column headers editable

2008-09-28 Thread Andrew BusH
Hi all, What is the best approach to do this? I would like the user to be able to double click on the header cell of a NSTableView and have a field appear in place that would let them change the heading. Ive tried just setting [[NSTableColumn headercell setEditable:YES] when I create the

Re: How to count composed characters in NSString?

2008-09-28 Thread Michael Gardner
On Sep 27, 2008, at 2:23 PM, David Niemeijer wrote: Hi, I have been trying to find this in the documentation and list archives but without success so far. What is the best way to count the number of characters in an NSString taking account of the fact that some characters may take up mult

Re: How to get the current screen resolution on Mac

2008-09-28 Thread Kyle Sluder
2008/9/27 Andrew Farmer <[EMAIL PROTECTED]>: > NSScreen gives you this functionality, but it's even easier to just have > [NSWindow center] do the job for > you. Just be aware that -center doesn't actually put the window in the center of the screen. Vertically, the window is placed about 1/3 of t