Re: NSXML and invalid UTF8 characters

2010-01-29 Thread Keith Blount
Many thanks for the explanation and clarification, much appreciated. What's the best way of making the comparison in this situation, then, where the value returned by -characterAtIndex: is 16bit but the unicode character codes I want to check for are 24bit? I'm guessing it's not just as simple a

ABNewPersonViewController and ABPersonViewController background color

2010-01-29 Thread Angelica Grace Tanchico
Hello, Is it possible to change ABNewPersonViewController and ABPersonViewController background color instead of default grey-stripe background? How? Thanks in advance! Regards, Angie

Re: IKImageBrowserView drop operation always highlighting a specific row

2010-01-29 Thread Thomas Goossens
There is no such method on 10.5 so in your case you would have to do everything at the NSView level by implementing the NSDraggingDestination protocol. So basically you'd have to - subclass the IKImageBrowserView - implement the needed methods from NSDraggingDestination (draggingEntered, dragging

Re: IKImageBrowserView drop operation always highlighting a specific row

2010-01-29 Thread Tobias Jordan
Hey Thomas, Didn't notice it was you, remember - the problem I had with my IKImageBrowserView and dragging files out of it? Thanks again for your help! I'm going to subclass my view now and see if I can get it to work. If so I'll post my solution here of course in case someone finds it usef

Re: Hot to define a connection from source code?

2010-01-29 Thread B.J. Buchalter
On Jan 29, 2010, at 12:17 AM, Jonathan Chacón wrote: Hello Roland, Could you tell me any example project where I examine the source code? The Apple Sample "BubbleLevel" is almost entirely configured in code; there is just one main window nib that gets the whole thing running, and I suspe

Re: IKImageBrowserView drop operation always highlighting a specific row

2010-01-29 Thread Tobias Jordan
Thomas, it's working now, easier than I thought: - (NSDragOperation)draggingUpdated:(id < NSDraggingInfo >)sender { [self setNeedsDisplay:YES]; if ([sender draggingSource] == self) return [super draggingEntered:sender]; return NSDragOperationCopy; } Thanks

Detect HFS path type and coerce to POSIX

2010-01-29 Thread jonat...@mugginsoft.com
My app receives both HFS and POSIX NSString file paths back from AppleScript. On the AS Implementors list I was advised to coerce all the AS data to say HFS before it is converted to an NSString. This will be my goal but in the short term I will need to detect HFS paths and convert them to POSI

should I use CALayer .. ?

2010-01-29 Thread Roland King
I'm failing to understand I think exactly what CALayer gives me and thus whether or not it's good for something I'm working on. I've read the documentation pretty thoroughly I think but I'm not getting it. Target here is IPhone OS, which may matter. Concept is a view with a number of 'objects'

Re: should I use CALayer .. ?

2010-01-29 Thread Mike Abdullah
CALayer is almost certainly what you want, and a good book on Core Animation will do you wonders. On 29 Jan 2010, at 11:05, Roland King wrote: > I'm failing to understand I think exactly what CALayer gives me and thus > whether or not it's good for something I'm working on. I've read the > doc

Re: NSKeyValueBindingCreation Leak

2010-01-29 Thread Quincey Morris
On Jan 28, 2010, at 21:15, Richard Somers wrote: > As I understand it, exposing the binding relates to exposing the binding to > Interface Builder. Since I am not using Interface Builder exposing the > binding is a non-issue. It's not entirely clear. The NSKeyValueBindingCreation informal proto

Re: NSXML and invalid UTF8 characters

2010-01-29 Thread Keith Blount
Hi Jens, Many thanks again for the help. Sorry I wasn't clearer about what I meant when I said "invalid UTF8" - I was using it in the context of XML, but should have made that more explicit. Also, I owe you an apology as I had completely missed NSMutableCharacterSet's -addCharactersInRange:, wh

Re: NSBundle unloading crash

2010-01-29 Thread Jonathan Guy
Thanks Greg. It was indeed a category issue but I seem to have fixed one problem and found another. If I load the first bundle, make a method call, then immediately unload, load the second bundle and make the same function call (all in the same event) I end up crashing when the autoreleas pool g

FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Chris Idou
I'm trying to use the file system events api, but what I'm seeing seems wierd. Firstly, the documentation as I read it says you can store the last event id, and pass that to FSEventStreamCreate next time to carry on where you left off. However what I'm seeing if I do that, is it immediately re

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Graham Cox
Well, I have no experience of this API, but perhaps it's designed to do this so that when you restart a stream, you get an event that gives you a snapshot or starting point for the new session. Seems to me it would be trivial to compare the event ID and if it's the one you just passed in, ignor

Re: should I use CALayer .. ?

2010-01-29 Thread Roland King
Thanks, if that is the right tech I'll buy the book. Click kindle for iPhone, click buy books, search, sample, reading 120 seconds later. Life is simple!!! On 29-Jan-2010, at 19:23, Mike Abdullah wrote: CALayer is almost certainly what you want, and a good book on Core Animation will

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Graham Cox
I also note this in the documentation: "FSEventStreamGetLatestEventId() -> Initially, this returns the sinceWhen value supplied when the stream was created; thereafter, it is updated with the highest-numbered event ID mentioned in the current batch of events just before invoking the client's ca

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Chris Idou
Firstly, I don't think that actually makes sense, given the whole point of the lastEventId. Secondly, it only does it for the first folder you pass in, so it isn't even consistent. But yes I guess one could compare and ignore. From: Graham Cox To: Chris Id

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Chris Idou
No, I'm not using FSEventStreamCreateRelativeToDevice, I'm using FSEventStreamCreate. What you quote is only relevant to FSEventStreamCreateRelativeToDevice. From: Graham Cox To: Chris Idou Cc: cocoa-dev@lists.apple.com Sent: Fri, 29 January, 2010 11:33:40

Re: Node hierarchy with subclasses

2010-01-29 Thread Jerry Krinock
On 2010 Jan 28, at 23:55, BareFeet wrote: > The problem is that when a subclass A is selected, the UI elements bound to > subclass B no longer have valid bindings so generate an error. How can I > solve this? In your tab view's delegate, implement tabView:willSelectTabViewItem:, and in it, in

Re: Hot to define a connection from source code?

2010-01-29 Thread Jonathan Chacón
Hello, thanks for the information I'll download bubbleLevel sample code and I'll study it thanks and regards Jonathan Chacón El 29/01/2010, a las 11:23, B.J. Buchalter escribió: > > On Jan 29, 2010, at 12:17 AM, Jonathan Chacón wrote: > >> Hello Roland, >> >> Could you tell me any e

Want notification that Document will Close

2010-01-29 Thread Jerry Krinock
I want a notification that a document will close in order to do clean-up such as: 1. Clear my intra-app copy/drag collections of any items in the closing doc. 2. Unbind temporary bindings which I had bound in code. 3. Cancel NSURLConnections which may send messages to the doc. I've been using

Re: Fuzzy Focus Ring

2010-01-29 Thread Charles Jenkins
Thanks! You guys are the best! I expect this to work great: I'll try it out this weekend. I have come to the conclusion that the best way to enable keyboard control is to make each control knob a separate NSView so the user will tab from knob to knob. Does that sound right, and does anyone hav

Re: Want notification that Document will Close

2010-01-29 Thread Mike Abdullah
On 29 Jan 2010, at 15:13, Jerry Krinock wrote: > I want a notification that a document will close in order to do clean-up such > as: > > 1. Clear my intra-app copy/drag collections of any items in the closing doc. > 2. Unbind temporary bindings which I had bound in code. Cocoa bindings unbin

Re: NSBundle unloading crash

2010-01-29 Thread Bill Bumgarner
On Jan 29, 2010, at 4:09 AM, Jonathan Guy wrote: > Thanks Greg. It was indeed a category issue but I seem to have fixed one > problem and found another. If I load the first bundle, make a method call, > then immediately unload, load the second bundle and make the same function > call (all in t

Re: [MEET] February CocoaHeads Developer Meetings

2010-01-29 Thread Andy Lee
Sorry, I was late entering the NYC meeting: New York- Thursday, February 11, 2010 18:00. --Andy On Thursday, January 28, 2010, at 10:20PM, "Stephen Zyszkiewicz" wrote: >Greetings, > >CocoaHeads is an international Cocoa programmer's group. Meetings are >free and open to the public. We specia

Re: mouseEntered/-mouseExited not firing on drag (NSTrackingEnabledDuringMouseDrag on)

2010-01-29 Thread K. Darcy Otto
On 28-Jan-10, at 9:13 PM, Jerry Krinock wrote: On 2010 Jan 28, at 16:00, K. Darcy Otto wrote: It is my understanding that the "NSTrackingEnabledDuringMouseDrag" is supposed to allow -mouseEntered/-mouseExited to fire during a drag. Is this not correct? I hope someone who knows the answe

Re: NSXML and invalid UTF8 characters

2010-01-29 Thread Jens Alfke
This code looks good. Just a few possible improvements, in the spirit of code-review: On Jan 29, 2010, at 4:00 AM, Keith Blount wrote: > NSMutableCharacterSet *XMLCharacterSet = > [[NSMutableCharacterSet alloc] init]; Variable names shouldn't start with an uppercase letter — the

Re: Detect HFS path type and coerce to POSIX

2010-01-29 Thread Michael Ash
On Fri, Jan 29, 2010 at 6:03 AM, jonat...@mugginsoft.com wrote: > My app receives both HFS and POSIX NSString file paths back from AppleScript. > > On the AS Implementors list I was advised to coerce all the AS data to say > HFS before it is converted to an NSString. > > This will be my goal but

Re: should I use CALayer .. ?

2010-01-29 Thread Matt Neuburg
On Fri, 29 Jan 2010 19:05:01 +0800, Roland King said: >Do CALayers retain their content so that as they are moved they don't redraw themselves but are just recomposited in a different area of the screen? Yes, more or less exactly. I like to think of a layer as a very powerful pane of glass in fr

Re: Hot to define a connection from source code?

2010-01-29 Thread mmalc Crawford
On Jan 28, 2010, at 9:17 pm, Jonathan Chacón wrote: > Could you tell me any example project where I examine the source code? > If you want to do iPhone development, I suspect the most useful for you will be UICatalog:

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Matt Gough
Are you checking that that first event doesn't have the kFSEventStreamEventFlagHistoryDone flag set? Matt On 29 Jan 2010, at 12:22:38, Chris Idou wrote: > It seems like if you pass an explicit event id into FSEventStreamCreate in > absolutely insists on giving you an immediate callback that so

Re: Hot to define a connection from source code?

2010-01-29 Thread B.J. Buchalter
On Jan 29, 2010, at 1:05 PM, mmalc Crawford wrote: On Jan 28, 2010, at 9:17 pm, Jonathan Chacón wrote: Could you tell me any example project where I examine the source code? If you want to do iPhone development, I suspect the most useful for you will be UICatalog:

determining HTML text encoding

2010-01-29 Thread Rainer Standke
Hello, I have an app that loads a web page into a webView. From that I grab the main frame's html text like so: NSString *htmlString = [[[NSString alloc] initWithData:[[frame dataSource] data] encoding:NSISOLatin1StringEncoding] autorelease]; I am wondering how I could detect the html tex

Re: Hot to define a connection from source code?

2010-01-29 Thread mmalc Crawford
On Jan 29, 2010, at 10:32 am, B.J. Buchalter wrote: > On Jan 29, 2010, at 1:05 PM, mmalc Crawford wrote: >> If you want to do iPhone development, I suspect the most useful for you will >> be UICatalog: >> >> >> [...

Re: Want notification that Document will Close

2010-01-29 Thread Sean McBride
On 1/29/10 7:13 AM, Jerry Krinock said: >I want a notification that a document will close in order to do clean-up >such as: Have you seen: "Advice for Overriders of -[NSDocument close]" -- __

Re: determining HTML text encoding

2010-01-29 Thread Paul Sanders
[WebDataSource textEncodingName]? To learn a little more about what might be driving that, see: http://en.wikipedia.org/wiki/Character_encodings_in_HTML#The_document_character_encoding Not sure if / how you can get hold of the HTTP headers via WebKit though, should you need them. Paul Sanders.

Re: Network Reachability

2010-01-29 Thread Laurent Daudelin
On Jan 28, 2010, at 22:38, Jens Alfke wrote: > > On Jan 28, 2010, at 9:22 PM, Laurent Daudelin wrote: > >> host = CFHostCreateWithName(kCFAllocatorDefault, (CFStringRef)hostName); >> assert(host != NULL); >> >> SCNetworkReachabilityRef target = >> SCNetworkReachabilityCreateWithN

Re: NSXML and invalid UTF8 characters

2010-01-29 Thread Keith Blount
Hi Jens, Thanks again. > Variable names shouldn't start with an uppercase letter — > the convention is to lowercase the entire acronym that > starts a name, so "xmlCharacterSet". I'm aware of that and it's not a habit I'm generally in - a year ago I would always have used "xmlCharacterSet" rath

Re: determining HTML text encoding

2010-01-29 Thread Jens Alfke
On Jan 29, 2010, at 10:46 AM, Rainer Standke wrote: > I have an app that loads a web page into a webView. From that I grab the main > frame's html text like so: > NSString *htmlString = [[[NSString alloc] initWithData:[[frame dataSource] > data] encoding:NSISOLatin1StringEncoding] autorelease];

Re: Network Reachability

2010-01-29 Thread Jens Alfke
On Jan 29, 2010, at 11:12 AM, Laurent Daudelin wrote: > I was able to determined that when the connection is down, I found out that > kSCNetworkFlagsConnectionRequired was true, so it seems to work. It's just > difficult to determine what exactly the flags mean. This can be confusing. Connecti

Re: NSXML and invalid UTF8 characters

2010-01-29 Thread Jens Alfke
On Jan 29, 2010, at 11:16 AM, Keith Blount wrote: > A habit from my fear that the compiler will get even fussier (for instance it > is these days fussier about conditional expressions). The compiler will never complain about that. It's a basic tenet of object-oriented programming that an insta

Indentation bug in NSOutlineView with source-list highlighting?

2010-01-29 Thread Jens Alfke
I've been running into an intermittent bug involving NSOutlineViews with the source-list highlight mode. In some cases the indentation of second-level items is wrong: only a few pixels to the right instead of the specified number (usually 16). You can see a screenshot here; note that the bottom

Re: Indentation bug in NSOutlineView with source-list highlighting?

2010-01-29 Thread Laurent Daudelin
On Jan 29, 2010, at 12:03, Jens Alfke wrote: > I've been running into an intermittent bug involving NSOutlineViews with the > source-list highlight mode. In some cases the indentation of second-level > items is wrong: only a few pixels to the right instead of the specified > number (usually 16)

Re: determining HTML text encoding

2010-01-29 Thread Rainer Standke
That looks interesting. When I try this: NSLog(@"%@", [frame.DOMDocument.characterSet class]); I get an error: request for member 'characterSet' in something not a structure or union I'm on 10.5.8, if that matters. Is there something I should import into this class? What am I missing here?

Re: Want notification that Document will Close

2010-01-29 Thread Jerry Krinock
On 2010 Jan 29, at 07:59, Mike Abdullah wrote: > Cocoa bindings unbind themselves when the observing object is deallocated. > You shouldn't need to do anything special. For your own bindings, it's > probably a good to make them behave similarly. Thanks, Mike. Here we go with that word multi

Re: FSEventStreamCreate and File System Events Wierdness

2010-01-29 Thread Graham Cox
On 30/01/2010, at 12:31 AM, Chris Idou wrote: > No, I'm not using FSEventStreamCreateRelativeToDevice, I'm using > FSEventStreamCreate. What you quote is only relevant to > FSEventStreamCreateRelativeToDevice. > Yes, that's the point. What the documentation appears to be saying is that if yo

Re: Indentation bug in NSOutlineView with source-list highlighting?

2010-01-29 Thread Markus Spoettl
On Jan 29, 2010, at 9:03 PM, Jens Alfke wrote: > I've been running into an intermittent bug involving NSOutlineViews with the > source-list highlight mode. In some cases the indentation of second-level > items is wrong: only a few pixels to the right instead of the specified > number (usually 16

Re: determining HTML text encoding

2010-01-29 Thread Jens Alfke
On Jan 29, 2010, at 12:33 PM, Rainer Standke wrote: > NSLog(@"%@", [frame.DOMDocument.characterSet class]); > I get an error: request for member 'characterSet' in something not a > structure or union You may need to #import the header for DOMDocument. > As far as I can tell I am trying to use

Tabbed windows

2010-01-29 Thread John Nairn
I tried to find a way to do tabbed windows like Safari. Since they appear integrated into the window title bar, I thought they might be part of the NSWindow class, but I don't see anything there. Does one have to create their own class for tabbed windows or is something built in to Cocoa? I

Re: Tabbed windows

2010-01-29 Thread Graham Cox
On 30/01/2010, at 10:40 AM, John Nairn wrote: > Does one have to create their own class for tabbed windows Yes. > or is something built in to Cocoa? No. > Is it possible for non-Apple program to integrate into the tool bar of the > window? Probably, or at least it should be possible to

Re: Tabbed windows

2010-01-29 Thread Rui Pacheco
Google PSMTabBarControl. The first hits go to the original source that's not being maintained but there's a couple of Git repositories with newer versions. On 29 January 2010 23:51, Graham Cox wrote: > > On 30/01/2010, at 10:40 AM, John Nairn wrote: > > > Does one have to create their own class

Returning a nil float?

2010-01-29 Thread Chunk 1978
i'm almost 100% sure it's not possible to return a nil on basic data types, but just incase i'll post the question. -- - (float)panForSoundWithName:(NSString *)soundName { OpenALSound *sound = [soundDictionary objectForKey:soundNa

Re: Returning a nil float?

2010-01-29 Thread Dave DeLong
You can't do that. Instead, return an NSNumber, from which you can deduce that a nil NSNumber is different from an NSNumber with a floatValue of 0.0. Cheers, Dave On Jan 29, 2010, at 5:44 PM, Chunk 1978 wrote: > i'm almost 100% sure it's not possible to return a nil on basic data > types, but

Re: Returning a nil float?

2010-01-29 Thread Dave DeLong
I should clarify. You *can* return nil, but it will be indistinguishable for 0.0f. Dave On Jan 29, 2010, at 5:46 PM, Dave DeLong wrote: > You can't do that. Instead, return an NSNumber, from which you can deduce > that a nil NSNumber is different from an NSNumber with a floatValue of 0.0. >

Re: Returning a nil float?

2010-01-29 Thread Jean-Daniel Dupas
Le 30 janv. 2010 à 01:44, Chunk 1978 a écrit : > i'm almost 100% sure it's not possible to return a nil on basic data > types, but just incase i'll post the question. > > -- > - (float)panForSoundWithName:(NSString *)soundName > { >

Re: Returning a nil float?

2010-01-29 Thread Roland King
I use NAN for things like this. (Not A Number ) if( !sound ) return NAN; and your test would then be if( isnan( sound ) ) return nil; provided you aren't doing any divisions by zero similar things in your code which could cause the value to be NaN, it's a useful marker for "I d

Re: Returning a nil float?

2010-01-29 Thread Greg Guerin
Chunk 1978 wrote: so above i'd like to write "if (!sound) return nil;". my reasoning is because some attributes to a sound object (like pan) are created only when the sound is initialized. if there is no sound object than there should also be no pan value to return. unfortunately, the float d

Loading of Mach-O executable files.

2010-01-29 Thread Richard Penwell
Dear list, I've been toying around with some problems in the world of dynamic code loading... (a vast and mythical place). I understand that there is a fundamental difference between Mach-O executables and Mach-O dynamic libraries (beyond the obvious Mach-O filetype header). I assume it has t

dock tile overlay image

2010-01-29 Thread Felipe Heidrich
Using Carbon I can place overlay images on the application dock tile by calling OverlayApplicationDockTileImage(). Is it possible to do the same using Cocoa ? I read NSDockTile and NSApplication Class Reference and I'm afraid the answer is no. I could use the old carbon API (OverlayApplicationDoc

Working with external drives with Cocoa.

2010-01-29 Thread Wilersh
Is there is a way to work with external drives inside cocoa as you might at the command line with diskutil. Trying to avoid using NSTask (mostly because I want to learn if there is another way to do this), but I need to be able to get information about a drive's size, partition map, and fileys

Re: Returning a nil float?

2010-01-29 Thread Andrew Merenbach
On Jan 29, 2010, at 4:44 PM, Chunk 1978 wrote: > i'm almost 100% sure it's not possible to return a nil on basic data > types, but just incase i'll post the question. > > -- > - (float)panForSoundWithName:(NSString *)soundName > { >

Re: mouseEntered/-mouseExited not firing on drag (NSTrackingEnabledDuringMouseDrag on)

2010-01-29 Thread Jerry Krinock
On 2010 Jan 29, at 08:25, K. Darcy Otto wrote: >> When I had a similar problem I was advised that whatever responds to >> mouseDown: probably begins tracking the mouse, sucking up all the >> NSMouseMoved events, until mouseUp. Try overriding mouseDown: and don't >> invoke super. > > Tried th

bind:toObject:withKeyPath:options: Unidirectional or Bidirectional?

2010-01-29 Thread Jerry Krinock
In "Cocoa Bindings Programming Topics" ▸ "What Are Cocoa Bindings" ▸ "Supporting Technologies", I read: "A binding is established with a bind:toObject:withKeyPath:options: message which tells the receiver to keep its specified attribute synchronized ... with the value of the property..