• 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
newbie question about progress bars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

newbie question about progress bars


  • Subject: newbie question about progress bars
  • From: "Ryan Bartig" <email@hidden>
  • Date: Sat, 16 Nov 2002 20:37:08 -0500

I created a small simple project with a button and a progress bar. I
subclassed NSObject then added an action and a outlet. I then instantiated
the new class and control dragged from the object to the progress bar to
connect to create the connect for the outlet. Then I control dragged from
the button to the object to connect it to the action. After that I created
the two files (.h & .m) in the project. When I click the button nothing
happens and am totally lost. Attached below is the code, any help would be
greatly appreciated. Thanks in advance.

/* progress_bar (.h file) */

#import <Cocoa/Cocoa.h>

@interface progress_bar : NSObject
{
IBOutlet id progressView;
NSTimer *timer;
}
- (IBAction)pushedButton:(id)sender;
@end

// beginning of .m file
#import "progress_bar.h"

@implementation progress_bar

- (void)awakeFromNib
{
srandom(time(NULL));
}

- (IBAction)pushedButton:(id)sender
{
if([sender state] == 1)
{
NSLog(@"Starting");

timer = [[NSTimer scheduledTimerWithTimeInterval:0.2 target:self
selector:@selector(checkTime:) userInfo:nil repeats:YES] retain];

} else {
NSLog(@"Stopping");

[timer invalidate];
[timer release];
}
}

- (void) checkTime: (NSTimer *) aTimer
{
NSLog(@"check");
[progressView incrementBy:10];
}

@end





_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE* http://join.msn.com/?page=features/junkmail
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
  • Prev by Date: Re: C callback functions in Cocoa
  • Next by Date: Re: (OT) Some realities
  • Previous by thread: Re: That Obj-C/Java Req -- Re: Jobs
  • Next by thread: [ANN]TDCBTableCells Palette v1.0 released
  • Index(es):
    • Date
    • Thread