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: "Co

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 custo

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

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 ha

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

2010-06-02 Thread Ken Tozier
imes, your memory usage may grow senza any cache'ing that maybe happening. I would suggest putting a NSLog statement 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 wr

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

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) queueRequest:(NSU

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 serve

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

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 seconds

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 i5__

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 st

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 aggregat

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, op

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

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 incomin

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) inRan

Re: How to redraw a view in slow-motion

2011-06-19 Thread Ken Tozier
ayers 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 To

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 anima

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 t

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 st

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 inh

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: 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) mouseDown:(NSEve

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

+ (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

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: 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 par

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, NSText

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] 0x23c60e70>: Exception *** -[NSCFNumber location]: u

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 numberWi

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

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
hould > work. > > -Laurent. > -- > Laurent Daudelin > AIM/iChat/Skype:LaurentDaudelin > http://www.nemesys-soft.com/ > Logiciels Nemesys Software > laur...@nemesys-soft.com > > On Sep 18, 2010, at 09:14, Ken Tozier

DO problem with NSConnection/NSSocketPortNameServer

2010-09-23 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,

Flipped NSView + scaled NSAffineTransform = confusion

2010-09-30 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 tra

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 such

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 subs

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 doesn

Re: inline function problems

2010-10-17 Thread Ken Tozier
On Oct 17, 2010, at 3:05 PM, Kyle Sluder wrote: > Think about this for a second: "static" means file scope, so obviously you > can't reference the symbol from another file. And non-static inlines can't > actually be inlined because they may be called from elsewhere or have their > addresses ta

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) createThum

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

Where are window prefs stored?

2008-06-10 Thread Ken Tozier
Hi My app opens several palettes and uses the following line to store the palette positions [[self window] setFrameAutosaveName: @""]; I ran into a problem with the stored size and want to flush the old prefs and start over. Where are these types of prefs located and is it safe to just z

Programatically placing panels inside a window

2008-06-17 Thread Ken Tozier
Hi I'm not sure If I'm going about this the right way but I created a bunch of panels in IB and want to swap individual panels in and out of a window at runtime. Basically what I'm doing is making a master/ detail window where the items listed in the master are objects that handle editing

Re: NSGraphicsContext restore crashes my xtension

2008-07-27 Thread Ken Tozier
On Jul 27, 2008, at 7:09 PM, glenn andreas wrote: If you call [NSGraphicsContext currentContext] before your setCurrentContext:, what do you get back? Whatever that is, that's the context to restore with a second [NSGraphicsContext setCurrentContext: ] at the end... Pay no attention to w

Re: NSGraphicsContext restore crashes my xtension

2008-07-28 Thread Ken Tozier
On Jul 28, 2008, at 2:42 AM, Ken Ferry wrote: Graham's suggestion is also better because -[NSGraphicsContext setCurrentContext:] just releases the context that was previously current, as opposed to autoreleasing it. So this has a bug: NSGraphicsContext *originalContext = [NSGraphicsContext

Directly using NSString's "hash" (or equivalent) on unichar pointer

2008-03-04 Thread Ken Tozier
Hi I'm writing a generic parsing class and have one comparison method (isLiteral) I'd like to make as fast as possible. The basic question is: Does NSString use a hashing function that can be accessed without involving NSString? IE, is there a hashing function that can be used directly on

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: ] all you get are images with "NSCalibratedRGBColorSpace." Mo

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 ab

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 i

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

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? Mayb

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 = [NSMu

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

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: 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 wa

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 cgl

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 implement

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 pos

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

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: 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 perfe

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 wit

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: arrayCon

Re: Binding to custom NSCell

2009-02-12 Thread Ken Tozier
-Ken On Feb 12, 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 Obs

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 of

Re: Binding to custom NSCell [Solved]

2009-02-12 Thread Ken Tozier
On Feb 12, 2009, at 11:32 PM, Ken 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:

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 widget

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

2009-02-19 Thread Ken Tozier
as not edtable, they are in editable the table. I suspect it's just ignoring my tests inside tableView:dataCellForTableColumn:row: and just returning a generic text cell. How do I get the editability correct and get project name field to be wider than the page number field? On Feb

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 commen

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 neve

How to get strings like 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 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

Complicated set of dynamic nested views

2008-10-02 Thread Ken Tozier
Hi I need to create an interface with collapsible views (much like those in InterfaceBuilder's "inspector" palette) and am having a hard time figuring out what exactly to use as the base in IB 3.0. In older versions of IB, there was a "panel" view which allowed for this stuff, but that ap

IB plugins

2008-10-03 Thread Ken Tozier
Hi I'm working my way through the IB plugin documentation and have hit a point where step 2 in under "Configuring a Library Object Template" bears no resemblance whatsoever to anything in the Xcode project or the IB files. What the heck are they referring to? And how do I adapt that to th

Re: IB plugins

2008-10-03 Thread Ken Tozier
On Oct 3, 2008, at 4:10 AM, Joey Hagedorn wrote: Ken, Step 2 of this section says: "In the library window, select the Library > IB SDK group. This group contains a single entry, which is a library object template." It is referring to the "Interface Builder Kit" category of items (as oppo

More IB plugin confusion

2008-10-03 Thread Ken Tozier
Hi I encountered another puzzler in the IB plugin documentation. Under the "Plug-in quick start > Creating and Configuring Your Xcode Project" heading (http://developer.apple.com/documentation/DeveloperTools/Conceptual/IBPlugInGuide/Plug-inQuickStart/chapter_3_section_2.html#/ /apple_ref/doc

Accessing IB >Inspector > Identity > Interface Builder Identity > name programatically?

2008-10-04 Thread Ken Tozier
Hi I created a custom view with several subviews some of which I gave names in the "Identity > Interface Builder Identity > name" tab. Is there any way to reference these items by their given name if the nib is loaded programatically using NSNib? Thanks in advance

Bizarre [NSWindowController window] returning null

2008-10-04 Thread Ken Tozier
I created the following NSWindowController subclass which loads and displays a window without problem, but am finding that whenever I try to actually access the window with [NSWindowController window] it always returns null. - (id) init { NSBundle *bundle = [NSBundle bundleForClass:

Re: Bizarre [NSWindowController window] returning null

2008-10-04 Thread Ken Tozier
Bingo! Thanks Roland. On Oct 4, 2008, at 6:15 AM, Roland King wrote: did you connect the window outlet of Files Owner in interface builder to the window? On Oct 4, 2008, at 6:08 PM, Ken Tozier wrote: I created the following NSWindowController subclass which loads and displays a window

Can't bind image cells in a table to file's owner?

2008-10-04 Thread Ken Tozier
Hi My file's owner class has a method to return a file icon but I'm finding that when I do the following, it reverts back to "shared user defaults" whenever I select other things in the user interface. Here are my bind settings Value Bind to: file's owner Model Key Path: fi

Re: Can't bind image cells in a table to file's owner?

2008-10-04 Thread Ken Tozier
What could be causing this? I'm at my wit's end. On Oct 4, 2008, at 4:56 PM, Ken Tozier wrote: Hi My file's owner class has a method to return a file icon but I'm finding that when I do the following, it reverts back to "shared user defaults" whenever I s

Re: Can't bind image cells in a table to file's owner?

2008-10-04 Thread Ken Tozier
On Oct 4, 2008, at 8:16 PM, Quincey Morris wrote: After you choose File's Owner from the popup, and type the model key in the text field below, press Return or Tab, and verify that the check mark next to File's Owner has become checked. If you click away without committing the edit, the ch

Binding NSTableView Double Click argument and target to file's owner

2008-10-05 Thread Ken Tozier
Hi I'm trying to bind double click actions of an NSTableView to "file's owner" and can't figure out exactly how to set them up. My file's owner has a double click handler defined like so: - (void) handleDoubleClick:(NSNumber *) inRowIndex; Given that, how would I set up the bindings for bo

Handler not called on table cell edit

2008-10-12 Thread Ken Tozier
Hi I have a dynamically created table with one editable column (page number), but when I change the number and hit "return", my assigned handler never gets called. Here's how the cell is defined: pageCell = [[NSTextFieldCell alloc] init]; [pageCell setEditable: YES]; [pageCell setTarget: s

Re: Handler not called on table cell edit

2008-10-12 Thread Ken Tozier
y supplied action hander. Anything else jump out at you? On Oct 13, 2008, at 2:33 AM, Kyle Sluder wrote: On Mon, Oct 13, 2008 at 2:13 AM, Ken Tozier <[EMAIL PROTECTED]> wrote: Seems like it should be pretty straightforward. Anyone see what I'm doing wrong? Have you sent t

Re: Menu binding displaying serialized NSDictionary rather than specified field

2008-10-13 Thread Ken Tozier
endar"} note the '@' Chaitanya On 13-Oct-08, at 2:29 PM, Ken Tozier wrote: Hi I have a popup in a table cell I'm trying to bind, programatically, to a simple array of NSDictionaries and want to display a single field from each dictionary as the menu text. What I&

Menu binding displaying serialized NSDictionary rather than specified field

2008-10-13 Thread Ken Tozier
Hi I have a popup in a table cell I'm trying to bind, programatically, to a simple array of NSDictionaries and want to display a single field from each dictionary as the menu text. What I'm getting instead is the entire dictionary serialized as a menu item. Here's how I'm doing the bindin

"mutatingNodes" error when binding to an NSArray

2008-10-19 Thread Ken Tozier
Hi I'm working my first NSOutlineView app and trying to programatically bind the the "content" property of an NSOutlineView to a mutable "files" array property of a class and keep getting the following error in the console. *** -[PMProjectView _mutatingNodes]: unrecognized selector sent t

Re: "mutatingNodes" error when binding to an NSArray

2008-10-19 Thread Ken Tozier
I should add that if i change to a normal NSTableView, I don't get that error and everything basically works (except for the expand collapse functionality) so it seems to be something specific to NSOutlineViews. On Oct 19, 2008, at 7:26 AM, Ken Tozier wrote: Hi I'm workin

Need help programatically wiring up an NSTreeController to an NSOutlineView

2008-10-30 Thread Ken Tozier
Hi I've been Googling bindings, and reading the Apple bindings documentation for a week, but have gotten nowhere on this one. I desperately need help from someone who knows programmatic bindings. I have a class where I store all properties in an NSMutableDictionary and wrote a few accesso

Re: Need help programatically wiring up an NSTreeController to an NSOutlineView

2008-10-30 Thread Ken Tozier
On Oct 30, 2008, at 7:22 PM, Ron Lue-Sang wrote: Reverse the order here. Add the column to the outlineView and then bind it (the column). The binding for the column should be [nameColumn bind: @"value" toObject: tableController withKeyPath: @"arrangedObjects.name" options: nil]; And you d

Resorting NSOutlineView rows in response to edits

2008-10-31 Thread Ken Tozier
Hi I have a dynamically generated NSOutlineView that displays Projects and pages like so project name page 1 page 2 page 3 page 4 page 5 I got the page number editing working and it triggers other events (like writing the new page number to an SQL da

  1   2   >