FROM : Audun Frøysaa
DATE : Sun Mar 23 11:28:06 2008
Hello.
I need some help with different controllers.
I have
mainController.h & .m
iTunesMainController.h & .m
I then tries to access a method in the iTunesMainController from the
mainController.
mainController.h
@class iTunesMainController;
@interface mainController : NSObject {
iTunesMainController *iTunes;
mainController.m
#import "iTunesMainController.h"
- (void)applicationDidFinishLaunching:(NSNotification *)notification{
[iTunes setPlayMode:NO];
}
iTunesMainController.h i have this after the interface.
- (void)setPlayMode:(BOOL)mode;
iTunesMainController.m
- (void)setPlayMode:(BOOL)mode
{
BOOL stat;
if(mode == NO)
{
[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"
to stop"];
stat = NO;
} else {
[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"
to play"];
stat = YES;
}
}
This doesn't work at all. I have brakepoint in the
iTunesMainController but it seems like its never executed. I am sure i
have done something wrong, but i can't see it and i do not now what i
can search for on google.
This is just a test project but any help is much appreciated.
-Audun
Sorry for typos :-)
DATE : Sun Mar 23 11:28:06 2008
Hello.
I need some help with different controllers.
I have
mainController.h & .m
iTunesMainController.h & .m
I then tries to access a method in the iTunesMainController from the
mainController.
mainController.h
@class iTunesMainController;
@interface mainController : NSObject {
iTunesMainController *iTunes;
mainController.m
#import "iTunesMainController.h"
- (void)applicationDidFinishLaunching:(NSNotification *)notification{
[iTunes setPlayMode:NO];
}
iTunesMainController.h i have this after the interface.
- (void)setPlayMode:(BOOL)mode;
iTunesMainController.m
- (void)setPlayMode:(BOOL)mode
{
BOOL stat;
if(mode == NO)
{
[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"
to stop"];
stat = NO;
} else {
[[NSAppleScript alloc] initWithSource:@"tell application \"iTunes\"
to play"];
stat = YES;
}
}
This doesn't work at all. I have brakepoint in the
iTunesMainController but it seems like its never executed. I am sure i
have done something wrong, but i can't see it and i do not now what i
can search for on google.
This is just a test project but any help is much appreciated.
-Audun
Sorry for typos :-)






Cocoa mail archive

