在模拟器上使用百度地图定位的时候, 经常报这样的错误:/**
*定位失败后,会调用此函数
*@param error 错误号
*/
- (void)didFailToLocateUserWithError:(NSError *)error
{
NSLog(@"%@", error);
//Error Domain=kCLErrorDomain Code=0 "The operation cou...
分类:
移动开发 时间:
2014-10-30 13:32:44
阅读次数:
259
在Xcode项目属性->Build Settings中,属性Precompile Prefix Header用于标识是否使用预编译头文件,Prefix header用于标识pch文件。Prefix.pch文件内容如下例示:#ifdef __OBJC__#import #import #endif其中...
分类:
其他好文 时间:
2014-10-29 21:24:18
阅读次数:
254
NSLog(@"------------%@",[[UIApplication sharedApplication].keyWindow performSelector:@selector(recursiveDescription)]);由于recursiveDescription是Apple的私有...
分类:
移动开发 时间:
2014-10-29 19:15:52
阅读次数:
117
可以在pch文件中定义宏,这样整个项目就都可以用了!1 #define UIColorFromRGBValue(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((r...
分类:
移动开发 时间:
2014-10-29 18:41:25
阅读次数:
142
#define NSLogRect(rect) NSLog(@"%s x:%.4f, y:%.4f, w:%.4f, h:%.4f", #rect, rect.origin.x, rect.origin.y, rect.size.width, rect.size.height)
#define NSLogSize(size) NSLog(@"%s w:%.4f, h:%.4f", #size, s...
分类:
其他好文 时间:
2014-10-29 17:09:34
阅读次数:
171
在Xcode6之前新建项目,系统会帮我们自动新建一个以工程名为名字的pch (precompile header)文件,在Supporting FIles文件下会看到一个以 -Prefix.pch结尾文件的文件,pch全称是“precompiled header”,也就是预编译头文件,该文件里存放的...
分类:
其他好文 时间:
2014-10-27 00:26:24
阅读次数:
182
ItcastWeibo-Prefix.pch//// Prefix header//// The contents of this file are implicitly included at the beginning of every source file.//#import #ifndef...
分类:
移动开发 时间:
2014-10-26 18:16:00
阅读次数:
287
XCode6里, 新建工程默认是没有pch文件的,苹果取消pch文件这一点肯定有它的道理,刚开始很多人可能不适应,如果我们想使用pch文件,需要手动添加,添加步骤如下:(依旧直接上图) @ 取消的原因: Stackoverflow上有一个人对此的解释是这样的: I suspect because of modules, which remove the need f...
分类:
其他好文 时间:
2014-10-24 20:46:41
阅读次数:
459
1 #import 2 3 int main(int argc, const char * argv[]) 4 { 5 @autoreleasepool { 6 NSLog(@"Hello world!"); 7 } 8 9 ...
分类:
其他好文 时间:
2014-10-24 20:19:45
阅读次数:
142
代码1: #import?<Foundation/Foundation.h>
@interface?Animal?:?NSObject
-?(void)eat;
@end
@implementation?Animal
-?(void)eat
{
????NSLog(@"Animal-eat");
}
@end
@interface?Dog?:?Ani...
分类:
其他好文 时间:
2014-10-24 00:29:57
阅读次数:
168