Quote:
Originally Posted by dcwhat
Code:
.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
%i refer to a int
%d refer to a decimal number
%@ refer to an object such as NSString or NSInteger
and so on