On 24/01/2013, at 4:48 PM, Nick Rogers <[email protected]> wrote:

> The text fields to update are on the main window.



> The code is simple. just updating the text fields on the main window, using 
> setStringValue:@"some string".
> Now I am doing this using performSelectorOnMainThread:.



Okaaayyy.....


This is indicative of a poor design, sorry to say. You haven't separated the 
concerns in one part of your app from another. It's not necessarily pertinent 
to your crash, but bad design often  covers up those sorts of issues, making 
debugging hard and difficult to spot when you read through the code.

A sheet should have its own controller and this controller should have sole and 
limited responsibility for the controls and elements within the sheet ONLY.

It is up to you to design the methods that the sheet presents to its clients 
(e.g. the document that brings the sheet up) and any protocols necessary such 
that this principle is maintained. That way you have separated the internal 
design of the sheet from the internal design of its client, and neither needs 
to know about the other, except where they communicate through their public 
interface which constitutes the sole contract between them.

Basically, if your sheet is touching text fields that belong to another object, 
you've cut corners too far and need to revise that. I bet if/when you do the 
crashing bug will reveal itself as obvious.

--Graham


_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to