Re: Blocks vs. life, the universe and everything

2011-10-14 Thread Jean-Daniel Dupas
Le 15 oct. 2011 à 01:45, Quincey Morris a écrit : > On Oct 14, 2011, at 14:27 , Greg Parker wrote: > >> Do you actually use exceptions in your code, or do you follow the Cocoa >> convention that exceptions are for programmer error only? If you don't use >> exceptions, then you can omit any try

Re: NSArrayController Update Delay

2011-10-14 Thread William Squires
What about performSelector:withObject:afterDelay: with a delay of 0.0, I believe, will perform the selector after the current iteration of the run loop. Not sure about thread safety, though. On Oct 13, 2011, at 10:17 PM, Steve Steinitz wrote: > Hi Richard, > > The advice you've received alread

Re: Blocks vs. life, the universe and everything

2011-10-14 Thread Quincey Morris
On Oct 14, 2011, at 14:27 , Greg Parker wrote: > Do you actually use exceptions in your code, or do you follow the Cocoa > convention that exceptions are for programmer error only? If you don't use > exceptions, then you can omit any try blocks and let the uncaught exception > handler log the f

Re: Simple PDF generation code not working as intended

2011-10-14 Thread Martin Wierschin
> I am trying a simple application to generate pdf from contents in a text view. Your content view is just a single NSTextView, which won't create a multi-page PDF for you. What you see on screen is what you get when you make a PDF. You need to create a chain of multiple NSTextView instances (o

Re: Blocks vs. life, the universe and everything

2011-10-14 Thread Greg Parker
On Oct 14, 2011, at 1:56 PM, Quincey Morris wrote: > The problem is that the documentation clearly states that exceptions must not > try to escape across dispatch queue operation boundaries. AFAICT, this means > that for every one of the tiny code block fragments I write, not only does my > frag

Blocks vs. life, the universe and everything

2011-10-14 Thread Quincey Morris
I'm rewriting for 10.7/ARC some code that (basically) trampolines status between threads to avoid affecting the UI from background threads. This time around I'm using blocks, and it turns out this *dramatically* simplifies the code, which is a good thing. However, I notice I have this pattern a

Re: -viewDidUnload not always called?

2011-10-14 Thread Fritz Anderson
On 14 Oct 2011, at 11:33 AM, David Rowland wrote: > Well, thank you. If you are interested, here is the companion diagram for > view controller loading, > > http://drowland.net/iOS%20Class/View%20Controller%20loading.pdf Perhaps I misunderstand. If I write MyViewController * vc = [[MyViewCo

Re: 'Static' items in an NSOutlineView

2011-10-14 Thread Quincey Morris
On Oct 14, 2011, at 09:24 , Koen van der Drift wrote: > I’m trying to find out how to create the grayish, static items in an > NSOutlineView, eg “Library” in iTunes or “Mailboxes” in Mail. > Sometimes they have a disclosure triangle, eg "Devices" in the Finder. > I think I need to subclass NSCell

Re: -viewDidUnload not always called?

2011-10-14 Thread John Joyce
Please also include URLs to actual pdfs in the ebook versions. Ebooks so often end up with very pixelated, hard to read images... On Oct 14, 2011, at 1:45 PM, Matt Neuburg wrote: > On Fri, 14 Oct 2011 09:33:01 -0700, David Rowland > said: >> Well, thank you. If you are interested, here is the c

Re: -viewDidUnload not always called?

2011-10-14 Thread Matt Neuburg
On Fri, 14 Oct 2011 09:33:01 -0700, David Rowland said: >Well, thank you. If you are interested, here is the companion diagram for view >controller loading, > >http://drowland.net/iOS%20Class/View%20Controller%20loading.pdf > >> >My understanding is this, a diagram I made to visualize the process

Re: 'Static' items in an NSOutlineView

2011-10-14 Thread Jens Alfke
On Oct 14, 2011, at 9:24 AM, Koen van der Drift wrote: > I’m trying to find out how to create the grayish, static items in an > NSOutlineView, eg “Library” in iTunes or “Mailboxes” in Mail. > Sometimes they have a disclosure triangle, eg "Devices" in the Finder. > I think I need to subclass NSCel

Re: Retain/Release and Properties clarification

2011-10-14 Thread Bayes Scott F
Agreed. I just meant in the general case. ScottB On Oct 13, 2011, at 11:30 , David Rowland wrote: > However, if the property is readonly I think you must use direct access to > set an initial value. The setter does not exist. > > > David Rowland > > On Oct 13, 2011, at 10:54 AM, Bayes Scot

Re: -viewDidUnload not always called?

2011-10-14 Thread Jon Sigman
On Friday, October 14, 2011 9:33 AM, David Rowland wrote: >Well, thank you. If you are interested, here is the companion diagram for view >controller loading, > http://drowland.net/iOS%20Class/View%20Controller%20loading.pdf Great! These are keepers! (Some of us do think in pictures). You should

Re: -viewDidUnload not always called?

2011-10-14 Thread David Rowland
Well, thank you. If you are interested, here is the companion diagram for view controller loading, http://drowland.net/iOS%20Class/View%20Controller%20loading.pdf David On Oct 14, 2011, at 8:59 AM, Jon Sigman wrote: > On Oct 13, 2011, at 8:02 AM, Fritz Anderson wrote: > > >My understandin

'Static' items in an NSOutlineView

2011-10-14 Thread Koen van der Drift
Hi, I’m trying to find out how to create the grayish, static items in an NSOutlineView, eg “Library” in iTunes or “Mailboxes” in Mail. Sometimes they have a disclosure triangle, eg "Devices" in the Finder. I think I need to subclass NSCell to change the font, etc. But I am not sure how to identify

Re: -viewDidUnload not always called?

2011-10-14 Thread Jon Sigman
On Oct 13, 2011, at 8:02 AM, Fritz Anderson wrote: >My understanding is this, a diagram I made to visualize the process, > >http://drowland.net/iOS%20Class/View%20Controller%20unloading.pdf Wow, that's awesome. I never understood viewController unloading before. I wish the Apple documentation

Re: CLLocationManager-related crash in iOS 5

2011-10-14 Thread Rick Mann
Oh, that's a good (and obvious) suggestion. Thanks! -- Rick On Oct 14, 2011, at 7:55 , Glenn L. Austin wrote: > If you're autoreleasing the object when you're called back, you should reset > the object's delegate (set it to nil) before autoreleasing it (and set your > instance variable to nil

Re: CLLocationManager-related crash in iOS 5

2011-10-14 Thread Glenn L. Austin
If you're autoreleasing the object when you're called back, you should reset the object's delegate (set it to nil) before autoreleasing it (and set your instance variable to nil, if you have one) -- or just keep the object around until -dealloc. On Oct 14, 2011, at 2:31 AM, Rick Mann wrote: >

Re: Reusing XCode 4 Core Data Model.

2011-10-14 Thread Ben
Wow that actually worked! Thanks Martin that was infuriating me yesterday. On 14 Oct 2011, at 10:08, Martin Hewitson wrote: > The following works for me in Xcode 4.2: > > 1) Choose either editor style > 2) Select the entities you want to copy in the left list view under Entities > and hit cmd-

Re: PDFKit reference count underflow with garbage collection

2011-10-14 Thread Alexander Reichstadt
Found b.bum's post at Thanks Am 14.10.2011 um 11:57 schrieb Alexander Reichstadt: > Hi, > > generating a PDF throws > > malloc: reference count underflow > > I have garbage collection turned on

PDFKit reference count underflow with garbage collection

2011-10-14 Thread Alexander Reichstadt
Hi, generating a PDF throws malloc: reference count underflow I have garbage collection turned on. The issue occurs here: returnData = [fullDoc dataRepresentation]; fullDoc is a PDFDocument. Thanks for any help Alex ___ Cocoa-dev mailing li

Re: Select model objects with NSTableView using cocoa bindings

2011-10-14 Thread Luc Van Bogaert
On 14 Oct 2011, at 00:21, Quincey Morris wrote: > On Oct 13, 2011, at 13:44 , Luc Van Bogaert wrote: > > Use a NSIndexSet property instead of a NSMutableIndexSet, and change the > property by assigning it a new (immutable) index set -- that is, via the > setter. > This works! Thanks for your

Re: CLLocationManager-related crash in iOS 5

2011-10-14 Thread Rick Mann
I figured out a little bit more. I make one request for location, then I call -stopUpdatingLocation and -autorelease the CLLocationManager from within the did-update callback. But in iOS 5, even after that, it still calls me back once more, at which time I'm -autoreleasing it a second time. Is

CLLocationManager-related crash in iOS 5

2011-10-14 Thread Rick Mann
My app seemed to run just fine prior to the GM release. Even ran on the seed fine (which appears to be the same build). My app tries to get the user location when it launches. It prompts, and if you say Allow, everything seems fine. But if you quit and re-launch, it crashes. The stack trace is

Re: Reusing XCode 4 Core Data Model.

2011-10-14 Thread Martin Hewitson
The following works for me in Xcode 4.2: 1) Choose either editor style 2) Select the entities you want to copy in the left list view under Entities and hit cmd-c. 3) Make sure the list view is in focus (click on some white space there) 4) Paste should now work with cmd-v. Cheers, Martin On O

Re: urlFromString creating bad URLs with string containing []

2011-10-14 Thread Mike Abdullah
Probably only moderately better, since at best you're saving spinning up a thread. Most important is that NSURLConnection is cancellable, and has delegate methods you can implement for more control. On 12 Oct 2011, at 20:21, Martin Linklater wrote: > Thanks Mike, > > At the moment I'm using