Re: Trying to open a file

2009-02-17 Thread Christian Graus
Thanks - I actually ended ip using NSData and dataFromFileContents, and that seems to be working fine. I was just going to post to say I'd solved it.. I will look to see what fileURLWithPath returns tho, b/c the string is the same as it was the last time I ran this, but last time it worked ( t

Re: Trying to open a file

2009-02-17 Thread Ron Fleckner
On 18/02/2009, at 5:35 PM, Christian Graus wrote: Hi guys So, I've got a file open dialog, and I have this code: NSString * path = @"file://"; NSString * p = [open filename]; path = [path stringByAppendingString:p ]; NSURL * xmlURL = [[NSURL alloc] initWithString:path ]; NSXMLDocument *doc

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-17 Thread Jeff Johnson
Ben, That's an odd request, because doesn't it make more sense to install to /Applications if the app is running from /Volumes/MyDMG rather than from ~/Downloads? :-) Indeed, one of the reasons to switch from dmg to zip distribution is that the app disappears when the dmg is unmounted. -J

Re: Moving oneself to /Applications (or ~/Applications)

2009-02-17 Thread Nick Zitzmann
On Feb 17, 2009, at 11:28 PM, Ben Lachman wrote: I'm wanting to move away from DMGs to ZIP delivery. As part of this move I'd like to have my app, SousChef, prompt the user on first run to move itself to /Applications (or ~/Applications as appropriate). In a short search I can't find any

Trying to open a file

2009-02-17 Thread Christian Graus
Hi guys So, I've got a file open dialog, and I have this code: NSString * path = @"file://"; NSString * p = [open filename]; path = [path stringByAppendingString:p ]; NSURL * xmlURL = [[NSURL alloc] initWithString:path ]; NSXMLDocument *doc = [[NSXMLDocument alloc] initWithContentsOfURL:xmlURL

Moving oneself to /Applications (or ~/Applications)

2009-02-17 Thread Ben Lachman
Hi all: I'm wanting to move away from DMGs to ZIP delivery. As part of this move I'd like to have my app, SousChef, prompt the user on first run to move itself to /Applications (or ~/Applications as appropriate). In a short search I can't find any code examples hanging about to do somet

IKImageView (Again )

2009-02-17 Thread Christian Graus
OK, so I have the following code: NSPoint endPoint = [self convertPoint:[theEvent locationInWindow] fromView: self]; float left = startPoint.x; float width = endPoint.x - left; if (left > endPoint.x) { width = -width; left = endPoint.x; } float top = startPoint.y; float height = endPoi

Re: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Graham Cox
On 18 Feb 2009, at 4:41 pm, Ankur Singhal wrote: I need to add a window inside another window so that I can drag them to any portion of my window and also to drag them out of my parent window. Forgive my butting in but I think you're missing the point. The Mac doesn't have the concept of

Re: display unicode string one character at a time, not at simple as it seems

2009-02-17 Thread mathew davis
Hi Micheal, thanks for writing I need to write text onto tiles which will be laid out horizontally. Ideally these tiles shouldn't be much wider than an uppercase W. The tiles cannot overlap. ideally I'd like to break the string in to: the smallest possible segments which do not n

RE: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Ankur Singhal
I need to add a window inside another window so that I can drag them to any portion of my window and also to drag them out of my parent window. Thanks & Regards, Ankur Singhal -Original Message- From: Ken Thomases [mailto:k...@codeweavers.com] Sent: Wednesday, February 18, 2009 10:58 Mor

Re: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Ken Thomases
On Feb 17, 2009, at 10:20 PM, Ankur Singhal wrote: Thanks for the help Ken You're welcome. Is there any alternative way to do this? To do what? Sure there are alternatives to designing your interface using the Windows-esque MDI paradigm. Why do you think you need to put windows inside

Is there a known bug in NSUrl?

2009-02-17 Thread Robert Nicholson
So, I often see this same behavior in Safari, iTunes etc whereby when it's downloading something and you try to resume. It simply will not resume or will say timeout _until_ you remove the file and start again. In iTunes the progress bar simply will not show any more progress until the prev

NSMailDelivery API

2009-02-17 Thread lorenzo7620
I know it's deprecated and not a public API, but my usage of this it is very limited. Now, I've written an app which uses it to send an email. This works just fine on my computer, but on my father's computer, it fails. (I need to get his IP address so I can remotely manage it). The API does n

RE: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Ankur Singhal
Thanks for the help Ken Is there any alternative way to do this? I am really stuck so any help would be appreciated Thanks & Regards, Ankur Singhal -Original Message- From: Ken Thomases [mailto:k...@codeweavers.com] Sent: Wednesday, February 18, 2009 6:05 Morning To: Ankur Singhal Cc: co

Re: Multiline srings

2009-02-17 Thread Ken Thomases
On Feb 17, 2009, at 9:52 PM, Jay Kickliter wrote: I need to embed an NSString into a command tool. It is a template for a file that will be filled in with data from input files. I've been scouring the web and I can't find anything about declaring multi-line objective-c strings. Is there any

Re: display unicode string one character at a time, not at simple as it seems

2009-02-17 Thread Michael Ash
On Tue, Feb 17, 2009 at 5:13 PM, mathew davis wrote: > Hello, > > I need to break a string down into individual characters. > > In English that's pretty easy. > > But in some languages what a user perceives as a single block is actually a > base character plus accents plus vowel markers plus tone

Multiline srings

2009-02-17 Thread Jay Kickliter
I need to embed an NSString into a command tool. It is a template for a file that will be filled in with data from input files. I've been scouring the web and I can't find anything about declaring multi-line objective-c strings. Is there any way to avoid having to manually? Here's just the

Re: NSTableView behavior changes

2009-02-17 Thread Harry Plate
Graham, Thanks for the insights! > > In IB, select the table column, and uncheck 'editable'. This will > prevent the item getting into the editable state at all. > IB is kinda tricky here; one must "drill down" into the table view until one can see the column properties. But I got there! >

Re: NSTableView behavior changes

2009-02-17 Thread Graham Cox
On 18 Feb 2009, at 11:37 am, Harry Plate wrote: I am new to NSTableView (and to Cocoa for that matter) so excuse my lame questions. I have an NSTableView doing what I want (kinda), but I want to modify its behavior, and I am at a loss as where to begin. What I want is this: 1) to disa

Re: Drop Down Toolbar Button

2009-02-17 Thread Graham Cox
On 18 Feb 2009, at 11:28 am, Walker Argendeli wrote: You might remember how, in Xcode 2, the Build & Go button would perform its action, but if you clicked it and held for a few seconds, a menu would pop up with additional options. I'm trying to have something like that. I have a drop down

NSTableView behavior changes

2009-02-17 Thread Harry Plate
I am new to NSTableView (and to Cocoa for that matter) so excuse my lame questions. I have an NSTableView doing what I want (kinda), but I want to modify its behavior, and I am at a loss as where to begin. What I want is this: 1) to disable any possible editing of the "strings" in the table.

Re: Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Ken Thomases
On Feb 17, 2009, at 6:08 AM, Ankur Singhal wrote: I am trying to attach NSPanel to an NSWindow but I can’t find any example on it. Is it possible to add multiple Panel or Window within an window. Also is it possible to add Title Bar and Close button in NSView or its subclasses? Can some

Re: How to determine if a file is completely copied?

2009-02-17 Thread Ken Thomases
On Feb 17, 2009, at 10:25 AM, Gustavo Vera wrote: I'm trying to get status info from a file on disk, to be more precise, I need to know if the file is currently destination of a regular copy operation. According to this Tech Note , the f

Drop Down Toolbar Button

2009-02-17 Thread Walker Argendeli
You might remember how, in Xcode 2, the Build & Go button would perform its action, but if you clicked it and held for a few seconds, a menu would pop up with additional options. I'm trying to have something like that. I have a drop down button with its menu outlet connected to a custom menu

sorry everyone for the bcc'ing - was a slip of the mouse

2009-02-17 Thread mathew davis
sorry for tangling your filters ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subs

Re: NSNetService & NSURLConnection on Tiger

2009-02-17 Thread Houdah - ML Pierre Bernard
Hi! This is what I came up with: @implementation NSNetService (ipv4) - (NSArray*)ipv4addresses { NSMutableArray * ipv4addresses = [NSMutableArray array]; NSArray *addresses = [self addresses]; int aCount = [addresses count]; char addr[256]; for (

Re: display unicode string one character at a time, not at simple as it seems

2009-02-17 Thread mathew davis
Hi clark, turns out I had really misunderstood something about how some characters such as the german ß were stored. I thought it was much more complex that it really is. I thought the single character ß was composed of two grapheme clusters. Actually: rangeOfComposedCharacterSequen

Re: NSTableView crash when selected.

2009-02-17 Thread Harry Plate
Andy, > You don't know and it doesn't matter. Don't think in terms of retain > counts. Think about whether you "own" an object, i.e., whether you > are responsible for releasing it. Good stuff! Thank you. That "mmObjectOwnership" doc is good. Had not seen that before I am sure that I will tri

Re: display unicode string one character at a time, not at simple as it seems

2009-02-17 Thread Clark Cox
On Tue, Feb 17, 2009 at 2:13 PM, mathew davis wrote: > Hello, > > I need to break a string down into individual characters. > > In English that's pretty easy. > > But in some languages what a user perceives as a single block is actually a > base character plus accents plus vowel markers plus tone

display unicode string one character at a time, not at simple as it seems

2009-02-17 Thread mathew davis
Hello, I need to break a string down into individual characters. In English that's pretty easy. But in some languages what a user perceives as a single block is actually a base character plus accents plus vowel markers plus tone markers plus... eg: เก is made of U+0E40 ( เ ) thai

Re: NSNetService & NSURLConnection on Tiger

2009-02-17 Thread Kyle Sluder
See the documentation for -[NSNetService addresses]. You can use that to go from NSNetService -> NSData -> sockaddr_in -> NSURL -> NSURLConnection. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: serialPortSample... hang on "read" function

2009-02-17 Thread Kyle Sluder
On Tue, Feb 17, 2009 at 12:52 PM, Boris Prohaska wrote: > Is there a way to find out if the cable is connected or the other way... to > define a timeout, that it will return with an error? Have you tried select(2)? --Kyle Sluder ___ Cocoa-dev mailing

Re: sticky video/audio files in NSTextView with GC on

2009-02-17 Thread Kyle Sluder
On Tue, Feb 17, 2009 at 12:41 PM, Bill Bumgarner wrote: > Using gdb (there is a bug in Instrument's ObjectAlloc that prevented me from > using it: Would this be the bug that causes the instrumented app to crash whenever you try to use ObjectAlloc with it? >:( --Kyle Sluder _

Re: CALayer defaultValueForKey

2009-02-17 Thread Scott Anguish
On 15-Feb-09, at 6:07 PM, Gordon Apple wrote: The docs are a clear a mud on this. What do you get from CALayer's defaultValueForKey? Is this the same as one would expect from valueForKey for an NSDictionary? The return type is "id". " If this method returns nil a suitable “zero” defau

Re: Still can't get NSFormatter working....

2009-02-17 Thread Todd Freese
Don't you hate when it is something so simple My ref to the field is null, do something came unhooked in IB. Thanks! Todd On Feb 17, 2009, at 10:34 AM, Greg Titus wrote: How about take a step back. Is 'nameField' hooked up in IB correctly so that the formatter is actually being set on

Re: Capture highlighted menu name

2009-02-17 Thread I. Savant
On Tue, Feb 17, 2009 at 6:47 AM, Cauvery K wrote: > I'm developing an app and want to capture menu title (from main menu bar and > status menu bar)along with selected menu window. So far i'm able to capture > the selected menu window but couldn't quite figure out how to capture the > menu title.

Re: QCCompositionLayer doesn't draw until window resized?

2009-02-17 Thread mike woodworth
David, I actually based this off that sample. As I said the code works fine in a simple test harness such as that, so I assume it's somehow related to this specific window. I was hoping someone might have stumbled onto a similar hangup. For the record, I've now found the problem, but

Adding Multiple NSWindow or NSPanel into another NSWindow

2009-02-17 Thread Ankur Singhal
I am trying to attach NSPanel to an NSWindow but I can’t find any example on it. Is it possible to add multiple Panel or Window within an window. Also is it possible to add Title Bar and Close button in NSView or its subclasses? Can some one help me out in sorting this problem? Thanks in Advan

Capture highlighted menu name

2009-02-17 Thread Cauvery K
Hello All, I'm developing an app and want to capture menu title (from main menu bar and status menu bar)along with selected menu window. So far i'm able to capture the selected menu window but couldn't quite figure out how to capture the menu title. Method that I tried to capture menu tit

Re: What is a CALayer?

2009-02-17 Thread Andy Lee
On Feb 17, 2009, at 1:50 PM, John C. Randolph wrote: On Feb 17, 2009, at 10:40 AM, Gordon Apple wrote: OK, I've said it. WHAT is a CALayer? I'm using a lot of them and appreciate what they can do, but still don't understand them. It's an object that manages an OpenGL surface, its location

Re: QCCompositionLayer doesn't draw until window resized?

2009-02-17 Thread David Duncan
On Feb 16, 2009, at 4:10 PM, mike woodworth wrote: I'm having a strange problem integrating a QCCompositionLayer into an existing project. Everything on the window is OpenGLLayer based, so I know the window is properly setup for layer backing. In a stripped down project (with just this Q

Re: What is a CALayer?

2009-02-17 Thread John C. Randolph
On Feb 17, 2009, at 10:40 AM, Gordon Apple wrote: OK, I've said it. WHAT is a CALayer? I'm using a lot of them and appreciate what they can do, but still don't understand them. It's an object that manages an OpenGL surface, its location in 3D space and its place in a hierarchy of layer

What is a CALayer?

2009-02-17 Thread Gordon Apple
OK, I've said it. WHAT is a CALayer? I'm using a lot of them and appreciate what they can do, but still don't understand them. The docs, books, etc., are reasonably good at how they relate to each other, but suck toadstools when it comes to relating them to the underlying view. It's taken a

Re: NSTableView crash when selected.

2009-02-17 Thread Andy Lee
On Feb 17, 2009, at 12:51 PM, Harry Plate wrote: Eg, I created an NSString, added it to an NSArray, then created an NSAttributedString for each array element. So what would the retention count be? 2 or 3? You don't know and it doesn't matter. Don't think in terms of retain counts. Think

Re: serialPortSample... hang on "read" function

2009-02-17 Thread Louis Demers
On 17-Feb-09, at 12:56 , Sean McBride wrote: On 2/17/09 6:52 PM, Boris Prohaska said: Hi Guys... i hope someone can help me out here. In the serialPortSample.h on line 517 in the InitializeModem(); function there is this classic "read" command. But when no modem is here or the cable is unplu

Core Data: Binding to-many relationships thru multiple levels

2009-02-17 Thread Jerry Krinock
I am trying to understand how to bind to object properties that are themselves properties of parent properties. For example, in Apple's DepartmentAndEmployees sample project, in the data model I added to the Employee entity a to-many relationship named 'baggage', to a new entity named 'Bag'

NSNetService & NSURLConnection on Tiger

2009-02-17 Thread Pierre . bernard
Hi! I am trying to use NSURLConnection to connect to a HTTP server that's advertised using Bonjour. Thus I have a NSNetService on the client, but need a IP and port number. The catch being that the juicy NSNetService methods are on Leopard only. Thanks in advance for your assistance. Pierre

Re: serialPortSample... hang on "read" function

2009-02-17 Thread Sean McBride
On 2/17/09 6:52 PM, Boris Prohaska said: >Hi Guys... i hope someone can help me out here. > >In the serialPortSample.h on line 517 in the InitializeModem(); >function there is this classic "read" command. But when no modem is >here or the cable is unplugged, it hangs there for an infinite amount >

Re: CALayers Lost After Switching Window's ContentView

2009-02-17 Thread Timothy Wood
On Feb 16, 2009, at 12:45 PM, David Duncan wrote: The simplest solution, if you can mange it, is to set the view's layer to your own layer, at which point AppKit will take a hands off approach and allow you to determine when the layer should go away. We are also mixing hosting & backing a

serialPortSample... hang on "read" function

2009-02-17 Thread Boris Prohaska
Hi Guys... i hope someone can help me out here. In the serialPortSample.h on line 517 in the InitializeModem(); function there is this classic "read" command. But when no modem is here or the cable is unplugged, it hangs there for an infinite amount on time. My question is rather simple:

Re: NSTableView crash when selected.

2009-02-17 Thread Harry Plate
Shawn, Corbin, Thanks for the suggestions! [Corbin] > 1. break on objc_exception_throw : > http://www.corbinstreehouse.com/blog/index.php/2008/08/your-most-important-bre > akpoint-in-cocoa/ > 2. Use Instruments to find the over release: > http://www.corbinstreehouse.com/blog/index.php/2007/10/ins

Re: sticky video/audio files in NSTextView with GC on

2009-02-17 Thread Bill Bumgarner
On Feb 17, 2009, at 12:52 AM, Markus Guhe wrote: Follow up: I filed a bug report on this issue, number 6593625. Thank you for the bug and especially for the easily reproducible test case. Very much appreciated. I stole the bug out of the inbound queue and had a look. Basically, when the m

RE: Attempting to get distinct values from an entity's attribute

2009-02-17 Thread Jon C. Munson II
Doh! The one permutation I DIDN'T try was: "@distinctUnionOfObjects". I incorrectly reported that I did... And that, fixed that... Sorry for the noise!!! Peace, Love, and Light, /s/ Jon C. Munson II > -Original Message- > From: cocoa-dev-bounces+jmunson=his@lists.apple.com [mail

Re: How to determine if a file is completely copied?

2009-02-17 Thread Dave Carrigan
On Feb 17, 2009, at 9:01 AM, Gustavo Vera wrote: That program is the Finder, but could be any other program capable of writing files to disk. Those programs will be running in any other machine in the lan most of the time. I don't know if this is of any help, but my test case files vary in

Re: How to determine if a file is completely copied?

2009-02-17 Thread Gustavo Vera
That program is the Finder, but could be any other program capable of writing files to disk. Those programs will be running in any other machine in the lan most of the time. I don't know if this is of any help, but my test case files vary in size from just 30 KB to 320 MB, and probably could be eve

Re: How to determine if a file is completely copied?

2009-02-17 Thread Dave Carrigan
On Feb 17, 2009, at 8:25 AM, Gustavo Vera wrote: I'm trying to get status info from a file on disk, to be more precise, I need to know if the file is currently destination of a regular copy operation. I'm currently working with NSFileManager to get a list of the contents of a specific fold

Re: Still can't get NSFormatter working....

2009-02-17 Thread Greg Titus
How about take a step back. Is 'nameField' hooked up in IB correctly so that the formatter is actually being set on a real field? You might try logging both 'nameField' and '[nameField formatter]' right after your code to assign it. Hope this helps, Greg On Feb 17, 2009, at 7:57 AM

How to determine if a file is completely copied?

2009-02-17 Thread Gustavo Vera
Hi list, I'm trying to get status info from a file on disk, to be more precise, I need to know if the file is currently destination of a regular copy operation. I'm currently working with NSFileManager to get a list of the contents of a specific folder, and when I detect a new file on that folder

Re: sticky video/audio files in NSTextView with GC on

2009-02-17 Thread Ross Carter
On Feb 17, 2009, at 3:52 AM, Markus Guhe wrote: Follow up: I filed a bug report on this issue, number 6593625. Thanks for catching this one. I filed a report, too. 6594203 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not pos

Still can't get NSFormatter working....

2009-02-17 Thread Todd Freese
Still can't this NSFormatter to work. It does not seem to be getting called from my NSTextField. Here is the formatter: @implementation FileNameFormatter - (NSString *)stringForObjectValue:(id)anObject { if ([anObject isKindOfClass:[NSString class]]) { NSString *source

Attempting to get distinct values from an entity's attribute

2009-02-17 Thread Jon C. Munson II
Namaste! I'm having trouble with the following code snippet: ... NSString theKey = @"enti...@distinctunionofobjects."; theKey = [theKey stringByAppendingString:[aFilterFields objectAtIndex:[popupFilterOn indexOfSelectedItem]]]; // the above two lines produce som

Re: At what point during loading can NSPersistentDocument fetch?

2009-02-17 Thread Jerry Krinock
On 2009 Feb 16, at 19:42, Chris Idou wrote: readFromURL is the appropriate place to start populating the document. Thank you, Chris. After invoking super in readFromURL:ofType:error: is indeed late enough for fetches to work, but early enough to still affect reading of the other contents

Re: Multiple instances of NSApp/NSApplicationLoad()

2009-02-17 Thread Kevin Walzer
Kevin Walzer wrote: Answers my own question: put the call in switchIcon, before calling anything else in that method. cf: Errr, that method should be as follows: -(int) switchIcon: (NSString *) iconPath { NSApplicationLoad(); //set up autorelease pool

Re: Multiple instances of NSApp/NSApplicationLoad()

2009-02-17 Thread Kevin Walzer
Kevin Walzer wrote: I have multiple calls to NSApp, which is apparently the problem--I am not correctly setting the NSApp global. I've been advised to call NSApplicationLoad(), since Tcl/Tk is currently based on Carbon, but I'm not sure where to do this. Answers my own question: put th

Re: QTMovie brief pause

2009-02-17 Thread Albert Martin
You are correct, and thanks for pointing that out. I just got a little carried away with using the dot syntax and just hadn't noticed it since the compiler didn't give me any warnings. Unfortunately, as you said, this doesn't really solve the main problem here. Anybody have any ideas? A

Multiple instances of NSApp/NSApplicationLoad()

2009-02-17 Thread Kevin Walzer
I'm trying to write a dylib extension to the Tcl/Tk scripting language that updates an application icon with a call to [NSApp setApplicationIconImage]. My code works as expected until it is time for me to restore the original application icon. At that point my app quits with this error: Ter

Re: [iPhone] Abort/remove all running/pending animations [SOLVED]

2009-02-17 Thread Ruotger Skupin
To answer my own question: +[UIView setAnimationsEnabled:]; BUT !!!1!eleven!!one! -[UIScrollView setContentOffset: animated:] messes also with +[UIView setAnimationsEnabled:] whether or not you use animated. So when getting the scrollViewDidEndZooming:withView:atScale: delegate callback c

Re: NSTimer: Test Results

2009-02-17 Thread Andreas Grosam
On Feb 17, 2009, at 12:33 AM, Graham Cox wrote: On 17 Feb 2009, at 6:39 am, Andreas Grosam wrote: So, according the documentation, it is neither method A or method B which is used to calculate the firing time. Actually it is: Let ts(i) be the scheduling times, where ts(0) is the initial

Re: Show Panel in another Application

2009-02-17 Thread rajesh
I have bit of prior experience on working with application as LSUIElement andd seems to be a better option. Due to time constraint , as a workaround, I made the window : canBecomeKeyWindow to NO and ordering it to front with no title bar makes things better. I will make the changes as requi

Re: NSTreeController - Remove Children

2009-02-17 Thread none given
Hi Kyle, Thanks for the assist, I have attempted to use childNodes (see the following code) and it works out fine ONLY the parent node itself also gets removed... Here's what I did: int parentId = 1; //Some node I wanna empty [treeController setSelectionIndexPath:[NSIndexPath indexPathWithIn

Re: sticky video/audio files in NSTextView with GC on

2009-02-17 Thread Markus Guhe
Follow up: I filed a bug report on this issue, number 6593625. Markus On 16 Feb 2009, at 16:42, Markus Guhe wrote: Hello all, I have this problem: 1. Drag and drop a video or audio file into an NSTextView (or set the text storage programmatically to an attributed string with such an att