 |
 |
|
 |
04-23-2009, 12:13 AM
|
#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, 10:05 AM
|
#2 (permalink)
|
|
New Member
Join Date: Apr 2009
Posts: 71
|
Anyone?
|
|
|
04-23-2009, 10: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, 02: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, 02: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, 03: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, 05: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, 05: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 05: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: 591 |
| 47 members and 544 guests |
| applezinga, blacksheep_2011, chinhminhdo, CHV, cordoprod, danny8, dany88, dcinqc, Dynno, ELA, Forsworn, Gandolf, guelinator, introiboad, issya, Janek2004, jbro, jhoncybpr, john3478, jschorn, Kalimba, kilobytedump, lifeCoder45, loobian, marciokoko, Mopedhead, Mr Jack, msudan, nathanp, noberasco, nycos, ovidiu, P2k, pereorra, RayKreisel, sascha, SmallWonder, supudo, svveet, totoro81, toughturtle, vcanic, walkman2001, wolfenberg, _Mac |
| Most users ever online was 779, 05-11-2009 at 10:55 AM. |
» Stats |
Members: 21,483
Threads: 35,767
Posts: 156,678
Top Poster: smasher (2,448)
|
| Welcome to our newest member, guelinator |
|