I'm new to mac development. I've used NSSplitView
to divide my view.
when I select the field from the left side of split view, the selected view has been displayed on the right side of split view.
Now the problem is that when I press an button on the selected view controller on the righ to go from that view controller to another the action is not been performed.
- (IBAction)newProductAction:(id)sender {
[self replaceViewWithCurrentView:@"nP" productImageValue:0 andProductId:([ItemModel getMaxValueOfItemIdFromItemBit:[appDelegate getDBPath]] + 1)];
}
#pragma mark - Replace Current View To Product View
- (void)replaceViewWithCurrentView:(NSString *)actionInfo productImageValue:(int)pIV andProductId:(int)itemIde {
ProductDataIMViewController *pDIMVC = [[ProductDataIMViewController alloc] initWithNibName:@"ProductDataIMViewController" bundle:nil];
pDIMVC.senderInfo = actionInfo;
pDIMVC.itemIdentity = itemIde;
float frameWidth = [pDIMVC view].frame.size.width;
float frameHeight = [pDIMVC view].frame.size.height;
[[pDIMVC view] setFrame:CGRectMake(0, 0, frameWidth, frameHeight)];
[self.view.superview replaceSubview:self.view with:pDIMVC.view];
}
How can I fix this problem?