Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 04-23-2009, 12:13 AM   #1 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 71
Default 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?
dcwhat is offline   Reply With Quote
Old 04-23-2009, 10:05 AM   #2 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 71
Default

Anyone?
dcwhat is offline   Reply With Quote
Old 04-23-2009, 10:44 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 34
Default

Quote:
Originally Posted by dcwhat View Post
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

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
DiGk is offline   Reply With Quote
Old 04-23-2009, 02:49 PM   #4 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 71
Default

Stupid question does it matter if I already using the %i for my counter %i,time
dcwhat is offline   Reply With Quote
Old 04-23-2009, 02:53 PM   #5 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 34
Default

Quote:
Originally Posted by dcwhat View Post
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.
DiGk is offline   Reply With Quote
Old 04-23-2009, 03:49 PM   #6 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 71
Default

Quote:
Originally Posted by DiGk View Post
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?
dcwhat is offline   Reply With Quote
Old 04-24-2009, 05:13 PM   #7 (permalink)
New Member
 
Join Date: Apr 2009
Posts: 71
Default

Quote:
Originally Posted by dcwhat View Post
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?
dcwhat is offline   Reply With Quote
Old 04-25-2009, 05:32 PM   #8 (permalink)
Registered Member
 
Join Date: Apr 2009
Posts: 34
Default

Quote:
Originally Posted by dcwhat View Post
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.
DiGk is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Stats
Members: 158,476
Threads: 89,091
Posts: 380,124
Top Poster: BrianSlick (7,091)
Welcome to our newest member, JordanCahill
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:13 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0