1. main(int argc, char * argv[]){} (因为程序名总是用作启动参数传递,所以argc的值至少是1)
2. NSLog(@"some strings"); @"" --> NSString ; "%@"-->是NSString 的占位符;
3. NSString *getColorName(ShapeColor colorname){return @...
分类:
移动开发 时间:
2016-05-12 20:35:04
阅读次数:
264
1.压缩图片#pragma mark 处理图片
- (void)useImage:(UIImage *)image
{
NSLog(@"with-----%f heught-----%f",image.size.width,image.size.height);
float scales = image.size.height / image.size.width; /...
分类:
移动开发 时间:
2016-05-12 20:08:23
阅读次数:
241
一些公用类:
@interface CustomClass : NSObject
- (void) fun1;
@end
@implementation CustomClass
- (void) fun1
{
NSLog(@"fun1");
}
@end
@interface TestClass :...
分类:
移动开发 时间:
2016-05-12 11:58:25
阅读次数:
255
一些公用类:
@interface CustomClass : NSObject
- (void) fun1;
@end
@implementation CustomClass
- (void) fun1
{
NSLog(@"fun1");
}
@end
@interface TestClass :...
分类:
移动开发 时间:
2016-05-12 11:52:45
阅读次数:
262
-(void)test { //XML文本范例 NSString *testXMLString = @"Cake0.55RegularChocolateBlueberryNoneGlazedSugar"; NSLog(@"xml string[\n%@\n]", testXMLString); // ...
分类:
Web程序 时间:
2016-05-09 01:34:46
阅读次数:
172
iOS的应用只能访问系统为该应用创建的区域,不可访问其他区域,这块区域就是沙盒(sandBox)。我们常常把一些图片,属性文件(plist文件)等等存在到该目录下,以便开发中使用。
1.获取沙盒路径
a.获取模拟器沙盒路径
如果在开发中,你不知道你想查找的应用沙盒路径的话,你可以通过NSHomeDirectory()这个方法来打印你的沙盒路径。
eg:
NSLog(@"沙盒路径---...
分类:
移动开发 时间:
2016-05-07 09:50:27
阅读次数:
239
常用的NSLOG日志打印格式 字数126 阅读28 评论0 喜欢0 常用的NSLOG日志打印格式 字数126 阅读28 评论0 喜欢0 以下是常用的LOG打印,如果有特殊,请@我,这边会不定期更新。 %@ 对象 %d, %i 整数 %u 无符整形 %f 浮点/双字 %x, %X 二进制整数 %o 八 ...
分类:
其他好文 时间:
2016-05-06 19:40:15
阅读次数:
194
以2为小数输出float a = 1.234567 在oc中可以借助NSLog格式输出 NSLog(@"float:%.2f",a); // 输出: // double:1.23 在SWIFT中,String 的格式化初始方法可以帮助我们利用格式化的字符串: let format = String( ...
分类:
编程语言 时间:
2016-05-06 10:44:43
阅读次数:
3140
一,代码。 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //第一种方法 NSLog(@"--first-%i",[self convertToInt:@"1 ...
分类:
其他好文 时间:
2016-05-05 09:37:20
阅读次数:
129
//应用程序启动完毕时调用 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { NSLog(@"%s",__func__); re ...
分类:
移动开发 时间:
2016-05-03 14:08:46
阅读次数:
193