English 中文(简体)
• 如何在电话应用中分拨打字数?
原标题:How can i split integer number in iphone application?
  • 时间:2012-01-12 13:21:52
  •  标签:
  • ios4
//string convert into integer

numberIntValue=[numberId intValue];
numberIntValue=16153;

How can i split this integer number into 16, 15 and 3?

问题回答
NSInteger one=numberIntValue/1000;
NSInteger two=(numberIntValue%1000)/10;
NSInteger three=numberIntValue%10;




相关问题
touchesBegan @ multitask

Is it possible to access to the touchesBegan event while application is running in background in iPhoneOS 4.0 ? Thanks in advance.

Error when making a distribution file with iPhone SDK 4.0

When I try to upload the binary to iTunesConnect it says: "An application targeting the iPhone device family may not require a iPhone OS Deployment Target of 3.2, which is an iPad-only OS". I am ...

New App provisioning in iPhone SDK 4 Beta

The enterprise distribution in iPhone 4 beta is supposed to be easier. Companies can host their own servers with the apps instead of distributing through iTunes. I am looking for technical ...

IPhone SDK 4 background process for incoming call [closed]

I would like to track (run some code - or invoke function) when the user get an incoming call. for example: for every call the user receive I want to save the number, and check something during or ...

How can I install more than one version of the iPhone SDK?

I want to install the iPhone 4.0 SDK, but I don t want to lose my stable 3.2 version because I am planning on packaging an app for distribution soon. Any tips on installing more than one version? ...

iPhone SDK 4.0 Phone locked tool

Is there going to be a way with the 4.0 SDK to create a tool similar to Pandora(which was demoed today), so when the phone is locked, I can manipulate my app? So basically if my app was running, and ...

UITableViewCell Custom accessory - get the row of accessory

I have a pretty big issue. I am trying to create a favorite-button on every UITableViewCell in a UITableView. That works very good, and I currently have an action and selector performed when pressed. ...

热门标签