Consider the following code fragments:
@property (readonly) NSDictionaryController *loggedConfigsController;
_loggedConfigs = NSMutableDictionary.dictionary;
_loggedConfigsController = [NSDictionaryController.alloc initWithContent:self.loggedConfigs];
_loggedConfigsController.sortDescriptors = @[[NSSortDescriptor sortDescriptorWithKey:@"value" ascending:YES]];
_loggedConfigsController.preservesSelection = YES;
_loggedConfigsController.avoidsEmptySelection = YES;
_loggedConfigsController.selectsInsertedObjects = NO;
_loggedConfigsController.automaticallyRearrangesObjects = YES;
- (void)logEventWithTitle:(NSString *)title ident:(p_ident_t)ident {
// called from main queue and dispatch queues
NSString *identString = [self identStringForIdent:ident];
NSNumber *dictIdent = self.loggedConfigs[identString];
if (dictIdent == nil) {
NSDictionaryControllerKeyValuePair *c = self.loggedConfigsController.newObject;
c.key = identString;
c.value = title;
[self.loggedConfigsController addObject:c];// crash
}
}
Crash log:
Thread 4 Crashed:: Dispatch queue: Pinger #9
0 libobjc.A.dylib 0x7ff81bb7fcc3 objc_retain + 35
1 AppKit 0x7ff81f18d831 -[NSArrayController _setObjects:] + 49
2 AppKit 0x7ff81f18e502 -[NSArrayController _arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis:] + 365
Does anyone know why -addObject: fails?
Any help is appreciated. Thanks in advance!
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
What's the best way of capturing live video from the iPhone camera and streaming it over the network to another iPhone for display?
Ideally using Apple APIs only, on iOS 12 or later.
Create a new Project: macOS / App / Language: Objective-C
Create a new Cocoa Class. Name it “Foo”
Create a new Objective-C File. Name it “Bar”. Set File Type to “Category”. Set class to “Foo”. Click Next, then Create. Nothing happens.
FB13465308
Yes, I'm one of those old fashioned people who still use Objective-C...
In the new beta, NSStatusNone et. al. are either missing or not rendered.
Example screenshot is from Xcode, but other apps are also affected.
Filed as FB16822441
Topic:
UI Frameworks
SubTopic:
AppKit