Note that there are some explanatory texts on larger screens.

plurals
  1. POObject (holding NSMutableArray) has different content in parent/child class
    primarykey
    data
    text
    <p>I have thee classes: HopBill, HopBillController and HopBillSheetController. HopBill creates an object holding a NSMutableArray. For testing purposes I already add a row to the array in HopBill's <code>init</code> method. HopBillController.h has <code>#import "HopBill.h"</code> and the HopBillController.m initializes the object in it's <code>awakeFromNib</code> method: <code>aHopBill = [[HopBill alloc] init];</code>. So far so good. From HopBillController.m I can call methods to the aHopBill object. It retrieves the row inserted on init etc.</p> <p>HopBillSheetController is a child of HopBillController and is basically a sheet that pops up after pressing a button. And after filling in some fields it needs to add a row to aHopBill en close the sheet. In HopBillSheetController I have: </p> <p><code>#import "HopBillController.h"</code></p> <p><code>@interface HopBillSheetController : HopBillController {</code></p> <p>I can all methods from HopBillSheetController.m to retrieve the row inserted on init. All seems fine. However, when I fill in the fields in the sheet and press OK (in order to add a row to aHopBill) HopBillSheetController calls a method in HopBillController: <code>[super addHopAddition: [variety stringValue]];</code>. The row gets added, but when I retrieve all rows from aHopBill in HopBillController.m it returns only the row inserted on aHopBill's init. When I do the same from the sheet it returns the row inserted on aHopBill's init and the row I just added in the sheet.</p> <p>It is as if I have two aHopBill objects, but clearly this needs to be one single object. What am I doing wrong?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload