Subscribe ( )

iPhone Programming Tutorials


 

Forum

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

e^i -1 =0

Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

6 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.