NSRect 情報を含む通知を投稿する最良の方法は何ですか?
これが私の現在のソリューションです(NSStringFromRectを使用)。
- (void)postNotificationForDirtyRect:(NSRect)rect
{
NSDictionary *userInfo =
[NSDictionary dictionaryWithObject: NSStringFromRect(rect)
forKey: ILDirtyRect];
NSNotificationCenter *ncenter = [NSNotificationCenter defaultCenter];
[ncenter postNotificationName: ILDocumentBecomeDirtyRectNotification
object: self
userInfo: userInfo];
}
ただし、これが rect 構造体を送信する最良の方法であるかどうかはわかりません。