iPhone UIWebView height?

2009-03-14 Thread William Jon Shipley
Is it possible to set an HTML string on a UIWebView and have it resize automatically to the right height, but NOT take up the entire screen? I sure can't figure it out. I feel like the iPhone really HATES rich text. Here's what I've tried so far. Most of these are "Hail Mary" attempts, wh

iPhone color management?

2009-03-13 Thread William Jon Shipley
When we put PNG resources in our iPhone apps, what color space are they displayed under? I know PNGs are re-processed by Xcode (into illegal, but more- efficient, iPhone PNGs), are the color profiles embedded in PNGs used either at the re-processing time or at the time of drawing? As far a

Re: Can an object observe itself?

2009-03-07 Thread William Jon Shipley
Under Tiger and before, be sure to note the following caveat: Bug Fix in Observing A Key Path Of Self In Mac OS 10.3 and 10.4 there was a bug in which a debugging feature of KVO made it difficult for an object to observe one of its own values using a multicomponent key path: right before the

Re: Drawing Invalidation Question

2009-02-01 Thread William Jon Shipley
When inside of -[NSView drawRect:], what's the difference between - (void)drawRect:(NSRect)rect; { if ([self needsToDrawRect:someRect]) } - (void)drawRect:(NSRect)rect; { if (NSIntersectsRect(rect, someRect)) } The NSView keeps a list of the actual sub

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-27 Thread William Jon Shipley
Will thanks for the heads up, for my purposes this time around, the input stream will be coming in off the file system, but I did not want to load the whole thing into an NSData object. Ah! Well, your approach will work, but if your file is less than 4GB I highly recommend something like:

Re: Is there a more efficient way to get the first 4 bytes off a NSInputStream to compare

2009-01-27 Thread William Jon Shipley
[inputStream open]; [inputStream read: buffer maxLength:sizeof(buffer)]; ... Note that although your call to -read:maxLength: will work as you expect most of the time, it's not guaranteed to work and is bad practice. The docs for NSInputStream say this method will "Return the actual numb

Re: ObjC in time-critical parts of the code

2009-01-19 Thread William Jon Shipley
Simple question: Is it better to pursue a 20%, or even 50%, improvement in drawing speed by rewriting in C++ or C than, say, preventing the 2, 3, 4, or more extra redraws that are happening prior to window flush? Don't laugh -- I have seen it happen. Often. I subscribed to this list jus