.h
IBOutlet UIImageView *test;
@property(nonatomic,retain) IBOutlet UIImageView *test;
.m
@synthesize test;
-(void)boundsCheck {
if(test.center.x > self.view.bounds.size.width || test.center.x < 0) {
NSLog(@"you hit the X axis boarder");
}
}
i have an image that im moving around and im trying to see if it will send me a message in my log, when ever i drag the image over to the x axis bound. Can someone help me please.
also just a quick not, im not sure how to use varibles i tried
int x = 0;
then
x++;
how do i should it in my log?
NSLog(@"%x") <-- is that right?
.h
IBOutlet UIImageView *test;
@property(nonatomic,retain) IBOutlet UIImageView *test;
.m
@synthesize test;
-(void)boundsCheck {
if(test.center.x > self.view.bounds.size.width || test.center.x < 0) {
NSLog(@"you hit the X axis boarder");
}
}
i have an image that im moving around and im trying to see if it will send me a message in my log, when ever i drag the image over to the x axis bound. Can someone help me please.
also just a quick not, im not sure how to use varibles i tried
int x = 0;
then
x++;
how do i should it in my log?
NSLog(@"%x") <-- is that right?
To have the int showing in the console do like this
Code:
NSLog(@"%i", x);
%i refer to a int
%d refer to a decimal number
%@ refer to an object such as NSString or NSInteger
and so on
Not sure to understand.. If this is the question :
Code:
int i = 14;
NSLog(@"%i", i);
No it do not matter. If it is not the question, i do not understand you question.
I think u answered my questions, I have a varible set as "time" and to display, display a varible you have to NSLog(@"%x",Any varible Name); right?
Also if u do something like this would it work
Int testCounter = 0;
testCounter++; <- this would increase by 1 right?
I think u answered my questions, I have a varible set as "time" and to display, display a varible you have to NSLog(@"%x",Any varible Name); right?
Also if u do something like this would it work
Int testCounter = 0;
testCounter++; <- this would increase by 1 right?
Originally Posted by dcwhat
I think u answered my questions, I have a varible set as "time" and to display, display a varible you have to NSLog(@"%x",Any varible Name); right?
Also if u do something like this would it work
Int testCounter = 0;
testCounter++; <- this would increase by 1 right?
NSLog(@"%x",Any varible Name); // Not sure about %x for any variable.
%@ for Object such as NSArray, NSString and so on
%i for integer
%d for float
int testCounter;
testCounter = 0;
testCounter++; <= NSLog(@"%i", testCounter); // that will give 1