Re: Objective-C Question

2013-03-14 Thread Richard Heard
Your logic is clearly flawed. This only seems to replace occurrences of $ with the word DOLLAR. Also, if you are dealing with large strings, you could always use one of the below idioms to reduce memory pressure. @autoreleasepool { } or NSAutoreleasePool *pool = [[NSAutoreleasePool alloc]

Re: Objective-C Question

2013-03-14 Thread Jean-Daniel Dupas
Le 14 mars 2013 à 11:12, Richard Heard heard...@gmail.com a écrit : Your logic is clearly flawed. This only seems to replace occurrences of $ with the word DOLLAR. Also, if you are dealing with large strings, you could always use one of the below idioms to reduce memory pressure.

Re: Objective-C Question

2013-03-14 Thread Fritz Anderson
And run the thing under Instruments, which would undoubtedly have shown memory usage spiking even with modest data sets. — F On 14 Mar 2013, at 5:40 AM, Jean-Daniel Dupas devli...@shadowlab.org wrote: Le 14 mars 2013 à 11:12, Richard Heard heard...@gmail.com a écrit : Your logic is

Re: Setting the position of new windows

2013-03-14 Thread Steve Mills
On Mar 13, 2013, at 17:29:11, Seth Willits sli...@araelium.com wrote: On Mar 13, 2013, at 2:38 PM, Steve Mills wrote: That's an idea. I was hoping there was some way to say this is the frame for the first new window, but all others should respect it AND then go ahead and cascade down from

CoreData: sorting on a computed attribute

2013-03-14 Thread Laurent Daudelin
I have a need to sort a CoreData table on one attribute in a table that needs to be derived from a calculation. I read about Non-Standard Persistent Attributes and did google and the only way I found to make it work is according to the following: So, suppose I have an entity Entity:

'Pseudo' Singleton in Objective C

2013-03-14 Thread Pax
I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want one instance of the Information class to be

Re: Snapping windows while moving

2013-03-14 Thread Steve Mills
On Mar 13, 2013, at 18:26:01, Seth Willits sli...@araelium.com wrote: On Mar 13, 2013, at 8:34 AM, Ken Thomases wrote: The Window Server moves most windows entirely without involving the app (until the move is completed). Minor detail… while the window is being moved the app has no idea

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Jens Alfke
On Mar 14, 2013, at 11:22 AM, Pax 45rpmli...@googlemail.com wrote: My issue is that I only want one instance of the Information class to be loaded at a given time (and therefore only one information window on screen at a given time). If the information window is already loaded and it is

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Alex Zavatone
Matt Galloway's example is the one to run with IMO. http://www.galloway.me.uk/tutorials/singleton-classes/ You're pretty close though. Matt's examples and explanation should put you in the right direction. Any reason why you're not using ARC? ___

forward decls vs #import

2013-03-14 Thread Luther Baker
Given today's computing power, is there a strong case that can be made for or against the general use of forward declarations? I grew up using them as a best practice in C++ projects ... but more recently, several seniors Obj-C devs have suggested that they prefer #import in the .h files.

Problems with gesture recognizer child view controller

2013-03-14 Thread Timothy Reaves
In my iOS app, I had a single primary view controller. This controlled three views, one of which had a gesture recognizer. This worked well. However, as the code grew, refactored this into three view controllers, as the primary view controller was doing too much, and it was beginning

Image Processing using Cocoa: newbee question

2013-03-14 Thread Lars Sonchocky-Helldorf
Hi, I've never before done image (pixel) data processing in Cocoa before. Now I've heard of QuartzComposer and Core Image Units as the way to go nowadays. But, a big but comes here: When I process the image I need to have random access to all pixels because I want to do some floyd steinberg

Re: forward decls vs #import

2013-03-14 Thread Mills, Steve
On Mar 14, 2013, at 18:52, Luther Baker lutherba...@gmail.com wrote: Given today's computing power, is there a strong case that can be made for or against the general use of forward declarations? It really depends on the size of your project. The projects I've worked on throughout my career

Re: forward decls vs #import

2013-03-14 Thread Kyle Sluder
On Thu, Mar 14, 2013, at 04:51 PM, Luther Baker wrote: Given today's computing power, is there a strong case that can be made for or against the general use of forward declarations? I grew up using them as a best practice in C++ projects ... but more recently, several seniors Obj-C devs

Re: forward decls vs #import

2013-03-14 Thread Lee Ann Rucker
On Mar 14, 2013, at 4:51 PM, Luther Baker wrote: Given today's computing power, is there a strong case that can be made for or against the general use of forward declarations? I grew up using them as a best practice in C++ projects ... but more recently, several seniors Obj-C devs have

Re: Setting the position of new windows

2013-03-14 Thread Seth Willits
On Mar 14, 2013, at 8:13 AM, Steve Mills wrote: On Mar 13, 2013, at 17:29:11, Seth Willits sli...@araelium.com wrote: On Mar 13, 2013, at 2:38 PM, Steve Mills wrote: That's an idea. I was hoping there was some way to say this is the frame for the first new window, but all others

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Seth Willits
On Mar 14, 2013, at 11:22 AM, Pax wrote: I don't really know how to describe what I'm trying to do except as a 'Pseudo' Singleton. I have a class with an NSWindow, which displays information. It is run by selecting an NSMenuItem called 'More Information…' My issue is that I only want

Re: forward decls vs #import

2013-03-14 Thread Jens Alfke
On Mar 14, 2013, at 4:51 PM, Luther Baker lutherba...@gmail.com wrote: but more recently, several seniors Obj-C devs have suggested that they prefer #import in the .h files. Oh god, no. Who says that?! Importing a header just because it defines a class you’re using is a major waste. The

Re: Image Processing using Cocoa: newbee question

2013-03-14 Thread Jeffrey Robert Kelley
Lars, It’s not as high-level as Core Image, but here’s a good primer on obtaining raw pixel data: http://mikeash.com/pyblog/friday-qa-2012-08-31-obtaining-and-interpreting-image-data.html - Jeff Kelley On Mar 14, 2013, at 8:01 PM, Lars Sonchocky-Helldorf

Re: Setting the position of new windows

2013-03-14 Thread dangerwillrobinsondanger
On 2013/03/15, at 0:13, Steve Mills smi...@makemusic.com wrote: On Mar 13, 2013, at 17:29:11, Seth Willits sli...@araelium.com wrote: On Mar 13, 2013, at 2:38 PM, Steve Mills wrote: That's an idea. I was hoping there was some way to say this is the frame for the first new window, but

Re: Typesetter - Fragment Generation

2013-03-14 Thread Seth Willits
Responding to myself, here: 1) When I dump rich text into the text view, this method is called *twice* for each starting glyph index, and the proposed rect for the second call is the proposed rect I modify during the first call. For plain text it's only called once for each line. Any