Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView crashing on scroll+update



On 7/31/07, Marcelo Alves <email@hidden> wrote:
> Hi,
>
>    I'm working with NSTableView and Cocoa Bindings. Things are
> working fine, but, NSTableView crashes (log below) when I update my
> NSMutableSet while scrolling the NSTableView (with ~300 items). If
> I'm not scrolling, work as expected. My first (and only one) guess
> was locking the set, like :
>
>         -(void) replaceRoomsWith:(NSArray *)newRooms {
>                 NSSet *new_set = [NSSet setWithArray:newRooms];
>                 [self willChangeValueForKey:@"rooms"
> withSetMutation:NSKeyValueUnionSetMutation usingObjects:new_set];
>
>                 @synchronized(rooms){
>                         [rooms unionSet:new_set];
>                 }
>
>                 [self didChangeValueForKey:@"rooms"
> withSetMutation:NSKeyValueUnionSetMutation usingObjects:new_set];
>         }
>
>    But it didn't work. What should I do to avoid this annoying problem?
>
>    Some extra information :
>
>    - The application is multithreaded (ok, only extra thread), based
> on Communicating With Distributed Objects [1], but I'm doing all the
> changes in the set in the main thread;

Are you sure you are only updating on the main thread?

Why the use of @synchronized in the above if updates only take place
on the main thread?

-Shawn
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden

References: 
 >NSTableView crashing on scroll+update (From: Marcelo Alves <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.