• 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
MVC problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MVC problem


  • Subject: MVC problem
  • From: Luc Vandal <email@hidden>
  • Date: Fri, 11 Feb 2005 15:49:56 -0500

Hi!

I'm new at developping on Mac with Cocoa and I'm experimenting. I have a problem with MVC. I have my controller class that calls a function to my model class but the model class function isn't called. In debug mode, if I try to do a step into the model class function, it won't! It just goes through the line like nothing was there! I get no error or warnings while compiling. I've followed the Currency Converter. The only difference is that the controller class derives from NSWindowController and not NSObject... here's my code:

/* VRAppModel */

#import <Cocoa/Cocoa.h>

@interface VRAppModel : NSObject
{
}
- (int)test;
@end

-----

#import "VRAppModel.h"

@implementation VRAppModel
- (int)test
{
int i = //VRStartApp();
return i;
}
@end

----

/* VRAppController */

#import <Cocoa/Cocoa.h>
#include <VRAppModel.h>

@interface VRAppController : NSWindowController
{
IBOutlet VRAppModel *appModel;
IBOutlet NSTextView *mainView;
IBOutlet NSTextView *statusView;
IBOutlet NSOutlineView *treeView;
}

----

#import "VRAppController.h"

@implementation VRAppController

//
// keyDown
// for shortcuts that are not available through the menu
//
/////////////////////////////////////////////////////////
-(void)keyDown:(NSEvent*)event
{
int i=0;
i = [appModel test]; //This line is disregarded!!!
}

What is the problem?
 _______________________________________________
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

  • Prev by Date: About Document Packages
  • Next by Date: Re: I'm leaking memory
  • Previous by thread: Re: About Document Packages
  • Next by thread: Re: MVC problem (solved)
  • Index(es):
    • Date
    • Thread