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] i

Re: Objective-C Question

2013-03-14 Thread Jean-Daniel Dupas
Le 14 mars 2013 à 11:12, Richard Heard 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. > > > @autoreleasep

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 wrote: > Le 14 mars 2013 à 11:12, Richard Heard a écrit : > >> Your logic is clearly flawed. This only seems to r

Re: Setting the position of new windows

2013-03-14 Thread Steve Mills
On Mar 13, 2013, at 17:29:11, Seth Willits 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 there," be

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": @imple

'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 loade

Re: Snapping windows while moving

2013-03-14 Thread Steve Mills
On Mar 13, 2013, at 18:26:01, Seth Willits 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 it's > hap

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 i

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? ___ C

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. Initial

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 lik

Re: forward decls vs #import

2013-03-14 Thread Mills, Steve
On Mar 14, 2013, at 18:52, "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? It really depends on the size of your project. The projects I've worked on throughout my career would be slow as mu

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 dev

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 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 respe

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 wa

Re: forward decls vs #import

2013-03-14 Thread Jens Alfke
On Mar 14, 2013, at 4:51 PM, Luther Baker 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 only times you should

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 wrote: > Hi, > > I

Re: Setting the position of new windows

2013-03-14 Thread dangerwillrobinsondanger
On 2013/03/15, at 0:13, Steve Mills wrote: > On Mar 13, 2013, at 17:29:11, Seth Willits 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 i

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

Re: Objective-C Question

2013-03-14 Thread Dave
On 13 Mar 2013, at 09:24, Markus Spoettl wrote: On 3/13/13 9:36 AM, Dave wrote: On 12 Mar 2013, at 21:34, Graham Cox wrote: On 13/03/2013, at 6:53 AM, Dave wrote: If that is the case, then how do you signal to the compiler/ analyzer that you are returning a retained object? In genera

Re: Another Gnarly Objective-C Question!

2013-03-14 Thread Dave
On 13 Mar 2013, at 09:13, Jean-Daniel Dupas wrote: Le 13 mars 2013 à 01:55, Wim Lewis a écrit : On 12 Mar 2013, at 2:08 AM, Graham Cox wrote: in a + method, [self class] === self. Once you've got that, you've got it. You're overthinking this. A class method is just an instance metho

Re: 'Pseudo' Singleton in Objective C

2013-03-14 Thread Oliver Fuchs
Hi, Firstly, I'm assuming the more information button is the only location which triggers displaying/redisplaying. if thats the case I would just store the instance of your class in a property and make sure it will be created only once. You can accomplish this by simply overwriting the getter