1【Network】使用AFNetworking2.0请求数据时出现错误Requestfailed:unacceptablecontent-type:text/html解决方法
使用AFNetworking 2.0请求数据时出现错误 Request failed: unacceptablecontent-type: text/html解决方法
添加一行
2【JS】Js 常用调试的方法
3【JS】Safari调试工具
如何Enable – SafariPrefernces –> Advanced最下面的选项
勾选 然后你就可以在右键菜单上看到InspectElement选项了 – 跟Chrome一模一样
4【地理位置】APP获取本地地理位置时注意
APP中获取本地地理位置时,要注意打开APP的地理位置授权,位置在设置—>隐私—>定位服务
不然获取不到位置信息,而且没有提示,而且APP一旦移除重新安装,需要重新设置。
5【macox】mac命令行下怎么切换到root用户
可以使用sudo -i 然后输入密码即可
6【js】遍历js对象并获取某一个成员对象
for(var app in callbackData)
{
var appObj = callbackData[app];
if(appObj != null && appObj.applianceId != undefined &&appObj.applianceId == curAppID)
{
_userApplianceInfo = appObj;
break;
}
}
7Objective-C自定义NSLog宏
/*
*/
#ifdefDEBUG
#defineNSLog(FORMAT,…)fprintf(stderr,"%s:%d\t%s\n",[[[NSStringstringWithUTF8String:__FILE__]lastPathComponent]UTF8String],__LINE__,[[NSStringstringWithFormat:FORMAT,##__VA_ARGS__]UTF8String]);
#else
#defineNSLog(FORMAT,…)nil
#endif
8【兼容性】IOS8中,CLLocationManagerDelegate不调用didUpdateLocations
CLLocationManagerDelegate不调用didUpdateLocations
?tid=259171
iOS8下的开发变化
?tid=217107
requestWhenInUseAuthorization()或者requestAlwaysAuthorization()NSLocationAlwaysUsageDescriptionNSLocationWhenInUseUsageDescription
9计算指定时间与当前的时间差
计算指定时间与当前的时间差
以下是实现方法:
/**
*计算指定时间与当前的时间差
*@paramcompareDate 某一指定时间
(
*/
//
{
NSTimeInterval timeInterval = [compareDatetimeIntervalSinceNow];
timeInterval = -timeInterval;
long temp =0;
if (timeInterval <60) {
}
}
}
}
}
}
}
/**
– (id)initWithTimeInterval:(NSTimeInterval)secs sinceDate:(NSDate*)refDate;
– (id)initWithTimeIntervalSinceNow:(NSTimeInterval)secs;
– (NSTimeInterval)timeIntervalSinceDate:(NSDate *)refDate;
– (NSTimeInterval)timeIntervalSinceNow;
– (NSTimeInterval)timeIntervalSince1970;
– (NSTimeInterval)timeIntervalSinceReferenceDate;
+ (NSTimeInterval)timeIntervalSinceReferenceDate;
*/
// – (NSTimeInterval)timeIntervalSinceNow;
10 IOS开发常用数学函数
),结果介于[-PI/2,PI/2]
),结果介于[-PI,PI]
double sinh (double);
double cosh (double);
double tanh (double);
double frexp (double f, int*p); 标准化浮点数, f= x * 2^p,
,
nt matherr(struct exception*e);数学错误计算处理程序
转载:
11 IOS获取屏幕尺寸与分辨率
IOS获取屏幕分辨率
获取屏幕分辨率是个很有用的功能,尤其在一些游戏相关的开发中,图形的绘制与屏幕分辨率密不可分。得到当前屏幕的分辨率是必不可少的支持。
获取屏幕分辨率可以两步走
1、得到当前屏幕的尺寸:
CGRectrect_screen = [[UIScreenmainScreen]bounds];
CGSizesize_screen= rect_screen.size;
CGFloat scale_screen = [UIScreenmainScreen].scale;
12 iPhone开发分辨率
iPhone6分辨率与适配
13 【编译】Cannot assign to ‘self’outside of a method in the init family于千万年之中,于千万人之中,在时间无涯的荒野中,