NSTreeController -moveNode:toIndexPath doesn't work correctly

2008-09-27 Thread Rob Keniger
Hi all, I'm having a problem with the -moveNode:toIndexPath: method of NSTreeController, which is new to 10.5. I'm not using Core Data, I have a very simple model object like so: @interface Item : NSObject { NSMutableArray* children; Item* parent; NSString* text;

Re: sending email with attachement from cocoa

2008-09-27 Thread Torsten Curdt
On Sep 26, 2008, at 20:11, has wrote: Alexander Cohen wrote: Is there a way to use a url request to open mail with all its fields completed but most importantly, contain an image attachement? Nope. If you want to send an email in the background, you'll need to look into a third-party

Re: Use other key than tab to cycle through text fields

2008-09-27 Thread Nathan Kinsinger
On Sep 26, 2008, at 10:16 AM, Gerd Knops wrote: On Sep 25, 2008, at 10:37 PM, Ken Thomases wrote: On Sep 25, 2008, at 9:18 PM, Graham Cox wrote: On 26 Sep 2008, at 10:24 am, Gerd Knops wrote: I would like to use a key other than tab to advance to the next text field, so that users can

Re: Autostart item in user profile.

2008-09-27 Thread Jerry Krinock
Two solutions have been suggested, launchd and Login Item. (Indeed, LoginItemsAE is unreliable and depracated.) I've never seen an explanation of which one to use. Here are my conclusions: • If you do not want the user to be able to see and control your item in System Preferences, or if

design pattern for data acquisition in background thread?

2008-09-27 Thread Joe Keenan
I have an application that acts as a GUI front end for a network device. The device has a telnet server, so I'm using a ASyncSocket to open a connection and talk telnet commands to it. That's all working fine. The problem is that the UI is totally unresponsive while it's doing an

Subviews in flipped layer-backed views

2008-09-27 Thread Gordon Apple
This used to work in 10.5.4 ‹ not in 10.5.5. However, there have been other changes in my code, so the cause could be elsewhere. I have a view that is flipped. My draw objects can contain text which is flowed into the shape of the object. The reason the view is flipped is that that is the

Creating an NSForm programmatically tabbing

2008-09-27 Thread Eric Gorr
When I use interface builder to create a NSForm and hook up it's action, I see the action being executed when I tab between the fields as I am running the application. However, when I create a NSForm programmatically and hook up it's action, I only see the action being executed when I

Accepting file promise drags

2008-09-27 Thread John Dalbec
For completeness, I'd like to be able to accept file promise drags in my Cocoa application. What I want to do is to load an image file into the application after the drag source has written the file to the destination URL. Is there any way for my application to receive a notification

Re: window controllers and managed object contexts

2008-09-27 Thread Daniel Child
Hmm, well that seems to be the catch. I can't get the bindings to work for the MOC. First off, to set up the table displayed in the window loaded with a separate nib file, I simply dragged in an entity object from the Librarian. That doesn't set up an MOC binding, but, following an on- line

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Daniel Child
No. But I'm still wondering. How would you set up a reference again if you chose to have the window released on close...without reloading the entire nib, which is probably counterproductive. On Sep 26, 2008, at 3:30 PM, Charles Steinman wrote: If it's accessed via an outlet in your app

Re: window controllers and managed object contexts

2008-09-27 Thread mmalc crawford
On Sep 27, 2008, at 10:01 AM, Daniel Child wrote: but the tutorial online uses plain accessors (with the local copy of MOC as an ivar, not a property) ... and works. One difference is that their's is a doc-based CoreData app, and mine is not. But I don't see why that should matter

Re: CALayers inside NSSplitView (clipping issue) [SOLVED]

2008-09-27 Thread John Clayton
For posterity. To solve this clipping problem, I wrapped all of the views that I have in a superview instance of NSView. I.e. 'IB - Layout - Embed Objects In - Custom View'. That stops the clipping weirdness from occurring. Don't ask me why, because I don't know - but I made this

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Kyle Sluder
On Sat, Sep 27, 2008 at 1:06 PM, Daniel Child [EMAIL PROTECTED] wrote: No. But I'm still wondering. How would you set up a reference again if you chose to have the window released on close...without reloading the entire nib, which is probably counterproductive. Released does not mean

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Uli Kusterer
On 27.09.2008, at 19:06, Daniel Child wrote: No. But I'm still wondering. How would you set up a reference again if you chose to have the window released on close...without reloading the entire nib, which is probably counterproductive. Well, for some windows, you might not need another

Re: Creating an NSForm programmatically tabbing

2008-09-27 Thread Eric Gorr
Here's some sample code demonstrating this two cases: http://ericgorr.net/nsform.zip Contacts-FormManual is where I am creating the NSForm programmatically. When I tab between the fields, I would like the formChanged: selection to be called. Contacts-Form is where I am creating the NSForm

Re: problems in runModal in NSOpenPanel used with defaults

2008-09-27 Thread Michael Ash
On Sat, Sep 27, 2008 at 1:34 AM, spartan g [EMAIL PROTECTED] wrote: Thanks Corbin, I have used your tips in the updated code. Besides, my aim is to save the filename selected through the panel to a pList file timely whenever it is changed, so I am using synchronization of defaults. I checked

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Michael Ash
On Sat, Sep 27, 2008 at 2:39 PM, Uli Kusterer [EMAIL PROTECTED] wrote: Also, there are cases where someone else is going to retain a window anyway. Closing a window will simply call -release, if someone else retained it, the object won't go away. But suddenly you're back to having to think

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Chris Hanson
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 controller does the telnet command to get it, returns it to the app controller, and the app controller

Re: Creating an NSForm programmatically tabbing

2008-09-27 Thread mmalc crawford
On Sep 27, 2008, at 12:03 PM, Eric Gorr wrote: Contacts-FormManual is where I am creating the NSForm programmatically. When I tab between the fields, I would like the formChanged: selection to be called. [theFormCell setSendsActionOnEndEditing:YES]; mmalc

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Uli Kusterer
On 27.09.2008, at 22:13, Michael Ash wrote: But suddenly you're back to having to think about the global picture of who owns objects, which is what Cocoa's memory management system is supposed to avoid. Retains and releases should be balanced. This doesn't just means that they should

sizeof(unsigned long long)

2008-09-27 Thread Daniel Luis dos Santos
Hello, I have a piece of C code that generates an unsigned long long from an sequence of unsigned char's. When I do sizeof(unsigned long long) i get 8. Afterwards I try to shift each unsigned char into its position along the destination unsigned long long variable, but I get a warning from

Re: setPrimitiveValue:forKey: and to-many relationships

2008-09-27 Thread Chris Hanson
On Sep 24, 2008, at 3:56 PM, Quincey Morris wrote: IAC, it's not clear why you need to use setPrimitiveValue: at all. Why not something like: - (void)setChildren:(NSSet*)value_ { [[self mutableSetValueForKey:@children] removeAllObjects]; [[self

Re: sizeof(unsigned long long)

2008-09-27 Thread Nick Zitzmann
On Sep 27, 2008, at 3:49 PM, Daniel Luis dos Santos wrote: When I do sizeof(unsigned long long) i get 8. Afterwards I try to shift each unsigned char into its position along the destination unsigned long long variable, but I get a warning from the compiler that I am shifting beyond the

Re: sizeof(unsigned long long)

2008-09-27 Thread Clark Cox
On Sat, Sep 27, 2008 at 2:49 PM, Daniel Luis dos Santos [EMAIL PROTECTED] wrote: Hello, I have a piece of C code that generates an unsigned long long from an sequence of unsigned char's. When I do sizeof(unsigned long long) i get 8. Afterwards I try to shift each unsigned char into its

PubSub not automatically downloading enclosures

2008-09-27 Thread Colin Barrett
I'm having some problems with PubSub not downloading enclosures. I'm running 10.5.5 and using Xcode 3.1.1. If this is the wrong list, my apologies. Here's a codesample that seems to not be working. --- - (void)awakeFromNib { PSClient *client = [PSClient applicationClient];

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Michael Atwood
I believe the Design Pattern you're looking for is the Asynchronous Callback. Basically you send a command over the network and some point in the future it tells you when the data is available. This leaves the rest of the application to continue on until your data request shows up. I'm

How to count composed characters in NSString?

2008-09-27 Thread David Niemeijer
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 multiple 16 bit slots. Using - (NSUInteger)length is

How to get the current screen resolution on Mac

2008-09-27 Thread 熊佳
Hi, All,I am a newcomer, I write a simple program on mac, and want to display the main window at the center of screen, i mean the window's position should depends on the screen's width and height, so i need to get the screen resolution, who can tell me how to get it? which api is

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Michael Nickerson
On Sep 27, 2008, at 4:44 PM, Uli Kusterer wrote: That said, I fully agree on one partial point you raised: 'Release when closed' is dangerous and complicates matters. It should be off by default, and it's very likely that nobody would miss it. That said, I don't know what it was

Need to override +(Class) class?

2008-09-27 Thread Dave DeLong
Hi everyone, 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 an array of InputElement

Re: How to get the current screen resolution on Mac

2008-09-27 Thread Andrew Farmer
On 27 Sep 08, at 18:00, 熊佳 wrote: Hi, All,I am a newcomer, I write a simple program on mac, and want to display the main window at the center of screen, i mean the window's position should depends on the screen's width and height, so i need to get the screen resolution, who can tell me

Re: Need to override +(Class) class?

2008-09-27 Thread Jamie Hardt
Not sure exactly what your problem is, have you tried isMemberOfClass: instead of isKindOfClass:? the is*OfClass: methods have certain... dangers. You might try testing the given object to see if they respond to slider selectors versus button selectors, and discriminate in that way. On

Re: Need to override +(Class) class?

2008-09-27 Thread Dave DeLong
It's always the simple errors that get me. I had dragged the InputView* class files into my project, but they weren't successfully added. Removing them and adding them again got rid of the errors. I feel a little silly now, but that's ok. Thanks for the point in the right direction,

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Joe Keenan
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 controller does the telnet command to get it, returns

Re: How to get the current screen resolution on Mac

2008-09-27 Thread Uli Kusterer
On 28.09.2008, at 03:00, 熊佳 wrote: Hi, All,I am a newcomer, I write a simple program on mac, and want to display the main window at the center of screen, i mean the window's position should depends on the screen's width and height, so i need to get the screen resolution, who can tell

Re: Need to override +(Class) class?

2008-09-27 Thread Uli Kusterer
On 28.09.2008, at 05:05, Dave DeLong wrote: I had dragged the InputView* class files into my project, but they weren't successfully added. Removing them and adding them again got rid of the errors. You probably just forgot to associate them with your target. Next time this happens,

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Uli Kusterer
On 28.09.2008, at 05:10, Joe Keenan wrote: The problem with any async method is that I haven't figured an elegant way to know which update code to use for each return value. They're not all the same. Different data elements need different processing to update the UI. When I get a

Re: showing window causes EXC_BAD_ACCESS

2008-09-27 Thread Michael Ash
On Sat, Sep 27, 2008 at 4:44 PM, Uli Kusterer [EMAIL PROTECTED] wrote: On 27.09.2008, at 22:13, Michael Ash wrote: But suddenly you're back to having to think about the global picture of who owns objects, which is what Cocoa's memory management system is supposed to avoid. Retains and

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Michael Gardner
On Sep 27, 2008, at 10:10 PM, Joe Keenan wrote: The problem with any async method is that I haven't figured an elegant way to know which update code to use for each return value. They're not all the same. Different data elements need different processing to update the UI. When I get a

Re: design pattern for data acquisition in background thread?

2008-09-27 Thread Graham Cox
On 28 Sep 2008, at 1:10 pm, Joe Keenan wrote: if ([key isEqualToString: @lnbcolor]) { [lnbLight setTextColor:[NSColor colorFromHexidecimalValue: keyValue]]; } else if ([key isEqualToString: @lancolor]) {