Noob question with printf error
Noob question with printf error
- Subject: Noob question with printf error
- From: Matthew Brewer <email@hidden>
- Date: Mon, 19 Jun 2006 23:35:10 -0400
Hey all, I'm not familiar with Cocoa or any OOP for that matter, with
a solid basic understanding of C and a Cocoa guide here on my lap.
I'm trying to get a basic app up and running, as a sort of
entertainment for tonight. I don't get any compile errors (there's
more than this, but problem has to lie in this bit of code) but
nothing ever shows up when I use the "build and run" in xcode. I get
the box, but my prompt never pops up. Am I missing something pretty
obvious here? Calling [MyGenerator getBoundaries] should call a
printf() but I'm not even getting that far in the program, as far as
I can tell.
Thanks for the input!
Matt
generator.h
#import <Cocoa/Cocoa.h>
#import <objc/Object.h>
@interface Generator : Object {
int first,
last;
double square;
}
-(void) getBoundaries;
@end
generator.m
#import "generator.h"
@implementation Generator
-(void) getBoundaries {
printf("Please enter the starting value: \n");
scanf("%d", &first);
printf("Please enter the ending valud: \n");
scanf("%f", &last);
} @end
main.m
#import "generator.h"
int main(int argc, char *argv[])
{
Generator *MyGenerator = [Generator new];
//Get the lower and upper numbers
[MyGenerator getBoundaries];
}
_______________________________________________
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