Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Oblivionixx

macrumors newbie
Original poster
Mar 11, 2011
2
0
Hi:
I am working on a project which I am going to implement an UI for IPad while the original UI is written in Python.
Here is a Python script written in the original UI:

Code:
msg = '%8s\0%8s\0%8s\0%s\0'(dst,code,appcode,data)
size = len(msg)+9
msg='%8s\0%s'(size,msg)

I need to make the same message and put it into the NSStream for sending to a remote server. How can I convert the script into NSString format?

Thanks.
Thanks in advance.
 

RonC

macrumors regular
Oct 18, 2007
108
0
Chicago-area
Hi:
How can I convert the script into NSString format?

I could tell you exactly what to do, but you need to learn how to do it yourself.

You should read String Programming Guide and pay attention to the section on Formatting String Options. A couple of corresponding documents to look at are String Format Specifiers and the IEEE printf specification.

You'll be able to figure it out. If you can't figure it out from those, write some code and show us what you can figure out. We can help from there, but we're not going to do your work for you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.