• 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
Re: Please help..... NIL Object problems...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Please help..... NIL Object problems...


  • Subject: Re: Please help..... NIL Object problems...
  • From: Graham Wihlidal <email@hidden>
  • Date: Wed, 1 Aug 2001 03:01:19 -0600

Hmmmmm. Difficult to say... how and when the 'window' variable is filled?

Looks to me that when you call the display method from outside, you skip the
initialization (which fills the variable) somehow.

I have the variable declared by an instantiated class in IB which has an appropriate outlet, and in the class source header file it is declared like so

Here is the source:

GSSLSocket.h
*********************************************
#import <Cocoa/Cocoa.h>

@interface GSSLSocket : NSObject {
NSWindow* connectStatusWindow;
}
+ (GSSLSocket*)sharedGSSLSocket;
- (void)displayConnectStatus:(id)sender;
@end




GSSLSocket.m
*********************************************
#import "GSSLSocket.h"

GSSLSocket *mainGSSLSocket = nil;

@implementation GSSLSocket

+ (GSSLSocket *)sharedGSSLSocket;
{
if (mainGSSLSocket == nil)
mainGSSLSocket = [[self alloc] init];
return mainGSSLSocket;
}

- (void)displayConnectStatus:(id)sender
{
[connectStatusWindow center];
[connectStatusWindow makeKeyAndOrderFront:self];
}

@end


Calling this method (displayConnectStatus:nil) works fine in this source file, but calling:

[[GSSLSocket sharedGSSLSocket] displayConnectStatus:nil]; does not work

The class instance is created correctly because I tried adding an NSLog to the method and calling it the above way and it does indeed fire. It just doesn't have a set variable to work with.

I would really appreciate some help.

Thanks,

Graham


  • Prev by Date: Overriding [NSDocument saveDocumentTo]
  • Next by Date: Need Help with Help
  • Previous by thread: Please help..... NIL Object problems...
  • Next by thread: Re: Please help..... NIL Object problems...
  • Index(es):
    • Date
    • Thread