Objective-C - NSInteger转换NSString
2024-08-31 13:33:30
NSInteger不是对象, 转换为long匹配64位系统, 再组成字符串(%ld).
NSString *inStr = [NSString stringWithFormat: @"%ld", (long)month];
Note that on 64-bit processors, such as the new A7 chip, if your app is compiled for 64-bit, an NSInteger is actually a long, not an int. Doing the cast, (int)month would be destructive on 64-bit platforms for the generic case. If targeting Apple platforms exclusively, something similar that will work with both int and long – e.g. long.
最新文章
- js中$(function())
- Zookeeper 监视(Watches) 简介(转)
- hdu 5779 Tower Defence
- php中Closure::bind用法(手册记录)
- typecho流程原理和插件机制浅析(第一弹)
- 利用java反射机制 读取配置文件 实现动态类载入以及动态类型转换
- android学习---SeekBar和RatingBar
- 浙大pat1020题解
- C# 逆变与协变
- Coursera无法正常提交作业
- URI和URL差别以及相对路径和绝对路径的差别
- 6.6 Pandora 实操 - API/SDK
- ionic使用的一些技巧
- C++ queue
- require.ensure的用法;异步加载-代码分割;
- Python运算符-4
- git报错fatal: I don't handle protocol '​https'处理
- 记一款bug管理系统(bugdone.cn)的开发过程(4) - 新增BugTalk功能
- Beta阶段DAY5
- translate 与 相对、绝对定位
热门文章
- 简单暴力的TP5多主题方案
- Node_进阶_7
- UVA-11584 Partitioning by Palindromes 动态规划 回文串的最少个数
- 【codeforces 257D】Sum
- java用jxl实现导出execl表格
- Python中文字符问题
- 【LeetCode OJ 34】Search for a Range
- httpd: Could not reliably determine the server&;#39;s fully qualified domain name
- HDU 1039.Easier Done Than Said?【字符串处理】【8月24】
- 具体解释C++引用——带你走进引用的世界