• 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: Switching Contents of NSView
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Switching Contents of NSView


  • Subject: Re: Switching Contents of NSView
  • From: Pierce Freeman <email@hidden>
  • Date: Sun, 05 Jul 2009 16:35:22 -0700
  • Thread-topic: Switching Contents of NSView

Once again, I fail when the documentation succeeds.  I¹ll have to work on my
documentation reading skills over the next week or so.


On 7/5/09 4:33 PM, "Andy Lee" <email@hidden> wrote:

> Make sure you heed this part of the documentation:
>
>> This method causes oldView to be released; if you plan to reuse it, be sure
>> to retain it before sending this message and to release it as appropriate
>> when adding it as a subview of another NSView.
>
>
> --Andy
>
> On Jul 5, 2009, at 7:26 PM, Pierce Freeman wrote:
>
>> I am finally reverting to using NSView's replaceSubview:with: command.  The
>> only problem is that when I run this command partnered with addSubview, it
>> removes the view from the window where I placed it originally.  This is
>> problematic when I try to go back and forth between views as the application
>> can no longer find the view and then crashes.  Any suggestions?
>>
>>
>> On 7/5/09 3:21 PM, "I. Savant" <email@hidden> wrote:
>>
>>> On Jul 5, 2009, at 6:18 PM, Pierce Freeman wrote:
>>>
>>>> I am making an application that has a choice of what function the
>>>> user wants
>>>> to perform.  When the user clicks on their choice, I want a NSView
>>>> to take
>>>> on the contents of a specific nib file.  I assume there must be a way
>>>> (hopefully) easy that this is accomplished with, as most
>>>> applications must
>>>> do something like this with their user interface.
>>>
>>>
>>>    Do you need help figuring out how to load the NIB[1], replace the
>>> view[2], or both?
>>>
>>> 1 - http://cocoadevcentral.com/articles/000064.php
>>> 2 - -[NSView replaceSubview:with:] -
>>> http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Clas
>>> se
>>> s/nsview_Class/Reference/NSView.html#//apple_ref/occ/instm/NSView/replaceSub
>>> vi
>>> ew:with:
>>>
>>>
>>> --
>>> I.S.
>>>
>>>
>>>
>>>
>>
>>
>> _______________________________________________
>>
>> 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:
>>
>> This email sent to email@hidden
>
>

_______________________________________________

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:

This email sent to email@hidden

References: 
 >Re: Switching Contents of NSView (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Switching Contents of NSView
  • Next by Date: Re: Switching Contents of NSView
  • Previous by thread: Re: Switching Contents of NSView
  • Next by thread: Re: Switching Contents of NSView
  • Index(es):
    • Date
    • Thread