Re: Memory Warnings

2014-10-08 Thread Quincey Morris
(reposted after editing for length) On Oct 7, 2014, at 22:12 , Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Is there a way for the app to find out how much memory it is currently using? Here’s my take on this, which may be way off base: There’s really no practical way to answer such

Re: Memory Warnings

2014-10-08 Thread Gerriet M. Denkmann
On 8 Oct 2014, at 13:42, Quincey Morris quinceymor...@rivergatesoftware.com wrote: (reposted after editing for length) On Oct 7, 2014, at 22:12 , Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Is there a way for the app to find out how much memory it is currently using? Here’s my

Re: Responsive scrolling: prepareContentInRect: not called

2014-10-08 Thread Antonio Nunes
On 08 Oct 2014, at 01:41, Ken Thomases k...@codeweavers.com wrote: Wondering if anyone has an idea of why prepareContentInRect: is not called for a view when responsive scrolling is enabled. We are using an NSScrollView subclass that overrides prepareContentInRect:. I would not expect

set maximum file size

2014-10-08 Thread 2551
Hi folks I have an app which needs to save some of its data into a log file. I have the method set up already for creating and appending the log file. However, I'd like to limit the file size and initiate a file turn over when it reaches a certain size. What is the best way to accomplish this?

Re: set maximum file size

2014-10-08 Thread Alex Zavatone
Why not check the file size before writing? If the file size your max, then get the length of the message you are about to write and trim that many chars from the front of the file before writing. Or append the message to your file and after writing, check the file size and trim the surplus

Re: set maximum file size

2014-10-08 Thread 2551
On 8 Oct 2014, at 21:08, Alex Zavatone z...@mac.com wrote: Why not check the file size before writing? Ah, yes, like a kid who picks up the binoculars fat-end first, I was looking at things the wrong way around (how to limit the size instead of getting the size and doing something with

Re: Memory Warnings

2014-10-08 Thread David Duncan
Once your application is in the background it becomes fair game for being terminated. So even if you're using a very reasonable mount of RAM, if you're in the background you can expect that if some other application needs the memory your application will be terminated. -- David Duncan @ My

Re: Responsive scrolling: prepareContentInRect: not called

2014-10-08 Thread Kyle Sluder
On Oct 8, 2014, at 2:53 AM, Antonio Nunes devli...@sintraworks.com wrote: Turns out the problem is a different, and of course, almost embarrassingly silly one. I misspelled the method name: prepareContentInrect rather than prepareContentInRect. Now that I’ve caught that and corrected it,

Waiting for a future runloop-based callback

2014-10-08 Thread Jens Alfke
I thought I understood runloops pretty well, but I'm running into a situation that's got me stumped. Basically it involves how to wait (block) for a future message-send that will be queued onto the current runloop. So I've started an asynchronous task that runs on a background thread. When the

Re: Waiting for a future runloop-based callback

2014-10-08 Thread Ken Thomases
On Oct 8, 2014, at 1:45 PM, Jens Alfke j...@mooseyard.com wrote: In some circumstances the program … runs a nested runloop like this: while (!taskIsComplete) [[NSRunLoop currentRunLoop] runMode: @myCustomMode beforeDate: [NSDate distantFuture]];

Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
On a related topic from my last post, looking at the equivalent situation but using GCD instead of runloops, the problem appears to be impossible. That is: * Code running on dispatch queue A starts some async task that will run on another queue B, and which will signal completion by using

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread davekeck .
* Now, how does queue A wait for the callback? It seems to be impossible: the only way for code running on queue A to receive the callback is to return back to the queue dispatcher, so if it tries to wait it simply blocks the queue, causing a deadlock. You could use some other signaling

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Seth Willits
On Oct 8, 2014, at 11:59 AM, Jens Alfke j...@mooseyard.com wrote: * Now, how does queue A wait for the callback? It seems to be impossible: the only way for code running on queue A to receive the callback is to return back to the queue dispatcher, so if it tries to wait it simply blocks the

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Ken Thomases
On Oct 8, 2014, at 1:59 PM, Jens Alfke j...@mooseyard.com wrote: * Code running on dispatch queue A starts some async task that will run on another queue B, and which will signal completion by using dispatch_async to call a completion block on queue A, passing it some result. * After the

UIWebView not scaling page (iOS8)

2014-10-08 Thread Diederik Meijer | Ten Horses
Hi list, I have a UIWebView inside a UITableViewCell that simply won’t scale the page to fit on iOS8. I have set it to scale pages to fit in IB and have also tried setting it in code, but it simply won’t do it. The UIWebView depicts a JPG image located at a web location. I had no trouble with

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
On Oct 8, 2014, at 12:06 PM, davekeck . davek...@gmail.com wrote: You could use some other signaling mechanism -- a dispatch_semaphore_t or NSConditionLock, for example. Yeah, but that doesn't work for the async mode, where I need a dispatch_async call to queue A to notify it. Maybe I'd

Creating a Photo Extension

2014-10-08 Thread Daniel Blakemore
Nothing leaves you feeling like a stroke victim more than doing something you know you've done before and having it fail all over the place. I'm trying to create a simple application with a dummy photo extension written in swift. I have already written an actual application with a photo

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Jens Alfke
On Oct 8, 2014, at 12:28 PM, Ken Thomases k...@codeweavers.com wrote: Queues are not like run loops nor threads. Your desire to have ongoing logic occur on a particular queue seems odd to me. I don't think it's odd to want an ongoing single flow of control for specific parts of the

Get text with hyphenation

2014-10-08 Thread Leonardo
Hi, I have to draw several lines of text, one by one, to an HTML page. I get the text from an NSTextView, iterating throught the text lines: lineRect = [layoutManager lineFragmentRectForGlyphAtIndex:index effectiveRange:lineGlyphRange]; index =

Re: Waiting for callback with GCD: impossible?

2014-10-08 Thread Ken Thomases
On Oct 8, 2014, at 3:15 PM, Jens Alfke j...@mooseyard.com wrote: On Oct 8, 2014, at 12:28 PM, Ken Thomases k...@codeweavers.com wrote: Queues are not like run loops nor threads. Your desire to have ongoing logic occur on a particular queue seems odd to me. I don't think it's odd to want

Table of TextViews

2014-10-08 Thread Charles Jenkins
I’m still struggling to create a single scrollview containing a stack of textviews. I created an object called “Subdocument” which has two important readonly properties: NSTextView* myView CGFloat myHeight myHeight returns myView's frame hight, but never less than 10. The Subdocument’s

Re: Table of TextViews

2014-10-08 Thread Ken Thomases
On Oct 8, 2014, at 8:59 PM, Charles Jenkins cejw...@gmail.com wrote: Now I try to bind the table. I select the Table View object and bind Table Content to the array controller’s arrangedObjects myView key path. Then I bind its Row Height to the array controller’s arrangedObjects myHeight key