Subscribe ( )

iPhone Programming Tutorials

 

Forum

You must be logged in to post Login Register

Search 

Fixed Width String Formatting

User Post

8:14 am
October 28, 2008


Lakario

Noob

posts 3

1

Is there any way to do fixed width string formatting with Objective C? I have a tableview that is displaying two separate values on each row and I need the right most value to always line up regardless of the width of the left value.

8:54 am
October 29, 2008


jab2109

iCoder

posts 8

2

In C, you can printf() can be used to insert a predetermined number of spaces into the console. You could just change that predetermined number (int numOfSpaces) depending on how many characters you currently have in the string, and that should fix the size of all strings. Then you could convert that to an NSString object.


About the iCodeBlog forum

Currently Online:

5 Guests

Maximum Online: 25

Forums:

Groups: 2

Forums: 6

Topics: 194

Posts: 585

Members:

There are 356 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 52

crazyiez - 30

VertigoSol - 26

AdeC - 17

Uhu - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)