On Mar 19, 2013, at 9:44 PM, Kyle Sluder wrote:

> On Tue, Mar 19, 2013, at 09:36 PM, Seth Willits wrote:
>> I haven't tried with Instruments, just NSZombieEnabled. I take it you do
>> see the crash without Instruments?
> 
> Yes, I do. And as Andy pointed out, it eventually does crash in
> Instruments, but holy cow does it create a lot of NSDictionaries!!

Yes, the performance in this example is terrible, but it shouldn't be relevant. 
In the real-world there's a cached dictionary for each token type so it reuses 
that unless it can tell it should be different for some reason. Either way it 
still crashes, but I figured having the cache would be "suspect code" so I just 
removed it.



On Mar 19, 2013, at 5:31 PM, Andy Lee wrote:

> I wonder if init is too early to be setting the default paragraph style. When 
> I changed that line in your setup method to the following, it no longer 
> crashed on launch.
> 
>    [self performSelector:@selector(setDefaultParagraphStyle:)
>               withObject:[NSParagraphStyle defaultParagraphStyle]
>               afterDelay:0];

I think rather than it being a case of -init being too early, it's that 
avoiding it in this circumstance avoids the crash. I've encountered the same 
crash at various times — field will load with text but deleting it and pasting 
new text will cause the crash, or the field loads from the nib fine but not 
manually,  it works with methods A B and C but not B C and D…  There are many 
ways to avoid the crash, but fundamentally I'm sure there's a problem still 
lurking, it would just be triggered later on.


--
Seth Willits





_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to