Re: Core data "grand-children" list

2008-09-16 Thread Tomaž Kragelj
Hi, thanks for suggestion - definitely worth remembering it. Yesterday evening I was playing a bit more with array controllers and I figured it out - I use intermediate array controller for sessions and bindings like this: ProjectArrayController: no binding, just setting the mode to entity

NSApplication subclass crashes on 10.3 with Xcode 3

2008-09-16 Thread Kevin Wojniak
I'm working on an app that was recently brought over to Xcode 3 from a 2.X version. The app uses an NSApplication subclass that's in a framework, and crashes upon startup on 10.3 when using the Xcode 3 build. However, with Xcode 3/10.5 and Xcode 2.5/10.3, it works. I've successfully duplica

Re: Animation curve is always linear though specified to be S-like

2008-09-16 Thread Oleg Krupnov
It has just dawned at me that I should use [self currentValue] instead of [self currentProgress] as the argument for the function that alters the position during animation, i.e. NSLog( [NSString stringWithFormat:@"%f", [self currentValue]]); The "progress" indeed grows linearly, at regular time i

Re: Animation curve is always linear though specified to be S-like

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 3:04 pm, Graham Cox wrote: Does it? The likelihood is that the animation is performed using a regular interval, but the position is modified according to the S- curve function. With only 7 steps of animation, it's probable that you are just not noticing the easing in and

Re: Animation curve is always linear though specified to be S-like

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 2:56 pm, Oleg Krupnov wrote: I get the following log: 0.166700 0.333450 0.499950 0.10 0.833090 0.999710 1.00 It follows that the animation is linear (the increment is constant) Does it? The likelihood is that the animation is performed using a regular interval

Re: Animation curve is always linear though specified to be S-like

2008-09-16 Thread Oleg Krupnov
I have got no response, but still I wasn't able to fix this problem. Any ideas? On Wed, Aug 20, 2008 at 9:49 PM, Oleg Krupnov <[EMAIL PROTECTED]> wrote: > The problem is that my animation always seems to perform linearly, not > S-like, although I specify it to do the latter. > > Here's my code: >

Re: Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Alex Kac
Perfect - I appreciate it. On Sep 16, 2008, at 10:11 PM, Jonathan Hess wrote: Hey Alex - If your controller is the File's Owner, and in your NIB there is a connection connecting the the File's Owner's 'myButton' outlet to a button, then when you load the nib, the controller's myButton in

Re: NSOutlineView: Which row is selected.

2008-09-16 Thread Andy Lee
On Sep 16, 2008, at 7:17 PM, John Cebasek wrote: Well, I did use [self selectedRow], in a previous version of the code. but that also returned -1. I don't think I'm doing anything 'weird', the view has a delegate and a datasource which are in the same class connected in the xib. The awakeFr

Re: Outlet from Different Implementation?

2008-09-16 Thread Jeshua Lacock
On Sep 16, 2008, at 8:11 PM, Graham Cox wrote: Does your accessor look like mine above, or does it look like this: + (id) myOutlet { return MyOutlet; } The '+' or '-' symbol in front of the method is very important. + means it's a class method, - means it's an instance method. See her

Re: Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 1:43 pm, Kyle Sluder wrote: On Tue, Sep 16, 2008 at 7:50 PM, Graham Cox <[EMAIL PROTECTED]> wrote: I'm not using a text view directly, but I do have attributed text that could take advantage of the Font Panel's UI if this worked. Since I'm trying to receive this in a dia

Re: Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-16 Thread Kyle Sluder
On Tue, Sep 16, 2008 at 7:50 PM, Graham Cox <[EMAIL PROTECTED]> wrote: > I'm not using a text view directly, but I do have attributed text that could > take advantage of the Font Panel's UI if this worked. Since I'm trying to > receive this in a dialog that has text fields, I wonder if the message

Re: Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Jonathan Hess
Hey Alex - If your controller is the File's Owner, and in your NIB there is a connection connecting the the File's Owner's 'myButton' outlet to a button, then when you load the nib, the controller's myButton instance variable will be connected to the button in the nib. So far, everything

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 22:41 , Roland King wrote: Jason Coco wrote: NSMutableString *str = [[NSMutableString alloc] initWithCapacity:someAssumedCapacity]; /* do stuff */ [str release]; Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a me

Re: NSMutableString question

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 12:41 pm, Roland King wrote: Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a message a couple of months ago about a more complicated object where it appeared that the initializer did a retain/autorelease on the object

Re: NSMutableString question

2008-09-16 Thread Bill Bumgarner
On Sep 16, 2008, at 7:41 PM, Roland King wrote: Jason Coco wrote: NSMutableString *str = [[NSMutableString alloc] Â initWithCapacity:someAssumedCapacity]; /* do stuff */ [str release]; Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a me

Re: NSMutableString question

2008-09-16 Thread Roland King
Jason Coco wrote: NSMutableString *str = [[NSMutableString alloc] initWithCapacity:someAssumedCapacity]; /* do stuff */ [str release]; Is that actually guaranteed to release the string *right now*? I only ask because I seem to recall a message a couple of months ago about a more complicat

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 21:58 , Bill Bumgarner wrote: On Sep 16, 2008, at 6:29 PM, Jason Coco wrote: Is it actually retained by the pool, or does the pool just delay the final release? It doesn't really matter how it's implemented... either way, you shouldn't release it unless you own it (i.e.

Re: Outlet from Different Implementation?

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 11:18 am, Jeshua Lacock wrote: - (id) myOutlet { return MyOutlet; } Thanks Graham, Looks simple enough, however, I can't seem to make it work. I get a warning "warning: instance variable 'MyOutlet' accessed in a class method" Does your accessor look like

Re: NSMutableString question

2008-09-16 Thread Bill Bumgarner
On Sep 16, 2008, at 6:29 PM, Jason Coco wrote: Is it actually retained by the pool, or does the pool just delay the final release? It doesn't really matter how it's implemented... either way, you shouldn't release it unless you own it (i.e., you've retained it yourself or gotten it from on

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 21:24 , Dave DeLong wrote: On 16 Sep, 2008, at 7:22 PM, Graham Cox wrote: On 17 Sep 2008, at 11:11 am, Dave DeLong wrote: because only a couple days ago I had a crash when I tried releasing an already autoreleased object Yes, because that would be an over-release.

Re: NSMutableString question

2008-09-16 Thread Dave DeLong
On 16 Sep, 2008, at 7:22 PM, Graham Cox wrote: On 17 Sep 2008, at 11:11 am, Dave DeLong wrote: because only a couple days ago I had a crash when I tried releasing an already autoreleased object Yes, because that would be an over-release. release must be balanced by a preceding retain.

Re: NSMutableString question

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 11:11 am, Dave DeLong wrote: because only a couple days ago I had a crash when I tried releasing an already autoreleased object Yes, because that would be an over-release. release must be balanced by a preceding retain. But once an object has been added to an autorele

Re: NSMutableString question

2008-09-16 Thread Dave DeLong
Earlier today I was experimenting with NSAutoreleasePools and built a little demo app. Basically it was two nested loops (the outer having 100 iterations, the inner 1000), and on each iteration of the inner loop, I created an autoreleased string (using stringWithFormat:). I ran it twice.

Re: NSMutableString question

2008-09-16 Thread Ken Thomases
On Sep 16, 2008, at 7:59 PM, Dave DeLong wrote: The general rule with convenience class methods like that is that they return an autoreleased object. They return an object for which you do not have responsibility to release. It may or may not be technically autoreleased. What that means

Re: Outlet from Different Implementation?

2008-09-16 Thread Jeshua Lacock
On Sep 16, 2008, at 4:16 AM, Graham Cox wrote: Well, the accessor method I had in mind, in its entirety, is: - (id) myOutlet { return MyOutlet; } Thanks Graham, Looks simple enough, however, I can't seem to make it work. I get a warning "warning: instance variable 'MyOutlet' a

Re: NSMutableString question

2008-09-16 Thread Dave DeLong
Thanks for the heads up. I think if I had thought about that a little longer I probably wouldn't have written it, because only a couple days ago I had a crash when I tried releasing an already autoreleased object. Whoops. =) Dave On 16 Sep, 2008, at 7:07 PM, Graham Cox wrote: On 17 S

Re: NSMutableString question

2008-09-16 Thread Jim Correia
On Sep 16, 2008, at 8:59 PM, Dave DeLong wrote: The general rule with convenience class methods like that is that they return an autoreleased object. The rules are encapsulated in the object ownership policy:

Re: NSMutableString question

2008-09-16 Thread Jason Coco
On Sep 16, 2008, at 20:59 , Dave DeLong wrote: The general rule with convenience class methods like that is that they return an autoreleased object. What that means is that unless you retain it, it will disappear at some time in the future (whenever the current AutoreleasePool gets draine

Re: NSMutableString question

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 10:59 am, Dave DeLong wrote: NSString * str = [NSMutableString string]; //do stuff with str [[str retain] release]; HOWEVER, that might cause funky things to happen with the autorelease pool. So the best idea is to do nothing and let the autorelease pool take care of it

Re: NSMutableString question

2008-09-16 Thread Dave DeLong
The general rule with convenience class methods like that is that they return an autoreleased object. What that means is that unless you retain it, it will disappear at some time in the future (whenever the current AutoreleasePool gets drained). So if you want to "reclaim" the space, you d

NSMutableString question

2008-09-16 Thread John Zorko
Hello, all ... I've another simple ObjC question that I hope someone can answer -- this has to do with memory management and NSMutableString. If I do this: NSString *str = [NSMutableString string]; ... what is the best way to reclaim that space? Do I do [str release] (no alloc was c

Inverse or remove alpha mask from tiff

2008-09-16 Thread Nate Alf
HI all, Can anyone here recommend a way to inverse an alpha mask, or remove it altogether when exporting to a new file using NSImage? Thanks- Nathan ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests

Re: Dealing with encoding in XML parsing

2008-09-16 Thread James Walker
Laurent Cerveau wrote: I have an XML document with obviously some problems with it but that needs to be parsed in all cases. One of the problem is apparently an encoding one as some text read in an editor as "Restaurant, Bar, Bistro, CafÈ" (reopening with an ISO-8859-1 Windows apparently is

Re: Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-16 Thread Graham Cox
On 17 Sep 2008, at 4:46 am, Preston Jackson wrote: [[NSFontManager sharedFontManager] setTarget:self] only sets the target to the changeFont: method. Alternatively, you can put changeFont: in the responder chain it will get called without having to explicitly set the target of the shared N

Re: NSOutlineView: Which row is selected.

2008-09-16 Thread Corbin Dunn
On Sep 16, 2008, at 4:17 PM, John Cebasek wrote: Hi Nick, et al: Well, I did use [self selectedRow], in a previous version of the code. but that also returned -1. I don't think I'm doing anything 'weird', the view has a delegate and a datasource which are in the same class connected in

Dealing with encoding in XML parsing

2008-09-16 Thread Laurent Cerveau
Hi I have an XML document with obviously some problems with it but that needs to be parsed in all cases. One of the problem is apparently an encoding one as some text read in an editor as "Restaurant, Bar, Bistro, CafÈ" (reopening with an ISO-8859-1 Windows apparently is solving the issue

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
I've just tried this again, I just changed the start: void import( NSArray *array ) { and it is all called by: import(custNodes); so I beleive this line is uneccessary: NSXMLDocument *custdoc = [[NSXMLDocument alloc] initWithData:[NSData dataWithContentsOfFile:@"/Users/nathan/Desktop/xml tes

Page Curl Transition of Layers

2008-09-16 Thread Timothy Larkin
I am working on animating the swapping of layers into views. By overriding defaultActionForKey for my layer class, I get correct transitions for all of the transition filters in the standard set, except for CIPageCurlTransition. Instead of the page curl, I am seeing a push transition, where

Re: NSOutlineView: Which row is selected.

2008-09-16 Thread John Cebasek
Hi Nick, et al: Well, I did use [self selectedRow], in a previous version of the code. but that also returned -1. I don't think I'm doing anything 'weird', the view has a delegate and a datasource which are in the same class connected in the xib. The awakeFroNib message populates the list.

Re: Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Ken Thomases
On Sep 16, 2008, at 5:33 PM, Alex Kac wrote: I have two views that are different layouts of the same UI loaded by a NSViewController. Is that one view controller managing two views? Or two view controllers, one for each view? In the second case (which makes more sense to me), I'd have th

Re: Drawing on Another App's CGDisplayCapture

2008-09-16 Thread David Duncan
On Sep 16, 2008, at 3:44 PM, Greg Hoover wrote: I'm building a very similar function to the one described by Ben, but using PowerPoint -- I have an overlay window that is supposed to show auxiliary info during a PowerPoint presentation. I've verified that the drawing routines are running o

Re: Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Keary Suska
9/16/08 4:33 PM, also sprach [EMAIL PROTECTED]: > I have two views that are different layouts of the same UI loaded by a > NSViewController. Now lets say that I have an IBOutlet to an NSButton* > button1 that is present in both views. I want to swap one view out for > the other and when I do so ha

Re: Drawing on Another App's CGDisplayCapture

2008-09-16 Thread Greg Hoover
I'm building a very similar function to the one described by Ben, but using PowerPoint -- I have an overlay window that is supposed to show auxiliary info during a PowerPoint presentation. I've verified that the drawing routines are running on my overlay window, but the updates are never s

Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Alex Kac
I have two views that are different layouts of the same UI loaded by a NSViewController. Now lets say that I have an IBOutlet to an NSButton* button1 that is present in both views. I want to swap one view out for the other and when I do so have the IBOutlet for button1 swap to the button1 d

Re: Core Data and ordered relationships

2008-09-16 Thread Sean McBride
On 9/15/08 3:13 PM, Jamie Hardt said: >> b) add an attribute named 'index' (value 1 to 6) and code methods >> named >> employee1, etc. in my NSManagedObject subclass? > >Certainly do the second one, unless there's some factor in your >business logic that demands exactly six employees, but I can't

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 2:15 PM, Amy Heavey wrote: I've just tried this again, I just changed the start: void import( NSArray *array ) { and it is all called by: import(custNodes); I assume that means you did something like: NSArray *custNodes = [custdoc nodesForXPath:@".//customer" er

Re: Core data "grand-children" list

2008-09-16 Thread Steve Steinitz
Hi Toma On 16/9/08, Toma? Kragelj <[EMAIL PROTECTED]> wrote: I have the following core data model: Project <>> Session <>> Measurement On my form I want the user to select the desired project from the table and then based on that selection, I want to display all measurements (for

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 12:52 PM, Sherm Pendley wrote: On Tue, Sep 16, 2008 at 7:39 AM, Amy Heavey <[EMAIL PROTECTED] > wrote: NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; if ([customerArray count]){ NSXMLNode *customerNode;

Re: referencing XML Data

2008-09-16 Thread Nathan Kinsinger
On Sep 16, 2008, at 1:24 PM, Amy Heavey wrote: Thanks, I've been messing about with code all over the place, gone a little blind I think, however, I now get 2 errors on this line: 1 - nested functions are disabled, use -fnested-functions to renable 2 - syntax error before in NSArray *cu

Re: How to uniquely determine MD5-sum of a dict?

2008-09-16 Thread Michael Ash
On Tue, Sep 16, 2008 at 2:40 PM, Arthur C. <[EMAIL PROTECTED]> wrote: > I have an NSDictionary that has to be written to disk, distributed and read > in again. > I would like to add an MD5 sum to the dictionary to make sure it has not been > modified/corrupted on the way. That can be done by maki

Re: How to uniquely determine MD5-sum of a dict?

2008-09-16 Thread I. Savant
On Tue, Sep 16, 2008 at 2:40 PM, Arthur C. <[EMAIL PROTECTED]> wrote: > I have an NSDictionary that has to be written to disk, distributed and read > in again. > I would like to add an MD5 sum to the dictionary to make sure it has not been > modified/corrupted on the way. That can be done by maki

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
Thanks, I've been messing about with code all over the place, gone a little blind I think, however, I now get 2 errors on this line: 1 - nested functions are disabled, use -fnested-functions to renable 2 - syntax error before in NSArray *customerArray = [custdoc nodesForXPath:@".//customer"

Re: async NSOperation and NSOperationQueue

2008-09-16 Thread I. Savant
On Tue, Sep 16, 2008 at 12:50 PM, John Love <[EMAIL PROTECTED]> wrote: > [theQueue waitUntilAllOperationsAreFinished]; >From the documentation for this method: "When called, this method blocks the current thread and waits for the receiver's current and pending operations to finish executing. Whil

Re: async NSOperation and NSOperationQueue

2008-09-16 Thread Michael Ash
On Tue, Sep 16, 2008 at 12:50 PM, John Love <[EMAIL PROTECTED]> wrote: > + > Michael Ash wrote: > > When your application becomes unresponsive, pause it in the debugger > and look at the backtraces of all the threads. (You can do this in a > single step by typing "t a a bt" at the debugger cons

Re: Abusing targetForAction: with non-action selectors

2008-09-16 Thread Michael Ash
On Mon, Sep 15, 2008 at 7:49 PM, Charles Srstka <[EMAIL PROTECTED]> wrote: > On Sep 15, 2008, at 3:13 PM, Dave Dribin wrote: > >> Hello, >> >> Is it safe to use -[NSApplication targetForAction:] with non-action >> selectors? For example, selectors that have more than one argument, non-id >> first

Re: referencing XML Data

2008-09-16 Thread Sherm Pendley
On Tue, Sep 16, 2008 at 7:39 AM, Amy Heavey <[EMAIL PROTECTED]>wrote: > > NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; >if ([customerArray count]){ >NSXMLNode *customerNode; >for (customerNode in customer

Re: Bug with -changeAttributes: in NSFontManager/Font Panel?

2008-09-16 Thread Preston Jackson
Graham, [[NSFontManager sharedFontManager] setTarget:self] only sets the target to the changeFont: method. Alternatively, you can put changeFont: in the responder chain it will get called without having to explicitly set the target of the shared NSFontManager. The changeAttributes: method

How to uniquely determine MD5-sum of a dict?

2008-09-16 Thread Arthur C .
I have an NSDictionary that has to be written to disk, distributed and read in again. I would like to add an MD5 sum to the dictionary to make sure it has not been modified/corrupted on the way. That can be done by making NSData using NSArchiver and then passing it to MD5() from . But, the o

Control bar on top of the screen

2008-09-16 Thread Hugo Habel
Hi! I am new to this mail list and also to Cocoa development. I am sure that the best way to learn a new programming language is to define yourself a project and try to complete it. So it is what I am doing. Before I start coding I want to have an idea about everything my program should do. So he

Re: async NSOperation and NSOperationQueue

2008-09-16 Thread John Love
+ Michael Ash wrote: When your application becomes unresponsive, pause it in the debugger and look at the backtraces of all the threads. (You can do this in a single step by typing "t a a bt" at the debugger console. This is a shortcut for "thread apply all backtrace".) This should quickly te

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
Thanks for your help Nathan, but I'm obviously doing something really wrong, I've got the following code, NSArray *customerArray = [custdoc nodesForXPath:@".//customer" error:nil]; if ([customerArray count]){ NSXMLNode *customerNode;

Core data "grand-children" list

2008-09-16 Thread Tomaž Kragelj
I have the following core data model: Project <>> Session <>> Measurement On my form I want the user to select the desired project from the table and then based on that selection, I want to display all measurements (for all sessions) for that project. I have two array controllers -

Re: structs in Mutable containers

2008-09-16 Thread Sean McBride
On 9/16/08 10:22 AM, Clark Cox said: >> This is what I was remembering: >> > understanding_strict_aliasing.html#introduction> > >OK, examples that don't involve type-punned pointers: > *SNIP* So... I think I have it now: - casting NSPoint to/f

Re: (Newb) Multiple NSWindowControllers and bindings

2008-09-16 Thread John Velman
Thanks, Quincy. I didn't think of using the "File's Owner.document.model" path directly. By the way, I actually got the NSWindowController - view-controller from Apple documentation: CocoaFundamentals.pdf, Appendix B, page 243 says: "An NSWindowController object manages the presentation of th

Re: structs in Mutable containers

2008-09-16 Thread Clark Cox
On Tue, Sep 16, 2008 at 9:57 AM, Sean McBride <[EMAIL PROTECTED]> wrote: > On 9/16/08 9:45 AM, Clark Cox said: > >>> NSPoint and CGPoint may be the same now, but they may not always be. >>> (Consider that NSAffineTransformStruct and vImage_AffineTransform were >>> the same, but the former changed f

Re: (Newb) Multiple NSWindowControllers and bindings

2008-09-16 Thread Quincey Morris
On Sep 16, 2008, at 09:49, John Velman wrote: ... And in a NIB (or XIB), the NSWindowController is the File's Owner, and is the main "View Controller" (as well as the window controller, of course.) "View controller" in an informal sense, perhaps, but this isn't really good terminology. A

Re: structs in Mutable containers

2008-09-16 Thread Sean McBride
On 9/16/08 9:45 AM, Clark Cox said: >> NSPoint and CGPoint may be the same now, but they may not always be. >> (Consider that NSAffineTransformStruct and vImage_AffineTransform were >> the same, but the former changed from float to CGFloat and the latter >> stayed float, even in 64 bit.) >> >> Als

(Newb) Multiple NSWindowControllers and bindings

2008-09-16 Thread John Velman
In my app, I'm using multiple windows to get multiple perspectives on the model. If I understand correctly, MyDocument should typically be the Model controller as well as owner of the NSWindowControllers. And in a NIB (or XIB), the NSWindowController is the File's Owner, and is the main "View Con

Re: structs in Mutable containers

2008-09-16 Thread Clark Cox
On Tue, Sep 16, 2008 at 7:49 AM, Sean McBride <[EMAIL PROTECTED]> wrote: > On 9/16/08 8:24 PM, Graham Cox said: > >>CGPoints and NSPoints have the same structure so you can >>cast one to t'other. > > You shouldn't really. You should use NSPointFromCGPoint/ > NSPointToCGPoint. Their implementation

Re: NSXMLParser and multithreading

2008-09-16 Thread Benjamin Stiglitz
Excerpts from Mark Thomas's message of Tue Sep 16 11:36:41 -0400 2008: > Was wondering if somebody could answer how thread safe NSXMLParser is, as > I need to use it with NSURL set to remote server and the response could take > a while, so this why I want to put off into another thread. Instance

NSXMLParser and multithreading

2008-09-16 Thread Mark Thomas
Resending, as wondered if anybody had any views on this ? --- Hi All, Was wondering if somebody could answer how thread safe NSXMLParser is, as I need to use it with NSURL set to remote server and the response could take a while, so this why I want to put off into another thread. While I can

Re: async NSOperation and NSOperationQueue

2008-09-16 Thread Michael Ash
On Tue, Sep 16, 2008 at 10:12 AM, John Love <[EMAIL PROTECTED]> wrote: > Specifically, for example, while the queue is doing its calculation, I > cannot press CMD-N to create a new document window. To continue with this > specific example, CMD-N does do its thing, but only after the queue > operati

Re: structs in Mutable containers

2008-09-16 Thread Sean McBride
On 9/16/08 8:24 PM, Graham Cox said: >CGPoints and NSPoints have the same structure so you can >cast one to t'other. You shouldn't really. You should use NSPointFromCGPoint/ NSPointToCGPoint. Their implementation is in NSGeometry.h and is not a simple cast. NSPoint and CGPoint may be the same

Re: async NSOperation and NSOperationQueue

2008-09-16 Thread John Love
Couple of things... you don't wanna create a queue every time. You should pretty much have just one queue that you add NSOperation objects to. You probably want to re-write this to be a singleton object that you get from your app controller or some other relevant place. Queue initializatio

How do I check if at least one TWAIN device is available

2008-09-16 Thread Ulf Dunkel
In TWAINhandler.cpp (by Apple Inc.) and the relevant files, I get all that nice stuff to access a TWAIN data source etc. in my app. The following line in TWAINHandler::selectDS() e.g. opens the 'Select Device' window provided by Mac OS X: DSM_Entry(&mAppIdentity, NULL, DG_CONTROL, DAT_IDENTIT

Re: Using NSAlert with PyObjc - basics

2008-09-16 Thread Tobias Prinz
Am 12.09.2008 um 16:40 schrieb Tobias Prinz: Hello there, I am trying to display a little pop-up using NSAlert. I've used a fairly standard snippet from this page (which is written in German, plus it is ObjC code): http://cocoa-coding.de/nsalert/nsalert.html As far as I know, my message h

Re: structs in Mutable containers

2008-09-16 Thread Mike Abdullah
What's wrong with +[NSValue valueWithCGPoint:CGPointMake(x, y)] ? On 16 Sep 2008, at 13:41, Phil wrote: On Tue, Sep 16, 2008 at 10:46 PM, Christian Giordano <[EMAIL PROTECTED]> wrote: I just realized valueWithPoint is not available on the iPhone SDK It's just a convenience method for some

Re: referencing XML Data

2008-09-16 Thread Amy Heavey
On 14 Sep 2008, at 02:51, Nathan Kinsinger wrote: On Sep 13, 2008, at 12:50 PM, Amy Heavey wrote: I've got an NSXMLDocument *custdoc but I can't work out how to actually access the data in the document, I've looked at NSXMLElement, NSXMLParser, NSXMLNode but I just can't work out the corr

Re: structs in Mutable containers

2008-09-16 Thread Phil
On Wed, Sep 17, 2008 at 12:41 AM, Phil <[EMAIL PROTECTED]> wrote: > [NSValue valueWithBytes:somePoint objCType:@encode(NSPoint)] > Should be: NSPoint somePoint = NSMakePoint(x,y); [NSValue valueWithBytes:&somePoint objCType:@encode(NSPoint)]; Phil ___

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
Yep, this should work as well. Thanks, chr On Tue, Sep 16, 2008 at 1:41 PM, Phil <[EMAIL PROTECTED]> wrote: > On Tue, Sep 16, 2008 at 10:46 PM, Christian Giordano > <[EMAIL PROTECTED]> wrote: >> I just realized valueWithPoint is not available on the iPhone SDK >> > > It's just a convenience met

Re: structs in Mutable containers

2008-09-16 Thread Phil
On Tue, Sep 16, 2008 at 10:46 PM, Christian Giordano <[EMAIL PROTECTED]> wrote: > I just realized valueWithPoint is not available on the iPhone SDK > It's just a convenience method for something like: [NSValue valueWithBytes:somePoint objCType:@encode(NSPoint)] You can implement this yourself in

Re: structs in Mutable containers

2008-09-16 Thread Roland King
well can you manage the lifetime of the CGPoints well enough to use valueWithPointer: which, if I read it correctly, doesn't free the pointer when it's done? Or just write your own NSObject derivation you can pass a CGPoint to, by value and have it copied, or as a pointer, but which it owns

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
I just realized valueWithPoint is not available on the iPhone SDK and, I can't understand why, it can't be discussed here. Both things of course suck! :) Thanks a lot, chr On Tue, Sep 16, 2008 at 11:24 AM, Graham Cox <[EMAIL PROTECTED]> wrote: > > On 16 Sep 2008, at 7:18 pm, Christian Giordano

Re: structs in Mutable containers

2008-09-16 Thread Graham Cox
On 16 Sep 2008, at 7:18 pm, Christian Giordano wrote: ... forKey:[[NSNumber alloc] initWithInt:BAND_RED]]; Not a really elegant solution but I can understand that those containers require pointers. Now I need to create a NSMutableArray of CGPoint, how can I make it became a pointer? ... addO

Re: Outlet from Different Implementation?

2008-09-16 Thread Graham Cox
On 16 Sep 2008, at 5:53 pm, Jeshua Lacock wrote: However, I tried using the valueForKey method as suggested, and I get a message "___TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION___". Hrrrm. OK, that seems a bit odd. I dunno why that's happening, - valueForKey: is supposed to be able to find ivars

Re: Can't get to work setDoubleAction on NSMatrix with NSButtonCell

2008-09-16 Thread Oleg Krupnov
Thanks Graham. I have checked your DrawKit demo and indeed everything seems identical except that your code works and mine does not :) Well, I ended up with copy/pasting the XIB of your tool palette and its associated window controller and then completely replacing your code with mine. Guess what

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
I didn't think about NSValue, thanks. Do you mean valueWithPointer? Cheers, chr On Tue, Sep 16, 2008 at 11:00 AM, Phil <[EMAIL PROTECTED]> wrote: > On Tue, Sep 16, 2008 at 9:18 PM, Christian Giordano > <[EMAIL PROTECTED]> wrote: >> Hi guys, I'm finding myself trying to add to mutable containe

Re: structs in Mutable containers

2008-09-16 Thread Phil
On Tue, Sep 16, 2008 at 9:18 PM, Christian Giordano <[EMAIL PROTECTED]> wrote: > Hi guys, I'm finding myself trying to add to mutable containers like > NSMutableDictionary or NSMutableArray instead of NSObjects subclasses, > just structs. For instance in a NSMutableDictionary the key was an > integ

structs in Mutable containers

2008-09-16 Thread Christian Giordano
Hi guys, I'm finding myself trying to add to mutable containers like NSMutableDictionary or NSMutableArray instead of NSObjects subclasses, just structs. For instance in a NSMutableDictionary the key was an integer defined with #define. In this case I sort it with: ... forKey:[[NSNumber alloc] ini

Re: Outlet from Different Implementation?

2008-09-16 Thread Jeshua Lacock
On Sep 15, 2008, at 11:12 PM, Graham Cox wrote: You need to write an accessor method to return it, as written above what you're doing isn't supported automagically. You could access it as a named property: float foo = [[MyContent valueForKey:@"MyOutlet"] floatValue]; but when you consider

Re: NSXMLParser and character entities?

2008-09-16 Thread Kai
On 15.9.2008, at 22:24, Nathan Kinsinger wrote: On Sep 15, 2008, at 1:45 PM, Kai wrote: Of course if the content really is XHTML you should really be using an HTML parser and not an XML one. No, it isn’t. Just needs some way to encode all German characters. I’ll have to investigate wh