Skip to content

Commit 522448e

Browse files
committed
• Lazy Data Source behaves properly now when objects are deleted, by watching for SSYManagedObjectWillUpdateNotification (which had been called constNoteWillUpdateObject).
• Did some work on the Inspector Showing problem, but it still does not work in all cases.
1 parent c95ab9f commit 522448e

4 files changed

+15
-7
lines changed

SSYDocChildObject.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ - (void)setDocument:(BkmxDoc *)document {
1919
}
2020

2121
- (id)initWithDocument:(BkmxDoc*)document_ {
22-
self = [super init];
22+
self = [super init] ;
2323

2424
if (self != 0) {
2525
[self setDocument:document_] ;

SSYManagedObject.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#import <Cocoa/Cocoa.h>
22

33
// Public Notifications
4-
extern NSString* const constNoteWillUpdateObject ;
4+
extern NSString* const SSYManagedObjectWillUpdateNotification ;
55
extern NSString* const SSYManagedObjectWillFaultNotification ;
66

77
// Keys inside Notification UserInfo Dictionaries
@@ -183,7 +183,7 @@ extern NSString* const constKeyNewValue ;
183183
forSetKey:(NSString*)setKey ;
184184

185185
/*!
186-
@brief Posts a constNoteWillUpdateObject notification.
186+
@brief Posts a SSYManagedObjectWillUpdateNotification notification.
187187
188188
@details This is a workaround for Apple Bug 6624874, using Solution 2.
189189

SSYManagedObject.m

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#import "NSEntityDescription+SSYMavericksBugFix.h"
1010

1111
// Public Notifications
12-
NSString* const constNoteWillUpdateObject = @"willUpdateObject" ;
12+
NSString* const SSYManagedObjectWillUpdateNotification = @"SSYManagedObjectWillUpdateNotification" ;
1313
NSString* const SSYManagedObjectWillFaultNotification = @"SSYManagedObjectWillFaultNotification" ;
1414

1515
// Keys inside Notification UserInfo Dictionaries
@@ -347,16 +347,16 @@ - (void)postWillSetNewValue:(id)value
347347
#if 0
348348
#warning Logging postWillSetNewValue:forKey:
349349
NSLog(@"7120: Posting %@ with object: %@\nwith oldValue: %@\nwith info:\n%@",
350-
constNoteWillUpdateObject,
350+
SSYManagedObjectWillUpdateNotification,
351351
[self shortDescription],
352352
[[self valueForKeyPath:key] shortDescription],
353353
[info shortDescription]) ;
354354
#endif
355-
[[NSNotificationCenter defaultCenter] postNotificationName:constNoteWillUpdateObject
355+
[[NSNotificationCenter defaultCenter] postNotificationName:SSYManagedObjectWillUpdateNotification
356356
object:self
357357
userInfo:info] ;
358358
/* In BookMacster version 1.3.19, I tried changing the above line to this…
359-
NSNotification* notification = [NSNotification notificationWithName:constNoteWillUpdateObject
359+
NSNotification* notification = [NSNotification notificationWithName:SSYManagedObjectWillUpdateNotification
360360
object:self
361361
userInfo:info] ;
362362
[[NSNotificationQueue defaultQueue] enqueueNotification:notification

SSYSearchField.m

+8
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ - (void)appendToRecentSearches:(NSString*)newString {
5151

5252
if (![[self recentSearches] isEqualToArray:recentSearches]) {
5353
[self setRecentSearches:recentSearches] ;
54+
/* I have twice seen a crash here, when the above method attempts
55+
to post a notification. Could not reproduce after that. Crash
56+
occurs when framework method attempts to post a notification.
57+
But I could not identify the notification because Xcode gives
58+
me the "couldn't materialize struct" crap when I ask for values
59+
in registers $rdi $rdx $rsi. I looked through my code, Apple
60+
documentation and have no idea what notification would be posted.
61+
*/
5462
}
5563

5664
[recentSearches release] ;

0 commit comments

Comments
 (0)