 |
 |
|
 |
04-22-2009, 11:13 PM
|
#1 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Image iPhone Borders
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?
|
|
|
04-23-2009, 09:05 AM
|
#2 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Anyone?
|
|
|
04-23-2009, 09:44 AM
|
#3 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 32
|
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
|
|
|
04-23-2009, 01:49 PM
|
#4 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Stupid question does it matter if I already using the %i for my counter %i,time
|
|
|
04-23-2009, 01:53 PM
|
#5 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 32
|
Quote:
Originally Posted by dcwhat
Stupid question does it matter if I already using the %i for my counter %i,time
|
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.
|
|
|
04-23-2009, 02:49 PM
|
#6 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Quote:
Originally Posted by DiGk
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?
|
|
|
04-24-2009, 04:13 PM
|
#7 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Quote:
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?
|
Anyone?
|
|
|
04-25-2009, 04:32 PM
|
#8 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 32
|
Quote:
Originally Posted by dcwhat
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
Last edited by DiGk; 04-25-2009 at 04:34 PM.
|
|
|
 |
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
» Advertisements |
» Online Users: 241 |
| 20 members and 221 guests |
| ddorrity, donbhar, Ed99, funhog, gardenofwine, hobbyist, inetryconydot, JasonR, jj0b, linkmx, masc2279, mriphoneman, pereorra, ravi124, redmouse, scotopia, smilespray, VMan, ybrikeeg, _nivek |
| Most users ever online was 779, 05-11-2009 at 09:55 AM. |
» Stats |
Members: 24,276
Threads: 39,069
Posts: 171,323
Top Poster: smasher (2,575)
|
| Welcome to our newest member, jstewuk |
|