View object not accessible from controller object

  • I have a simple app that has a controller and a custom view object
    called VideoView.  My app was working fine until I started doing some
    interface improvements, and now I get exec_bad_access whenever the
    controller tries to send a message to the VideoView object.  I have
    figured out that, even though the VideoView object is initialized
    correctly when the nib file loads, and even though I connected
    VideoView  to the controller with an a controller outlet, it's as if
    the object isn't there.  In debugging, I can see that there is no
    object pointed to by the outlet (again, even though I connected it in
    IB).

    Does anyone know what would would cause this behavior?  I have tried
    everything I can think of, including deleting and recreating the
    VideoView object, and re-connecting to the controller in IB.
  • Hey Jason -

    At runtime, is the instance variable set to nil, or is it set to some
    random address that doesn't point to a VideoView object? And what
    exactly are you doing that causes the crash? Does something like
    videoView->iVar crash? or [viewView message].

    If it's [videoView message], then you've probably over released, or
    under retained your videoView and are messaging it after it's been
    dealloced. If it's videoView->iVar, then that would crash with either
    a nil, or garbage value.

    Hope that gives you the clue you need -
    Jon Hess

    On Nov 29, 2007, at 2:59 PM, Jason Horn wrote:

    > ontroller and a custom view object called VideoView.  My app was
    > working fine until I started doing some interface improvements, and
    > now I get exec_bad_access whenever the controller tries to send a
    > message to the VideoView object.  I have figured out that, even
    > though the VideoView object is initialized correctly when the nib
    > file loads, and even though I connected VideoView  to the controller
    > with an a controller outlet, it's as if the object isn't there.  In
    > debugging, I can see that there is no object pointed to by the
    > outlet (again, even though I connected it in IB).
    >
    > Does anyone know what would would cause this behavior?  I have tried
    > everything I can think of, including deleting and recreating the
    > VideoView object, and re-connecting to the controller in IB.
  • Jon,

    Thanks for the ideas. The object is definitely not there as if it were
    over released, except that I haven't touched it. It just gets
    instantiated on IB then the first time I message it, it's gone.  I
    solved the problem by creating a new project and bringing over all the
    code.  It must be some kind of Xcode bug.

    On Nov 30, 2007, at 3:37 AM, Jonathan Hess <jhess...> wrote:

    > Hey Jason -
    >
    > At runtime, is the instance variable set to nil, or is it set to
    > some random address that doesn't point to a VideoView object? And
    > what exactly are you doing that causes the crash? Does something
    > like videoView->iVar crash? or [viewView message].
    >
    > If it's [videoView message], then you've probably over released, or
    > under retained your videoView and are messaging it after it's been
    > dealloced. If it's videoView->iVar, then that would crash with
    > either a nil, or garbage value.
    >
    > Hope that gives you the clue you need -
    > Jon Hess
    >
    >
    > On Nov 29, 2007, at 2:59 PM, Jason Horn wrote:
    >
    >> ontroller and a custom view object called VideoView.  My app was
    >> working fine until I started doing some interface improvements, and
    >> now I get exec_bad_access whenever the controller tries to send a
    >> message to the VideoView object.  I have figured out that, even
    >> though the VideoView object is initialized correctly when the nib
    >> file loads, and even though I connected VideoView  to the
    >> controller with an a controller outlet, it's as if the object isn't
    >> there.  In debugging, I can see that there is no object pointed to
    >> by the outlet (again, even though I connected it in IB).
    >>
    >> Does anyone know what would would cause this behavior?  I have
    >> tried everything I can think of, including deleting and recreating
    >> the VideoView object, and re-connecting to the controller in IB.
    >
previous month november 2007 next month
MTWTFSS
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    
Go to today