Re: NSNull and @""

2008-10-11 Thread Andrew Farmer
On 10 Oct 08, at 19:28, Ian Joyner wrote: So it's really a workaround for this situation. I think therefore there are several constructs to represent the same concept of "lack of presence" – nil, Nil, Null, and NSNull. Fewer than you think, actually. nil, Nil, and NULL are all internally s

Setting Minimum and Maximum width of Toolbar items

2008-10-11 Thread John Joyce
I've noticed that in IB 3, the Minimum and Maximum width of Toolbar items does not stick. You can enter it, command+S to save and then click done, and everything reverts back to 96px wide. One can only presume this is a bug or I don't know something. Do these things need to be set programmatic

Re: NSNull and @""

2008-10-11 Thread Chris Idou
--- On Fri, 10/10/08, Ian Joyner <[EMAIL PROTECTED]> wrote: > I'll have to think more about this. I'm not sure > that KVO can't be > done in a type-safe manner. I guess KVO can be done in a type safe manner, but not with the interesting way that objective-c does it. i.e. it can synthesize all

RE: Setting Minimum and Maximum width of Toolbar items

2008-10-11 Thread John Joyce
Never mind. I have found the solution. The "Document" window in IB 3 must be in list view. In List, expand the tree of disclosure triangles from Toolbar Toolbar > Toolbar Item (name if any) With the Toolbar Item highlighted in List View, it is possible to get the sizing to stick in IB 3's Inspe

Re: inconsistent float behaviour

2008-10-11 Thread Steven Hamilton
On 11/10/2008, at 11:59 AM, Kyle Sluder wrote: On Fri, Oct 10, 2008 at 9:58 PM, Kyle Sluder <[EMAIL PROTECTED]> wrote: This article It would help if I provided the link. http://www.setfiremedia.com/blog/7-top-tips-for-coding-with-currency Thanks Kyle. I didn't realise floating point were s

Re: NSTableView and drag and drop

2008-10-11 Thread Chris Idou
I'm confused by all the examples and documentation. From what I read, the minimum required for a table to be a drag source is to implement outlineView:writeItems:toPasteboard:. However this method is something to do with datasources, and as I understand it, when you use NSArrayControllers and

NSSet primitive methods

2008-10-11 Thread Glen Low
Hi All I want to subclass the class cluster of NSSet. The documentation for the class clusters NSArray/NSMutableArray and NSDictionary/NSMutableDictionary clearly shows what the primitive methods are, so you only need to reimplement these for the subclass to work e.g. NSArray's primitive

Re: NSNull and @""

2008-10-11 Thread Michael Ash
On Sat, Oct 11, 2008 at 5:51 AM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > On 10 Oct 08, at 19:28, Ian Joyner wrote: >> >> So it's really a workaround for this situation. I think therefore there >> are several constructs to represent the same concept of "lack of presence" – >> nil, Nil, Null, and

Re: NSSet primitive methods

2008-10-11 Thread Michael Ash
On Sat, Oct 11, 2008 at 10:15 AM, Glen Low <[EMAIL PROTECTED]> wrote: > Hi All > > I want to subclass the class cluster of NSSet. > > The documentation for the class clusters NSArray/NSMutableArray and > NSDictionary/NSMutableDictionary clearly shows what the primitive methods > are, so you only ne

Re: NSSet primitive methods

2008-10-11 Thread Mike Abdullah
Can I enquire as to why you wish to subclass it? On 11 Oct 2008, at 15:15, Glen Low wrote: Hi All I want to subclass the class cluster of NSSet. The documentation for the class clusters NSArray/NSMutableArray and NSDictionary/NSMutableDictionary clearly shows what the primitive methods ar

Re: inconsistent float behaviour

2008-10-11 Thread Steven Hamilton
Thanks guys, I'm still unsure why I'm getting 4 decimal places as I know for fact that the data is 2 decimal places. However, it seems my approach is wrong. I'll convert to int's and NSDecimalNumbers instead and remove all floats. On 11/10/2008, at 4:14 AM, Uli Kusterer wrote: On 10.10.2

Re: NSTableView and drag and drop

2008-10-11 Thread chaitanya pandit
Well, for table view there is a similar method that you need to implement in your delegate: - (BOOL)tableView:(NSTableView *)aTableView writeRowsWithIndexes: (NSIndexSet *)rowIndexes toPasteboard:(NSPasteboard *)pboard To allow dragging in a table view, you need to provide information as to

creating a printer

2008-10-11 Thread Torsten Curdt
Hey! I would like install/setup a new CUPS printer from Cocoa. Looking at http://developer.apple.com/documentation/Cocoa/Conceptual/Printing/Tasks/CreatingPrinters.html#/ /apple_ref/doc/uid/2870-120579 http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPrinter

Re: Strategy for naming support folder

2008-10-11 Thread Paul Bruneau
On Oct 10, 2008, at 3:31 AM, Graham Cox <[EMAIL PROTECTED]> wrote: Why is anyone poking around in there? (Not a rhetorical question, I'm interested in knowing what people do visit that folder for) Since you ask, in my one-user, non-document-based scheduling app, I keep the data file in ther

drawing centered text in a box

2008-10-11 Thread James W. Walker
When using the NSString or NSAttributedString methods for drawing text in a box, such as -[NSAttributedString drawWithRect:options:], is there any way to make the lines of text horizontally centered? smime.p7s Description: S/MIME cryptographic signature

Can I use tool tips with images?

2008-10-11 Thread Ulf Dunkel
I would like to show tool tips for an image which is used in a text ruler representation, like shown here: http://man.icalamus.net/en/img/doc/sample_frame_convertedToText.gif I talk about the image in the upper right corner of the text ruler which shows tabulator options. Users miss tool tips

Re: drawing centered text in a box

2008-10-11 Thread Ricky Sharp
On Oct 11, 2008, at 11:27 AM, James W. Walker wrote: When using the NSString or NSAttributedString methods for drawing text in a box, such as -[NSAttributedString drawWithRect:options:], is there any way to make the lines of text horizontally centered? Yes. Create a dictionary with a key

File icons shown upside down in the Open Recent menu

2008-10-11 Thread Ulf Dunkel
I wonder what I could have done wrong that all document and folder icons which are automatically remembered and shown in our app's Open Recent menu are shown upside down. As we didn't change anything related with openDocument: and don't manipulate the Open Recent menu ourselves, I have no idea

Matrix of Controls

2008-10-11 Thread Richard Somers
I need to implement a matrix of toolbar item like controls. Each control has an image with a text label below it. .-- .|| .| Image | .|| .-- . Label I am trying to figure out the best way to do this. NSMatrix on

Re: Matrix of Controls

2008-10-11 Thread Kyle Sluder
On Sat, Oct 11, 2008 at 1:39 PM, Richard Somers <[EMAIL PROTECTED]> wrote: > NSMatrix only works with single cell objects. Is it possible to display text > and an image inside a single cell? NSButtonCell. --Kyle sluder ___ Cocoa-dev mailing list (Cocoa

Re: NSNull and @""

2008-10-11 Thread Seth Willits
On Oct 11, 2008, at 4:51 AM, Stelian Iancu wrote: Hmm, that's weird. In some official iPhone examples from Apple, they do exactly that: they put nil as the last element in an array. So what's up with that? If it's what I think you're talking about then: No, nil is used as a marker for th

Re: NSNull and @""

2008-10-11 Thread Kyle Sluder
On Sat, Oct 11, 2008 at 1:57 PM, Seth Willits <[EMAIL PROTECTED]> wrote: > If it's what I think you're talking about then: No, nil is used as a marker > for the variable argument list to say "this is the end of the list." It's > not actually inserted into the dictionary at all. Why it's required is

Re: NSCoding protocol

2008-10-11 Thread Michael Ash
On Fri, Oct 10, 2008 at 12:52 PM, Negm-Awad Amin <[EMAIL PROTECTED]> wrote: > Yup, you are complelty right. The correct code: > > if( [BaseClass [EMAIL PROTECTED]( initIWithCoder: )] ) { > … If you want to get really fun, you can check it thus: if([super.class instancesRespondToSelector:...]) Th

Re: NSNull and @""

2008-10-11 Thread Michael Ash
On Sat, Oct 11, 2008 at 1:57 PM, Seth Willits <[EMAIL PROTECTED]> wrote: > If it's what I think you're talking about then: No, nil is used as a marker > for the variable argument list to say "this is the end of the list." It's > not actually inserted into the dictionary at all. Why it's required is

Re: Can I use tool tips with images?

2008-10-11 Thread Charles Steinman
--- On Sat, 10/11/08, Ulf Dunkel <[EMAIL PROTECTED]> wrote: > I would like to show tool tips for an image which is used in > a text > ruler representation, like shown here: > > http://man.icalamus.net/en/img/doc/sample_frame_convertedToText.gif NSViews handle tooltips. See the documentation for

Searching a CoreData bound NSArrayController

2008-10-11 Thread Paul Thomas
Hi All, I need a little advice on the "right way" to do something: I have an array controller bound to a core data store and the objects are presented in a table view. When it comes to inserting, I need to check that one of the properties specified by the user is unique before doing anyth

Re: NSNull and @""

2008-10-11 Thread Stelian Iancu
On Sat, Oct 11, 2008 at 2:58 AM, Seth Willits <[EMAIL PROTECTED]> wrote: > On Oct 10, 2008, at 5:40 PM, Ian Joyner wrote: > > I'm just trying to work out what NSNull really is in the Cocoa context. Is >> it an object in Cocoa? >> > > > As I said, yes. It's truly an object. (A singleton, as well.)

Re: Invoking 'a Paste' Programmatically

2008-10-11 Thread Peter Maurer
I have global HotKey registered using Carbon, and this HotKey invokes a method in which I'm replacing the contents of the general Pasteboard. [...] I'm wondering if there is a way to programmatically call 'Paste', or if there are any facilities in Cocoa for simulating key presses? Actuall

Re: Searching a CoreData bound NSArrayController

2008-10-11 Thread chaitanya pandit
I had a similar problem actually, I read on the list somewhere that creating a NSFetchRequest for finding something in the MOC can get slower if you have a lot of objects in your MOC(few thousand), and in such case using an array controller 's array and using predicate to filter it's content

CATextLayers text alignment?

2008-10-11 Thread David Hoerl
I'm using a CATextLayer to display some text which the user can change the font size of. When the user changes the font size, I still want my text to be centered, both vertically and horizontally. As far as I know you can only set the the CATextLayers alignmentMode to kCAAlignmentCenter to get

Re: CATextLayers text alignment? [SOLVED]

2008-10-11 Thread Tim Andersson
11 okt 2008 kl. 22.34 skrev David Hoerl: I'm using a CATextLayer to display some text which the user can change the font size of. When the user changes the font size, I still want my text to be centered, both vertically and horizontally. As far as I know you can only set the the CATextLaye

Re: Matrix of Controls

2008-10-11 Thread Richard Somers
On Oct 11, 2008, at 11:53AM, Kyle Sluder wrote: NSButtonCell Bingo, that's it! Right there under my nose. Thank you. Richard ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the li

Re: drawing centered text in a box

2008-10-11 Thread James W. Walker
On Oct 11, 2008, at 10:00 AM, Ricky Sharp wrote: On Oct 11, 2008, at 11:27 AM, James W. Walker wrote: When using the NSString or NSAttributedString methods for drawing text in a box, such as -[NSAttributedString drawWithRect:options:], is there any way to make the lines of text horizontal

Re: NSNull and @""

2008-10-11 Thread Seth Willits
On Oct 11, 2008, at 11:47 AM, Michael Ash wrote: On Sat, Oct 11, 2008 at 1:57 PM, Seth Willits <[EMAIL PROTECTED]> wrote: If it's what I think you're talking about then: No, nil is used as a marker for the variable argument list to say "this is the end of the list." It's not actually insert

NSURLConnection question

2008-10-11 Thread John Zorko
Hello, all ... I want to alter how often NSURLConnection calls receivedData -- or rather, I want it to call it more often (even with fewer bytes) vs less often (with loads and loads of bytes). Can I do this with NSURLConnection or some other CF class, rather than have to go down to POSI

CIAnnotation Sample

2008-10-11 Thread M Pulis
Folks, Working with the CIAnnotation Sample code. It wants to open a file of my choice, except the only files it seems to want are png files and then crashes on any png file I try. Looking at the code, it appears to accept any image file, but, I am so new to cocoa that I am likely not rea

Instruments leaks.

2008-10-11 Thread Sandro Noel
Greetings. I'm in the optimizing phase of my little project and I'm trying to understand instruments to get most of the leeks out of my software. but instruments throws tons of leaked blocks for objects that should be auto-released, and objects that are still in use. how do I determine what

Re: Add animation layer and then remove animation layer

2008-10-11 Thread Matt Long
Hey Steve, Your call to setWantsLayer won't take effect until the next run loop. So here is what happens (I think). - First call to changeRightView: - turns on layer backing for next run loop - adds the animation (transition) for next run loop - sets the delegate for t

Re: Instruments leaks.

2008-10-11 Thread j o a r
On Oct 11, 2008, at 7:58 PM, Sandro Noel wrote: I'm in the optimizing phase of my little project and I'm trying to understand instruments to get most of the leeks out of my software. but instruments throws tons of leaked blocks for objects that should be auto-released, and objects that are

Re: NSNull and @""

2008-10-11 Thread Sean McBride
On 10/10/08 5:58 PM, Seth Willits said: >You can't stick nil into dictionaries and arrays. So either you stick >an empty string, an NSNumber with 0, etc if those are OK, or you can >use NSNull. Or you can use NSPointerArray (on 10.5+). -- _

Re: Instruments leaks.

2008-10-11 Thread Sandro Noel
most of the leeks are created by NSString's from functions i gathered off the net. assignations like var1 = [var1 message]; This created a leek because the string being replaced is never released. or am I wrong. On 11-Oct-08, at 11:12 PM, j o a r wrote: On Oct 11, 2008, at 7:58 PM, Sandro

Re: Instruments leaks.

2008-10-11 Thread j o a r
On Oct 11, 2008, at 8:45 PM, Sandro Noel wrote: most of the leeks are created by NSString's from functions i gathered off the net. assignations like var1 = [var1 message]; This created a leek because the string being replaced is never released. or am I wrong. You need to provide a bi

Re: NSURLConnection question

2008-10-11 Thread Michael Ash
On Sat, Oct 11, 2008 at 7:07 PM, John Zorko <[EMAIL PROTECTED]> wrote: > > Hello, all ... > > I want to alter how often NSURLConnection calls receivedData -- or rather, I > want it to call it more often (even with fewer bytes) vs less often (with > loads and loads of bytes). Can I do this with NSU

Re: Instruments leaks.

2008-10-11 Thread Sandro Noel
for instance, the leek tells me that i have a leek here in this functions. it is a NSString categorie. - (NSString *) trimWhiteSpace { NSMutableString *s = [[self mutableCopy] autorelease]; CFStringTrimWhitespace ((CFMutableStringRef) s); return (NSSt

Re: NSTableView and drag and drop

2008-10-11 Thread Chris Idou
The thing is, I've done all that and no drags are initiated when I drag on the items. I have this in my tableview delegate: But tableView:writeRowsWithIndexes:toPasteboard: is never even called. It seems to me that the examples have this code in the datasource or something rather than the dele

Re: NSNull and @""

2008-10-11 Thread Bill Bumgarner
On Oct 11, 2008, at 3:26 PM, Seth Willits wrote: Note that nowhere in there is there anything related to how many arguments there are, or what type they are. Ahh. I guess I mis-remembered varargs. I thought they did have a count. I'm You can tell how often I've had to use it ;-) Nope --yo

Re: NSTableView and drag and drop

2008-10-11 Thread Graham Cox
On 12 Oct 2008, at 3:33 pm, Chris Idou wrote: The thing is, I've done all that and no drags are initiated when I drag on the items. I have this in my tableview delegate: But tableView:writeRowsWithIndexes:toPasteboard: is never even called. It seems to me that the examples have this code

Re: Instruments leaks.

2008-10-11 Thread j o a r
On Oct 11, 2008, at 9:31 PM, Sandro Noel wrote: for instance, the leek tells me that i have a leek here in this functions. So this is actually not really true. What leaks will initially tell you is where the leaked object was created. That's not the same thing as where that object was l

Re: NSURLConnection question

2008-10-11 Thread Roland King
I don't think it actually does send it as fast as it can, I've been using it for some of my stuff and I typically get one data callback only with the whole document in it. I just checked the thing I'm working on again and it got about 15K in one shot, that was everything. I don't see any wa