Subscribe ( )

iPhone Programming Tutorials

 

Forum

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You must be logged in to post Login Register

Search 

Learning Objective C: Why Doesn’t This Work?

User Post

8:17 pm
October 23, 2008


macsilvr

Noob

posts 1

1

I'm trying to learn Objective C so that I can program for the iPhone. I've been working through Programming In Obective C (Stephan Kochan) and have experimented with making a Point class. However, I can't figure out why this doesn't work if x & y (Point's only instance variables) don't function properly if they are floats, whereas they work fine if they are ints.


Here is the code I wrote mushed into one file (for ease of uploading):


Any help is greatly appreciated!

11:25 am
November 18, 2008


VertigoSol

Moderator

posts 26

2
-(void) toString {
printf(”(%d, %d)”, x, y);
}

%d prints a integer
%f is what you want to print a float


About the iCodeBlog forum

Currently Online:

3 Guests

Maximum Online: 25

Forums:

Groups: 2

Forums: 6

Topics: 305

Posts: 743

Members:

There are 654 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 53

crazyiez - 30

VertigoSol - 26

Uhu - 17

AdeC - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)