• 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
How to design a good application?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to design a good application?


  • Subject: How to design a good application?
  • From: HAEUPL Friedrich <email@hidden>
  • Date: Tue, 11 Dec 2001 13:26:35 +0100

I'm writing a program, that loads data from a data file into an NSData object.
Then the application should allow to open a window for visualisation.

For loading the data I use an instance of NSObject called MyObject:

@interface MyObject : NSObject
{
NSData *Data;
}
- (void) awakeFromNib;
- (BOOL) dataloaded;
- (NSData*) getsubData;
- (IBAction)myShowAction:(id)sender
- (IBAction)loadImage:(id)sender;
- (IBAction)saveImage:(id)sender;
@end

For the visualisation of the data I create programmatically

@interface MyView : NSView
{
}
- ...
- (void)drawRect:(NSRect)rects;
@end

The part of the program (im MyObject.m ) that creates the visualisation window is ...

- (IBAction)myShowAction:(id)sender
{
NSRect myRect=NSMakeRect(0, 0, 300, 300);

myWindow=[[NSWindow alloc] initWithContentRect:myRect
styleMask:NSTitledWindowMask .... backing:NSBackingStoreBuffered
defer:NO];
[myWindow useOptimizedDrawing:YES];

myView=[[MyView alloc] initWithFrame:myRect];
[myView setFrame:[myWindow frame]];

[myWindow setContentView:myView];
[myWindow makeKeyAndOrderFront:self];
....
}

In myview/drawRect I have to access the Data loaded in the NSData Object.
(methods dataloaded and getsubData). But somehow it seems, that this is
not possible.

How can I access the methods dataloaded and getsubData of MyObject
in the drawRect methode of MyView ?

Thanks,
Fritz


  • Follow-Ups:
    • Re: How to design a good application?
      • From: Markus Hitter <email@hidden>
  • Prev by Date: Re: Damn sisters :-)
  • Next by Date: Re: NSOpenPanel and ".app" fileType and aliases
  • Previous by thread: Re: Starting the screensaver from code
  • Next by thread: Re: How to design a good application?
  • Index(es):
    • Date
    • Thread