Re: Yosemite NSCollectionView appropriate for spreadsheet-like view?

2016-05-03 Thread Robert Clair
Model your spread sheet on a (hypothetical 2-D)TableView. Maintain a pool of cells starting with enough to cover the view at the default size plus a bit of margin. As cells scroll off the view return them to the pool; as you need new ones get them from the pool. If the pool is empty you alloc

Re: Cocoa-dev Digest, Vol 10, Issue 307

2013-05-22 Thread Robert Clair
NSData *source = // whatever NSRange myRange = // whatever NSData *subrangeOfSource = [source subdataWithRange: myRange]; On May 18, 2013, at 3:00 PM, cocoa-dev-requ...@lists.apple.com wrote: > Send Cocoa-dev mailing list submissions to > cocoa-dev@lists.apple.com > > To subscribe or u

Re: Garbage Collection Docs Puzzle

2010-01-25 Thread Robert Clair
> The issue being worked-around is that of the compiler; during > optimization, if you stop referencing myData, [snip] Yes. As I said, I understand the issue - my only question was whether the short-circuited retain was enough to do it. I didn't know whether the compiler did this or the runtime

Garbage Collection Docs Puzzle

2010-01-25 Thread Robert Clair
The garbage collection docs section on the interior pointer issue shows this example: NSData *myData = [someObject getMyData]; [myData retain]; const uint8_t *bytes = [myData bytes]; NSUInteger offset = 0, length = [myData length]; while (offset < length) { // bytes remains valid until next

Snow Leopard turns CMYK jpegs green

2009-09-09 Thread Robert Clair
Cocoa has problems with CMYK jpegs. Going from Tiger to Leopard it became ambivalent about whether a CMYK pixel value of 0, 0, 0, 0 meant black or white. (I remember reading somewhere that there is an ambiguity in the jpeg standard.) You can see this with Preview. Get yourself a CMYK tiff

Re: bad behavior from unlockFocus on 10.6

2009-09-03 Thread Robert Clair
Hi Ken - > This all worked fine until 10.6. The original NSImage object was left unmolested. Nope. :-) Clearly you're seeing behavior change somewhere, but this attribution is not correct. -[NSImage lockFocus] is a commonly misunderstood method. It is and always has been lossy. No

bad behavior from unlockFocus on 10.6

2009-09-03 Thread Robert Clair
I have this piece of code in my drawing program: [image lockFocus]; NSBitmapImageRep* bitmapRep = [[NSBitmapImageRep alloc] initWithFocusedViewRect: NSMakeRect( 0.0, 0.0, width, height) ]; [image unlockFocus]; image is an NSImage with a single representation, either

download security hanging app - It's a more general Problem + Solution

2008-12-19 Thread Robert Clair
It seems to be a more general bug with runModalForWindow: If anything grabs the focus while the app is starting (i.e. something that would require you click on the dock icon to get the app back - which the warning does) the modal window never becomes visible. I can see the same thing by st

download security hanging app

2008-12-18 Thread Robert Clair
I have an app that puts up a registration window if it is not registered when it starts. (The usual 30 day buy later / by now / enter license kind of thing.) The app is distributed by downloading a dmg. I put the window up with: [NSApp runModalForWindow: licensePanel]; which is called from - (

Re: Remove overlap on NSBezierPath

2008-07-14 Thread Robert Clair
tially you have to have some checks on the final result and be prepared to fail gracefully. RObert Clair ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: BezierPath issue

2008-02-24 Thread Robert Clair
Not trying to be rude here, but this is so confused that it is hard to figure out what you are trying to do. * What do you mean by "light drawing functions" ? * What is "self" here ? What object is this a method for ? * If you are trying to draw, where is the connection to the location info