• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSSearchField retaining NSDocument?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSSearchField retaining NSDocument?


  • Subject: Re: NSSearchField retaining NSDocument?
  • From: Adam Knight <email@hidden>
  • Date: Mon, 29 Aug 2005 08:01:51 -0500

Mea culpa. What little documentation I saw about toolbars when I very first implemented it did not explicitly detail that both the toolbar and the toolbar items should be returned autoreleased. Now the bindings work fine. Yay.

/kicks self

On Aug 28, 2005, at 8:23 PM, Adam Knight wrote:


The more I look at it the more odd it gets.

If I leave all the code in place and:

* remove the toolbar item then the current document still gets retained
* the next new document will not because it wasn't there when the document was created
* if I then add the toolbar item while a window is open, it closes fine
* ... and the next does not


So it seems that if the toolbar item is created with the document then the document gets one extra retain.

Is there anything I could look into, knowing that?

On Aug 27, 2005, at 11:58 PM, Adam Knight wrote:



I have an NSSearchField in an NSView that I made in Interface Builder. It's in the same NIB as the document and has no bindings setup in IB. Both are connected to my document via outlets. I have a toolbar item setup to use this view as an item.

If I track my document object without the search item then the document releases properly. When I add the search item and don't set it up, the document releases properly. When I add the following code:

[searchField bind:@"predicate"
toObject:entryController
withKeyPath:@"filterPredicate"
options:[NSDictionary dictionaryWithObjectsAndKeys:
@"Comments", NSDisplayNameBindingOption,
@"comments contains[cdw] $value", NSPredicateFormatBindingOption,
nil]
];


The document finishes closing with a retain count of 1. Remove the code and the document is released.

What could I be doing wrong here? How do I know what, exactly, is blocking the release of the document?



_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden



Adam Knight
will bug code for food
http://www.codepoetry.net/
I ♥ my 




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >NSSearchField retaining NSDocument? (From: Adam Knight <email@hidden>)
 >Re: NSSearchField retaining NSDocument? (From: Adam Knight <email@hidden>)

  • Prev by Date: How to change the Framework search path
  • Next by Date: Re: Information regarding UTF-8 code
  • Previous by thread: Re: NSSearchField retaining NSDocument?
  • Next by thread: Obj-C++: instantiating C++ type ivar within an obj-c class
  • Index(es):
    • Date
    • Thread