Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
> That's exactly *why* I've been asking about it - so I can fix it (and explain > the fix) for the new edition: Sorry, I did not mean to imply 'many people have done it wrong because of this book'. What i Failed at saying was "but.. I've seen this pattern everywhere, even in Apple sample code, it

Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
mp;sa=X&ei=T-s_T76JEaOl0AW0y-iPDw&ved=0CGoQ6AEwCTgK#v=onepage&q=beginBackgroundTaskWithExpirationHandler&f=false That's an awful lot of broken code. On 18 February 2012 17:23, Fritz Anderson wrote: > On 18 Feb 2012, at 7:41 AM, steven Hooley wrote: > >&g

Re: __block __weak - am I doing this right?

2012-02-18 Thread steven Hooley
> The same issue came up again later the same day: > >__block UIBackgroundTaskIdentifier bti = [[UIApplication sharedApplication] >beginBackgroundTaskWithExpirationHandler: > ^{ >[[UIApplication sharedApplication] endBackgroundTask:bti]; >}]; > >

RE: How To Increment CALayer Retain Count?

2011-04-11 Thread steven Hooley
>> I know its not very popular, but I've disciplined myself to set all >> variables (including stack) to their low or unused state when finished >> with them. It helps locate reuse problems in Debug builds (and I >> really don't care a bit about the 3 cycles). The optimizer can remove >> it later i

Re: NSUndoManager retain/release of arguments - ad infinitum

2011-01-11 Thread steven Hooley
I don't mean to hijack this thread, but my first thought, for what it's worth is that either :- a) sort order is a property of the window, not your model and shouldn't be undoable at all. What happens if you want another view - say a grid view, with nice big icons - of the same data?. Should that

Re: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
ult so maybe it shouldn't be? Thanks On 10 August 2010 15:19, Graham Cox wrote: > > On 11/08/2010, at 12:12 AM, steven Hooley wrote: > >> Because CGFloat is typedef'd to float on 32bit and double on 64bit i >> have to swap between, eg,  atan and atanf depending on my

Re: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
nario and some useful macros might already exist. Thanks On 10 August 2010 14:10, lbland wrote: > hi- > > On Aug 10, 2010, at 8:42 AM, steven Hooley wrote: > >> Is there a preferred way to use the Math.h functions with CGFloats >> that is 32 and 64 bit safe? >> Do

Fwd: Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Sorry, 'safe' was a bad choice. I do care because i have compiler warnings. I have started defining macros for each function and thought i better check that they didn't already exist. Thankyou On 10 August 2010 14:54, Alastair Houghton wrote: > On 10 Aug 2010, at 13:42, s

Math.h functions with CGFloat

2010-08-10 Thread steven Hooley
Is there a preferred way to use the Math.h functions with CGFloats that is 32 and 64 bit safe? Do some Macros already exist somewhere? Should i even be using Math.h functions in Cocoa? Thanks ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Plea

Re: self = [super init], nil?

2010-05-11 Thread steven Hooley
Oh, i fondly remember when it used to support it. But anyway, this is off topic.. so i'll be quiet. On 11 May 2010 12:52, Joanna Carter wrote: > Le 11 mai 2010 à 12:36, steven Hooley a écrit : > >> Not really valid, given xcode doesn't support code coverage. > > Try G

Re: self = [super init], nil?

2010-05-11 Thread steven Hooley
> Fourth reason: it doesn't play well with code coverage. If the 'if' and > its body are on the same line then knowing that that line executed does > not tell you as much as it could if the body was on its own line. Not really valid, given xcode doesn't support code coverage.

Re: advancementForGlyph problem

2010-05-04 Thread steven Hooley
On 3 May 2010 02:00, David F. wrote: > >> How on earth are you determining that it "looks like the advancement >> should only be ~23.2" ? > > By counting pixels. > You mean, for example, the distance from the leftmost pixel of the 'A' to the leftmost pixel in the following glyph? My current think

Re: advancementForGlyph problem

2010-04-30 Thread steven Hooley
> The information I am getting back from advancementForGlyph doesn't > seem to be correct. Here are the glyph bounds and advancement for > the capital letter 'A' in Georgia 36pt: > > == A == > bounds x: -0.720703 > bounds y: 0.00 > bounds w: 25.699219 > bounds h: 25.294922 > advance w: 24.1523

Re: Bison/Yacc with Objective-C ?

2010-03-12 Thread steven Hooley
> Bloomin' magic! Thanks, Filip, it worketh well. Hardy souls all. > Tom W. Is it possible to see an example of how this might be used? I'd like to understand Bison/Yacc better and i think an example relevant to Cocoa / Objective-C would really help. Thanks, Steven ___

Re: NSDocument "save as" bug

2010-02-02 Thread steven Hooley
> "It all boils down to the point that this little popup that's added to the > panel to select the file type seems to be screwing everything up." Is the little popup loaded from a nib? Is the 'File's Owner' of the little popup's nib set to your document? Did you know that -awakeFromNib message is

Re: -NSMutableIndexSet shiftIndexesStartingAtIndex:by: weirdness

2009-09-17 Thread steven Hooley
Done. Refrence 7231673. Thanks all. 2009/9/17 Corbin Dunn : > > On Sep 17, 2009, at 6:23 AM, steven Hooley wrote: > >> - shiftIndexesStartingAtIndex:by: and >> -containsIndexesInRange:NSMakeRange: don't seem to play nicely >> together.. >>

-NSMutableIndexSet shiftIndexesStartingAtIndex:by: weirdness

2009-09-17 Thread steven Hooley
- shiftIndexesStartingAtIndex:by: and -containsIndexesInRange:NSMakeRange: don't seem to play nicely together.. Is this expected? NSMutableIndexSet *someIndexes = [NSMutableIndexSet indexSet]; [someIndexes addIndex:0]; [someIndexes addIndex:2]; [someIndexes shiftIndexesStartingAtIndex:2 by:-1];

Unit Tests - mainWindow, keyWindow

2008-03-03 Thread steven Hooley
When running my application's tests i cannot figure out why the NSWindow and NSApplication properties relating to the keyWindow and mainWindow (and others that depend on them, like NSDocumentController's currentDocument) are always null. I have my application configured as the 'Test Host' for it