摘要:The format string supportsprintf-style format arguments such as%x(see“Formatting String Objects”). Two important arguments are%@and%K.%@is a var arg substitution for an object value—often a string, number, or date.%Kis a var arg substitution for a key path.When string variables are substituted into
阅读全文
摘要:定义形式 #define标识符字符串含参数的 #define a(b) 2*b;当需要参数拼接时 用## #define FunctionTest(a) -(void)te##a{NSLog(@"test");}需要换行时 用\ #define str(a,b,c) {a+=b;a+=c;}#define str(a,b,c) {a+=b;\ a+=c;} //// SynthesizeSingleton.h// CocoaWithLove//// Created by Matt Gallagher on 20/10/08.// Copyright 2009 Matt Ga
阅读全文
摘要:http://www.cnblogs.com/scorpiozj/archive/2011/05/17/2048751.html- (id)performSelector:(SEL)selector withObject:(id)p1 withObject:(id)p2 withObject:(id)p3 { NSMethodSignature *sig = [self methodSignatureForSelector:selector]; //记录方法的参数和返回值类型,通常用于对象间传递消息;通常随后会创建NSInvocation对象,来调用方法if (sig) { ...
阅读全文
摘要:http://blog.csdn.net/tongzhitao/article/details/78227511、概述插入MapView,设置Delegate(一般为Controller),Annotations记录兴趣位置点(AnnotationView用来显示兴趣位置点),annotation是可选的,选中的annotation会显示callout,用来显示信息。2、设置地图显示类型:mapView.mapType = MKMapTypeStandard;mapView.mapType = MKMapTypeSatellite;mapView.mapType = MKMapTypeHybr
阅读全文
摘要:http://mobile.51cto.com/iphone-280655.htmNSPredicate*p=[NSPredicatepredicateWithFormat:@"SELFlike[c]%@",@"aa*bb"];其中:SELF大小写都行。aa*bb使用了通配符,*号只能写在变量中,而不能这样@"SELFlike[c]%@*%@",@"aa",@"bb"字符串本来是要用引号括起来的,不过这里不用加,NSPredicate会自动加。测试布尔值NSPredicate*p=[NSPred
阅读全文
摘要:先假设 你的程序 自少在 模拟器上 能正常运行 ,不会出现 警告提示 也没有 内存泄漏等错误。于是 可以尝试发布了:第一部分:在网页https://developer.apple.com 上做一些准备步骤: 1、打开ios Provisioning Portal 如下图 2.在App IDs 选项卡里申请一个产品的 AppID 一般都是 com.domain.appname 3.Provisioning 选项卡,这里是申请真机测试的证书,在xcode 4 里 可以自动弄了 ,(这里可以省略)。 4.在上图的那个Distribution 里,申请发布的证书:AppStore 就是...
阅读全文
摘要:ios里 函数回调 一般有3种方法:委托,block,消息通知。觉得block 最不好理解 记下些东西,方便查阅。block 可以作为变量传递的函数 或对象,闭包(偶的理解)这里是ios文档。定义: return_type (^block_name)(param_type, param_type, ...) 如:void (^blockTest)()=^(){};定义了一个参数为空 返回空的block blockTest;//参数为空时后面的()可以省略。 int (^blockTestAdd)(int a,int b)=^(int a,int b){return a+b};用法:...
阅读全文