+ (void) initialize not getting called

2011-07-24 Thread Ken Tozier
Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global

Re: + (void) initialize not getting called

2011-07-24 Thread Ken Tozier
Thanks all. I figured out what I was doing wrong. I was expecting a higher level class (DBString) to call a DBWord method, when it bypasses DBWord altogether if it has shared data of it's own. If I delete all shared data, initialize is called correctly. On Jul 24, 2011, at 5:02 PM, Jens Alfke

Re: Animating handwriting

2011-06-24 Thread Ken Tozier
On Jun 24, 2011, at 4:05 AM, Uli Kusterer wrote: Come to think of it, you could probably manually click at even intervals on the stroke of every letter in characters written in the font you're using, record the click coordinates, and then draw bezier paths repeatedly, each time to one

Re: Animating handwriting

2011-06-24 Thread Ken Tozier
On Jun 24, 2011, at 8:41 AM, Gustavo Pizano wrote: Hello all. So it will be good idea then to create a Mac app that will record the imput from the mouse/pen in a character basis, then record each character and then pass a string to a method, divided the string in characters and draw each

Re: Animating handwriting

2011-06-23 Thread Ken Tozier
If you're writing with the mouse the following might help. It isn't done, still needs some sort of check in the drawRect method to know when you've drawn all the segments and you;ll need to adjust x/y values to the view you're drawing in, but it will get you started. - (void)

Re: Synthesised properties and additional actions

2011-06-22 Thread Ken Tozier
Hi all I just started using @properties this week, so probably don't understand the nuances, but after looking at Matt's sample code, reading the property related docs and doing some experimentation, I'm not sure I understand what problem he's trying to solve. Is he talking about overriding

Re: Synthesised properties and additional actions

2011-06-22 Thread Ken Tozier
For those of us new to @synthesize, would it be possible to get concrete examples of exactly what it does to create thread safety? What is Apple doing, under the hood, to provide this? For example: Say I have 3 properties, a float, a struct and an NSObject subclass. Written by hand they might

Re: Progress Indicators Spin vs Bar

2011-06-20 Thread Ken Tozier
Hi James, I recently finished a file routing app that does a lot of heavy duty operations to files and found that the combination of NSInvocationOperations/NSOperationQueue to be really programmer friendly. Among the stuff my app does is copy large image files from A to B, creates thumbnails

Re: How to redraw a view in slow-motion

2011-06-20 Thread Ken Tozier
Hi Matthias I got frustrated with my own coding and thought I'd take another crack at your animation problem as a diversion... Here's the result, enjoy -Ken #define DRAW_LINES_BLOCK_SIZE 100 #define DRAW_LINES_BLOCK_DELAY 1 - (void) setFrame:(NSRect) inRect { // I'm assuming you

CATransactions having no effect in CALayer draw delegate

2011-06-19 Thread Ken Tozier
HI I'm writing a subclass of CALayer and what I'm seeing is that regardless of whether I wrap CG drawing commands in a CATransaction, or not, it still animates. One of the properties of the subclass is a suppressAnimations BOOL which, if set, is used in the draw method to dispatch the incoming

Re: How to redraw a view in slow-motion

2011-06-19 Thread Ken Tozier
Have you tried CALayer/CAAnimation? They have a lot of power and are specifically designed for animation. If for some reason, you don't want to go that route, the following is a bit hokey, but it might work Add a subsetRange property to your view class Create a setSubsetRange:(NSRange) inRange

Re: How to redraw a view in slow-motion

2011-06-19 Thread Ken Tozier
myself, so I don't know exactly how to do this, but the complexity (and uglyness) of the roll-your-own solution makes CALayer look like an attractive option. - On Jun 19, 2011, at 9:57 AM, Matthias Arndt wrote: Hi Ken, Am 19.06.2011 um 15:40 schrieb Ken Tozier: - (void)observeValueForKeyPath

Re: CATransactions having no effect in CALayer draw delegate

2011-06-19 Thread Ken Tozier
On Jun 19, 2011, at 1:03 PM, Kyle Sluder wrote: You're mixing conceptual layers here. CG drawing isn't animated at all. The animation happens at the Core Animation layer. When CA asks your layer to -drawInContext: that's an atomic operation from CA's perspective. The thing getting animated

Re: CATransactions having no effect in CALayer draw delegate

2011-06-19 Thread Ken Tozier
On Jun 19, 2011, at 3:57 PM, Kyle Sluder wrote: Core Animation's view of the world ends when it hands you a CGContext and says fill this with bits. It can't animate the contents of a CGContext because a CGContext really is just an opaque bit receiver and associated drawing state. Even though

Re: Writing extremely large RTF or .doc files

2011-06-18 Thread Ken Tozier
On Jun 18, 2011, at 3:15 AM, Joar Wingfors wrote: That loops back to the original question though, does it not? Ie., if this document is really large, how would he do this HTML+CSS - RTF conversion? HTML documents are directly openable in Word. No conversion necessary. Write all the DB

Branch: Drawing noise in Cocoa (preferably fast)

2011-06-17 Thread Ken Tozier
Keying off Stephen's idea of drawing noise quickly, I came up with a solution that I can use for my own purposes. It seems like splitting up large image manipulations for execution on different processor cores could be a good introduction to GCD and blocks. I read the intro to GCD docs but am

Re: Writing extremely large RTF or .doc files

2011-06-17 Thread Ken Tozier
Is there some reason the text needs to be RTF? Is it just that you want to view this text formatted nicely at a future date? Or do you plan on distributing the monster RTF? If it's just nicely formatted text you're after would HTML with CSS serve just as well? If so, you could write an

Re: Writing extremely large RTF or .doc files

2011-06-17 Thread Ken Tozier
On Jun 18, 2011, at 1:18 AM, Dave DeLong wrote: It needs to be editable after the fact. Dave It is. If you open such a file in Word, it just looks like styled text. You can edit it and save it as html or RTF. Whichever you prefer. Try saving the following to a plain text file, open

Re: Drawing noise in Cocoa (preferably fast)

2011-06-16 Thread Ken Tozier
On Jun 16, 2011, at 12:34 PM, Stephen Blinkhorn wrote: A quick test on a 2GHz iMac takes at least twice as long 4.5 seconds to generate a 10,000 X 10,000 CGLayer of noise. Stephen Thanks. Difference could just be the processor. My laptop has a 2.4 GHz core

Re: Drawing noise in Cocoa (preferably fast)

2011-06-15 Thread Ken Tozier
Just curious, what kind of speed are you getting with the CIImage methods? I saw the usefulness of generating random images for my own purposes and polished the posted code a bit today. It was generating 100 million pixel images (10,000 x 10,000) with per-pixel randomization in about 2.2

Re: kvo

2011-06-14 Thread Ken Tozier
Have you tried NSInvocationOperations? They allow you to queue up your own handler and you could do any required checking in that Something like // init requestQueue in your class's init method // then whenever you need to queue up a url load // do something like this - (void)

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Ken Tozier
Is there any reason the noise has to be unique each time? Could you just generate a noise file and composite that over whatever you want? Unless you're doing something with cryptography, noise, is noise, is noise. It all basically looks the same so reusing a single file seems like it could

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Ken Tozier
I didn't test this (basically cut and pasted from some existing code I have) but it should run plenty fast #define RGB_BYTES_PER_PIXEL 3 - (NSBitmapImageRep *) noiseImageRepWithBaseRed:(float) inRed green:(float) inGreen blue:(float) inBlue

Problem using data in a distributed object

2011-05-30 Thread Ken Tozier
HI I wrote two apps that communicate through distributed objects and found this weird feature where if a string is distributed by one app, the receiving app can't use it to create other strings. For example str1 is vended from app A App B wants to take that string and append some text to the

Converting NSImage to cmtk yeilds green images

2011-01-14 Thread Ken Tozier
Hi I'm trying to write an NSImage category that converts an image to cmyk . It sort of works, in that it does produce a new image, but all images have a dark green cast to them and look sort of solarized or like negatives. Anyone point out what I'm doing wrong? Thanks for any help - (NSImage

CGImageForProposedRect not scaling image

2011-01-08 Thread Ken Tozier
HI I'm trying to use NSImage's CGImageForProposedRect method to scale an image but it's not doing it. I gat back an image the same size as the original. I've double-checked all my math and that seems to be right. Here's how it's being used anyone see where I'm going wrong? - (BOOL)

inline function problems

2010-10-16 Thread Ken Tozier
Hi I want to create some inline functions that are universally available within my app, but can't seem to get them working. If I define a set of inlines within a specific class, they compile, but If I take the same functions and move them to a dedicated inlines file and include that, it

Seriously confused by behavior of NSAffineTransform

2010-10-02 Thread Ken Tozier
Hi I'm trying to learn to use NSAffineTransforms and am finding their behavior so bizarre that they are all but useless. I've read the Cocoa drawing docs related to transforms, multiple times, and pored over the NSAffineTransform class docs for hours. I just don't understand why it's doing

Re: Seriously confused by behavior of NSAffineTransform

2010-10-02 Thread Ken Tozier
On Oct 2, 2010, at 9:22 AM, Matt Neuburg wrote: Perhaps it might be useful if you were to show some code? At least show where you're using a transform and what transform you're using. What does apply a scaling transform to a page view mean? A transform is just a way of affecting subsequent

Flipped NSView + scaled NSAffineTransform = confusion

2010-10-01 Thread Ken Tozier
Hi I have a custom view, which contains a number of subviews, where it is much more intuitive to the user if items appear from the upper left corner than the bottom left corner. Normally, I would just flip the view and the placement of subviews is what I expect. When I apply a scaled affine

DO problem with NSConnection/NSSocketPortNameServer

2010-09-24 Thread Ken Tozier
Hi I'm writing a client/server application and can't get a valid NSConnection when I try to use NSSocketPortNameServer This works, locally, but I need a connection that will work on the network server = [[NSConnection serviceConnectionWithName: @PMXServer rootObject: self

Re: DO problem with NSConnection/NSSocketPortNameServer

2010-09-24 Thread Ken Tozier
: port sendPort: nil]; [[NSSocketPortNameServer sharedInstance] registerPort: port name: inName]; [connection setRootObject: inRootObject]; return connection; } @end On Sep 24, 2010, at 10:47 AM, Ken Thomases wrote: On Sep 24, 2010, at 1:35 AM, Ken

Distributed object vending problem

2010-09-20 Thread Ken Tozier
Hi I'm writing two apps: A server and client and am having some trouble figuring exactly what to link to in the client program. The server application has a main class that has dozens of dependencies. I don't want to have to import all the server app dependencies into the client application as

Re: Distributed object vending problem

2010-09-20 Thread Ken Tozier
laur...@nemesys-soft.com On Sep 18, 2010, at 09:14, Ken Tozier wrote: Hi I'm writing two apps: A server and client and am having some trouble figuring exactly what to link to in the client program. The server application has a main class that has dozens

Re: Monster memory leak and I can't figure out why

2010-06-02 Thread Ken Tozier
at the beginning and look at your output window to make sure the code is not called more than you think. -Tony Romano On May 31, 2010, at 6:41 PM, Ken Tozier wrote: Hi I'm trying to write a thumbnailer class that takes a path to a photo and creates a thumbnail at a user specified size. The code

Monster memory leak and I can't figure out why

2010-06-01 Thread Ken Tozier
Hi I'm trying to write a thumbnailer class that takes a path to a photo and creates a thumbnail at a user specified size. The code creates the thumbnails OK, but there's this monster memory leak, to the tune of about 100 MB every 3-4 seconds, that seems to be related to NSImage. What's

Re: NSXMLParser choking on single quotes

2009-11-13 Thread Ken Tozier
On Nov 12, 2009, at 11:04 AM, Matt Neuburg wrote: On Thu, 12 Nov 2009 12:08:20 + (UTC), kentoz...@comcast.net said: I'm using NSXMLParser to parse XML output from Microsoft Word and am finding that if a string contains a single quote, the parser is only giving me the part of the string

Custom window not getting a shadow

2009-11-10 Thread Ken Tozier
Hi I'm writing a custom window class and am finding that even though I set the hasShadow property to YES, it isn't getting one. I stripped the following example down to the bare esentials but still no shadow. Anyone know why this might be happening? - (id) initWithSize:(NSSize) inSize

Re: Custom borderless window not getting it's shadow

2009-11-10 Thread Ken Tozier
I tried it both with content and without. Same result. Seems like of twitchy because I could have sworn that when I fort wrote the window a couple of days ago, it did have a shadow, matter of fact, I'm certain of it. Doesn't seem to have any effect progressively commenting out all the

Compile error using @synchronized on methods that return values

2009-11-08 Thread Ken Tozier
Hi I wrote a MySQL connection class and have found that when I use the accessors in multiple threads, the query results seem to be stomping on each other. I looked into using @synchronized(self) to bracket the calls to the lower level socket calls, I'm getting the following warning:

Not receiving notifications on NSArrayController selection changes

2009-07-05 Thread Ken Tozier
Hi I have an NSArrayController bound to an NSArray and am not getting notifications either through my setXXX method or through explicit addObserver links. The property in my class is defined like so: @interface PMXMainPaletteToolbar : NSView { IBOutletNSPopUpButton

Solved: Not receiving notifications on NSArrayController selection changes

2009-07-05 Thread Ken Tozier
Never mind. I figured it out. On Jul 5, 2009, at 11:58 PM, Ken Tozier wrote: Hi I have an NSArrayController bound to an NSArray and am not getting notifications either through my setXXX method or through explicit addObserver links. The property in my class is defined like so

Possible to set tab stops in an NSTextView?

2009-06-21 Thread Ken Tozier
Hi I'm working with an NSText view and want to display tab delimited strings in a table format. I don't need a full NSTable, just the ability to break up the text into columns using tab stops. Is there any built-in way to do this? Something like setTabStops? I looked in NSTextView,

Re: Possible to set tab stops in an NSTextView?

2009-06-21 Thread Ken Tozier
Thanks Ashley I tried your snippet, but am getting the following error: 2009-06-21 18:32:34.912 QuarkXPress[4956:10b] *** -[NSCFNumber location]: unrecognized selector sent to instance 0x300bc300 2009-06-21 18:32:34.914 QuarkXPress[4956:10b] NSATSTypesetter: 0x23c60e70: Exception ***

Re: Possible to set tab stops in an NSTextView?

2009-06-21 Thread Ken Tozier
Thanks Andrew. That worked. On Jun 21, 2009, at 7:04 PM, Andrew Farmer wrote: On 21 Jun 2009, at 15:44, Ken Tozier wrote: Here's how I interpreted your code NSArray *tabStops = [[[NSArray alloc] initWithObjects: [NSNumber numberWithInt

Re: Help with SHA class

2009-06-04 Thread Ken Tozier
On Jun 4, 2009, at 1:35 PM, Greg Guerin wrote: Why are you writing this algorithm? Practice mostly. I wrote a MySQL connector class in Cocoa, but had to copy the SHA and password scrambling code from the MySQL source. It works, but it's really ugly and I wanted to take a crack at that

Problems choosing an encoding for Word generated html

2009-05-31 Thread Ken Tozier
Hi I wrote an app that converts Word files into a simpler format by first converting from .doc to html using scripting and Word's Save as Web page command followed by using NSXMLDocument to extract the parts I need. I'm finding that there are no good options when it comes to choosing a

Re: warning 'NSEvent' may not respond to '+eventWithEventRef:'

2009-05-25 Thread Ken Tozier
. It is unavailable on Mac OS X 10.4 Tiger. If you want to write from Leopard only, set the base SDK of your target to the 10.5 SDK. Kiel On 26/05/2009, at 2:52 PM, Ken Tozier wrote: Hi I'm getting a warning when calling NSEvent's eventWithEventRef NSEvent *event = [NSEvent eventWithEventRef: ref

Affine transform not being applied to subviews

2009-05-21 Thread Ken Tozier
Hi I wrote a custom view that contains several other views and am having problems when applying an affine transform to the main view. The main view is a page and the two subviews are a crop view that displays page margins and a column view that displays the page columns. I've checked to

Re: Affine transform not being applied to subviews

2009-05-21 Thread Ken Tozier
: On 22/05/2009, at 12:52 PM, Ken Tozier wrote: - (void) drawRect:(NSRect) inRect { NSAffineTransform *transform = [self transform]; [transform concat]; [[NSColor whiteColor] set]; NSRectFillUsingOperation([self frame

Re: Scheduling a selector when a thread completes

2009-04-30 Thread Ken Tozier
On Apr 29, 2009, at 11:48 PM, Michael Ash wrote: Seems like you're adding a lot of complication for what is essentially a continually running operation. Instead of that, why not do this? 1. Spawn a thread. 2. Sample files. 3. Sleep. 4. Goto 2. Or, in code: - (void)threadMethod { while(1)

Re: create object from class name held in String?

2009-04-30 Thread Ken Tozier
NSClassFromString does what you want http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#/ /apple_ref/c/func/NSClassFromString On Apr 30, 2009, at 3:50 PM, Darren Minifie wrote: Hi everyone. I have the situation

Threadsafe function help

2009-04-30 Thread Ken Tozier
Hi I'm trying to write a general purpose console-like view and have most of the parts working except the convenience functions for adding attributed strings to an NSTextView subclass. Basically, what I want is to have a couple of functions that can be used like NSLog, but am finding that

Re: Threadsafe function help

2009-04-30 Thread Ken Tozier
On May 1, 2009, at 12:59 AM, Michael Ash wrote: It locks up is not a very useful description. Use the debugger and find out *where* it locks up. I bracket calls to my KCLog function like so NSLog(@about to call KCLog); KCLog(@testing 1, 2, 3); NSLog(@KCLog exe OK); And what I see in the

Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-23 Thread Ken Tozier
Thanks Quincey this helped. I'm getting scroll bars now. The new issue though is that when I set the size of the content view (document view?) the scroller's size changes to the new size of the content. I've checked and rechecked to make sure all the autosize parts are set up in IB

Could really use the help of a custom view expert

2009-03-23 Thread Ken Tozier
Hi I've been struggling with a set of complex views for my palette user interface and have literally been fighting with the same stupid issues off and on for almost a year. I've never, in my 15 years of programming come up against a problem as difficult as making a user interface using

How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ken Tozier
Hi I have a custom view inside a scroll view and all works nicely except when the custom view's contents exceeds the depth of the scroll view. The scroll bars don't appear. I created the scroll view in IB from a standard widget and did nothing more than set the class of default content

Re: How to get a scroll view to recognize overflow on a custom view?

2009-03-22 Thread Ken Tozier
I think my issue is slightly different. The scroll bars never appear, no matter how much overflow there might be. I generally don't have a problem using table views as they seem to have some built-in mechanism for notifying the scroll view that they are deeper than it is. I'm trying to

What's the best way to access top level objects loaded from a nib?

2009-03-16 Thread Ken Tozier
Hi I'm building up some complex custom views from other custom views etc, etc and am able to load nibs programatically and get the list of top level objects, but it just seems awkward to have to iterate over the list of items and do class tests to determine what I'm being handed. Is

Customizing an NSToolbar to wrap it's tools.

2009-03-14 Thread Ken Tozier
Hi I would like to customize an NSToolbar to make it's tools wrap rather than overflow, but I can't see any way to control the toolbar height. Is there some way to do this? I've had a lot of practice writing wrapping views but NSToolbar seems to be locked up pretty tight as far as how it

Re: Calling Script Objects in Applescript

2009-03-14 Thread Ken Tozier
Have you looked at OSAKit? It has methods for executing subroutines of scripts without having to do that initWithSource hack. You can find the header files here: /System/Library/Frameworks/ OSAKit.framework/Versions/A/Headers/ A couple of caveats about using it though. Subroutine names have

How to get strings like CSSDictionary: 0x126a70 for all objects

2009-02-22 Thread Ken Tozier
Hi I need to get unique identifiers for all objects I'm passed for use as keys in an NSMutableDictionary. I tried using hash but I don't know if that would really be unique. It seems like the console printout for classes with no description method would be perfect. I know how to get the

Re: How to get strings like CSSDictionary: 0x126a70 for all objects

2009-02-22 Thread Ken Tozier
%p did the trick, thanks! On Feb 22, 2009, at 9:23 AM, Andrew Farmer wrote: @%p will give a string representation of the address. However, if you're targeting 10.5 or later, you should probably consider NSMapTable instead - it implements this functionality for you without the overhead

Re: Need recommendations for best way to build a custom view

2009-02-20 Thread Ken Tozier
On Feb 19, 2009, at 9:59 PM, Kyle Sluder wrote: And have you set a breakpoint to see if your code is taking that path for all columns? I didn't try breakpoints but the NSLogs do the same thing and indicate that if you assign cells based on nil columns, from that point onward you are

Need recommendations for best way to build a custom view

2009-02-19 Thread Ken Tozier
Hi I'm trying to display documents in a specific way but am having a very hard time trying to figure out how to do it with any of Apple's built- in gui widgets. I've tried probably a half dozen different approaches over the last several months, but there doesn't seem to be any Apple

Re: Need recommendations for best way to build a custom view

2009-02-19 Thread Ken Tozier
Hmmm. When I add a nil column test, the resulting table has the correct number of rows and group rows appear, but it wipes out all the data the cells are supposed to display. By that I mean the table cells are all empty and uneditable. Data only appears in the cells if I remove or comment

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
24 hours later, still completely stumped on this one. The sticking point seems to be that Apple's NSTextFieldCell is doing something that is not clearly defined in the Key-Value Observing/Key-Value coding documentation to allow the following to work [column bind: @value toObject:

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
, 2009, at 6:18 PM, Corbin Dunn wrote: On Feb 12, 2009, at 1:18 PM, Ken Tozier wrote: 24 hours later, still completely stumped on this one. The sticking point seems to be that Apple's NSTextFieldCell is doing something that is not clearly defined in the Key-Value Observing/Key-Value coding

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
Just for kicks, I tried stepping back a level and making my cell a subclass of NSActionCell and that works too. So it seems that whatever magic Apple is performing happens inside NSActionCell. On Feb 12, 2009, at 11:09 PM, Ken Tozier wrote: Hmmm. Making my cell a subclass

Re: Binding to custom NSCell [Solved]

2009-02-12 Thread Ken Tozier
Tozier wrote: Just for kicks, I tried stepping back a level and making my cell a subclass of NSActionCell and that works too. So it seems that whatever magic Apple is performing happens inside NSActionCell. On Feb 12, 2009, at 11:09 PM, Ken Tozier wrote: Hmmm. Making my cell a subclass

Binding to custom NSCell

2009-02-11 Thread Ken Tozier
Hi I created a custom NSCell subclass, defined accessors for stringValue, setStringValue, objectValue ane setObjectValue. I set the data cell for a column like so: [column setDataCell: customCell]; And bind the column to an array controller: [column bind: @value toObject: controller

Re: Disabling sorting in a programatically generated table [SOLVED]

2009-01-31 Thread Ken Tozier
On Jan 31, 2009, at 1:19 PM, Keary Suska wrote: You don't have a binding between the table view and the array controller? Yes, sorry, misread your post. I had been binding with options: nil but when I passed in an options dict with NSCreatesSortDescriptorBindingOption , it worked

Disabling sorting in a programatically generated table

2009-01-30 Thread Ken Tozier
Hi I need to completely disable sorting in a programatically generated table, but have found that no matter what I try, clicking on the column header sorts the table. I've set the following sort descriptors to nil // On the table [table setSortDescriptors: nil]; // On the column [column

Re: Setting data cell type for a specific row

2009-01-26 Thread Ken Tozier
On Jan 26, 2009, at 7:45 PM, I. Savant wrote: ... sorry? How does implementing one delegate method that's directly targeted at the very problem you're trying to solve complicate things? I was confused about what to return from the method if I just wanted the data cell preserved as is.

this class is not key value coding-compliant ...

2009-01-18 Thread Ken Tozier
Hi I'm getting the runtime error this class is not key value coding- compliant for the key rootArray. for my app controller class, despite the fact that the controller absolutely, positively does have a rootArray accessor and that accessor is defined in both the interface and

Re: this class is not key value coding-compliant ...

2009-01-18 Thread Ken Tozier
On Jan 18, 2009, at 10:24 AM, glenn andreas wrote: You're binding to the Application (i.e., NSApp) and not your app controller instance? Yep. That was the problem. Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not

Re: Basic: How to go about implementing such a view?

2009-01-05 Thread Ken Tozier
This looks like a good fit for CGLayers. http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_layers/chapter_13_section_1.html#/ /apple_ref/doc/uid/TP30001066-CH219-TPXREF101 The background and color bars could be a plain old bitmap images drawn into

Re: Discovering host to use in rootProxyForConnectionWithRegisteredName:host:

2008-12-28 Thread Ken Tozier
I got my terminology mixed up. Wherever you see local domain substitute domain of the computer vending the distributed object On Dec 28, 2008, at 2:58 AM, Ken Tozier wrote: Hi I'm trying to set up a distributed object client, but can't see any way to get the local domain (not localhost

Discovering host to use in rootProxyForConnectionWithRegisteredName:host:

2008-12-27 Thread Ken Tozier
Hi I'm trying to set up a distributed object client, but can't see any way to get the local domain (not localhost) to use in rootProxyForConnectionWithRegisteredName:host: The documentation for NSConnection states that: The host name. The domain name hostName is an Internet domain name

Re: NSCalendar/NSDate - generating all months/days in a year

2008-12-23 Thread Ken Tozier
On Dec 22, 2008, at 2:30 PM, mmalc Crawford wrote: No! This is precisely the direction in which not to go: Important: Use of NSCalendarDate strongly discouraged. It is not deprecated yet, however it may be in the next major OS release after Mac OS X v10.5. For calendrical calculations, you

Re: NSCalendar/NSDate - generating all months/days in a year

2008-12-22 Thread Ken Tozier
Fun problem Basically it's safe to assume 24 hours in a day for date calculation (check details at Wikipedia) so you just have to get January 1 of the target year, January 1 of the subsequent year and increment until the time interval between them equals zero. This makes no assumptions

Thread crashing problem

2008-12-22 Thread Ken Tozier
Hi I wrote a little app to do deep folder watching on Windows servers from a Mac and am getting crashes when directories are added or removed from the watch directory. The directory scanning takes place in a thread and I tried to isolate the array from outside changes by locking it, but

Re: Thread crashing problem

2008-12-22 Thread Ken Tozier
Found a partial solution but it's ugly. If I copy the array before enumerating it, no more crashes, but I'd prefer to not add that overhead... On Dec 22, 2008, at 9:24 AM, Ken Tozier wrote: Hi I wrote a little app to do deep folder watching on Windows servers from a Mac and am getting

Re: Thread crashing problem

2008-12-22 Thread Ken Tozier
How would one share a lock? Should I make it a property of the class? And then what? According to the NSLock documentation, multiple calls to tryLock are a no no, so how does one determine the current state of a lock? I didn't see any methods like isLocked On Dec 22, 2008, at 10:12 AM,

Re: Thread crashing problem

2008-12-22 Thread Ken Tozier
On Dec 22, 2008, at 10:30 AM, Kyle Sluder wrote: Nowhere does the documentation say this. You can't call -[NSLock lock] multiple times, because you'll block on a lock you already have (that's why we have recursive locks). Otherwise -[NSLock tryLock] would be quite useless, wouldn't it?

Re: NSCalendar/NSDate - generating all months/days in a year

2008-12-22 Thread Ken Tozier
Following everyone's advice, I came up with the following, more compact, solution - (NSDictionary *) dates:(int) inYear { NSMutableDictionary *result = [NSMutableDictionary dictionary]; NSMutableArray *days =

Color space for cmyk eps images converting to rgb

2008-12-21 Thread Ken Tozier
Hi If you open an eps image in a text editor like BBEdit, you can see clearly what color space it was saved as but when you create an NSImage from the file and call [image representations] or [image bestRepresentationForDevice: printer device dict here] all you get are images with

Cleanup inside a failed init method

2008-12-06 Thread Ken Tozier
Hi I'm writing my own socket class using a bunch of BSD functions and am a little unclear on exactly what I should be doing to insure everything is cleaned up if any of the low level functions fail. If I return nil from my init, does the system call my dealloc method to allow proper

Re: Cleanup inside a failed init method

2008-12-06 Thread Ken Tozier
It's a matter of preference I guess. In practice, I can't think of any reason to connect to a server unless you intend to talk to it, so I just wrapped up all the ugliness into a nice simple interface. Creating one of my KClientSockets, connects to the host and retrieves any handshake data

Re: Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc

2008-12-06 Thread Ken Tozier
On Dec 6, 2008, at 6:45 PM, Andrew Farmer wrote: This is incorrect. A connection refused error in this context means that you're either trying to connect to a host/port which is not configured to accept a connection, or the host is behind a firewall which blocks incoming connections. In

Re: Programmatically loading an NSImage via other field

2008-12-04 Thread Ken Tozier
as the awake from NIB call, or do I need to add the awakFromNIB as well? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ken Tozier [EMAIL PROTECTED]: Something like this should get you in the ballpark MyController : NSObject { IBOutlet NSTextField

Re: Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc

2008-12-04 Thread Ken Tozier
OK. After reading the docs on NSStream, here's what I came up with. - (BOOL) openStreamsWithMode:(MySQLConnectMode) inMode { [NSStream getStreamsToHost: host port: port inputStream: inStream outputStream: outStream]; if ((inStream != nil) (outStream != nil)) {

Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc

2008-12-03 Thread Ken Tozier
Hi I'm working my way through the Distributed Objects documentation and am confused about when to use NSConnection, NSInputStream, NSOutputStream etc. The PictureBrowser example project doesn't even seem to use NSConnection and does its thing just fine. Reading the NSConnection docs, I

Re: Programmatically loading an NSImage via other field

2008-12-03 Thread Ken Tozier
Something like this should get you in the ballpark MyController : NSObject { IBOutlet NSTextField*imagePathField; IBOutlet NSImageView*imageView; } // register controller to receive messages from the text field - (void) awakeFromNib { [imagePathField

Re: Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc

2008-12-03 Thread Ken Tozier
Positive Spin Media http://www.positivespinmedia.com On Dec 3, 2008, at 8:22 PM, Ken Tozier wrote: Hi I'm working my way through the Distributed Objects documentation and am confused about when to use NSConnection, NSInputStream, NSOutputStream etc. The PictureBrowser example project doesn't even

Re: Big picture relationships between NSConnection, NSInputStream, NSOutputStream etc

2008-12-03 Thread Ken Tozier
Thanks Mike Still trying to get my head around this stuff, but here's how I interpret what I need to do... Create a connection to MySQL #define DEFAULT_MYSQL_PORT_NUMBER 3306 socket = [[NSSocketPort alloc] initRemoteWithTCPPort: DEFAUT_MYSQL_PORT_NUMBER host: @some host];

Re: [MyClass class] returning superclass's class

2008-11-20 Thread Ken Tozier
@interface KOptionString : NSCharacterSet { } @end KOptionString *whiteTest = [KOptionString whitespaceCharacterSet], *hexTest = [KOptionString characterSetWithCharactersInString: @0123456789abcdefABCDEFxX]; NSLog(@whiteTest %@, [whiteTest class]); NSLog(@hexTest %@, [hexTest

Re: [MyClass class] returning superclass's class

2008-11-20 Thread Ken Tozier
. atze Am 20.11.2008 um 11:37 schrieb Ken Tozier: @interface KOptionString : NSCharacterSet { } @end KOptionString *whiteTest = [KOptionString whitespaceCharacterSet], *hexTest = [KOptionString characterSetWithCharactersInString: @0123456789abcdefABCDEFxX]; NSLog(@whiteTest

Re: [MyClass class] returning superclass's class

2008-11-20 Thread Ken Tozier
On Nov 20, 2008, at 8:43 AM, Ken Thomases wrote: You keep mentioning [MyClass class], except that's not what you're calling. You're invoking -class (the instance method, rather than the class method, by the way) on some object. That object is not an instance of MyClass or, in the case

Re: Wrapping C functions in Objective C proxy objects: naming convention?

2008-11-20 Thread Ken Tozier
Just out of curiosity, why do you need to send such common math operations to a soap request? Wouldn't it be easier to do simple stuff like calculations in your Soap class and only make requests for the unique services the endpoint provides? On Nov 20, 2008, at 12:27 AM, Austin Ziegler

  1   2   >