随笔分类 -  公司学习

摘要:传感器总结传感器类型作用环境光传感器感应周边环境光线的强弱(自动调节屏幕亮度)距离传感器感应是否有其他物体靠近设备屏幕(打电话自动锁屏)磁力计传感器感应周边的磁场(合盖锁屏)内部温度传感器感应设备内部的温度(提醒用户降温,防止损伤设备)湿度传感器感应设备是否进水(方便维修人员)陀螺仪感应设备的持握方... 阅读全文
posted @ 2015-05-15 17:56 pocket_live 阅读(260) 评论(0) 推荐(1)
摘要:首先包含这两个头文件以及加入对应的框架#import #import 添加声音通知的监听[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemC... 阅读全文
posted @ 2015-05-15 17:55 pocket_live 阅读(761) 评论(0) 推荐(1)
摘要:lineBreakMode:设置标签文字过长时的显示方式。label.lineBreakMode=NSLineBreakByCharWrapping;//以字符为显示单位显示,后面部分省略不显示。label.lineBreakMode=NSLineBreakByClipping;//剪切与文本宽度相... 阅读全文
posted @ 2015-05-15 17:50 pocket_live 阅读(298) 评论(0) 推荐(1)
摘要:目前分为四个推送:用户推送,本地推送,远程推送,地理位置推送。if(IS_IOS8){//1.创建消息上面要添加的动作(按钮的形式显示出来)UIMutableUserNotificationAction*action=[[UIMutableUserNotificationActionalloc]in... 阅读全文
posted @ 2015-05-14 18:03 pocket_live 阅读(304) 评论(0) 推荐(0)
摘要:AudioServicesAddSystemSoundCompletion(kSystemSoundID_Vibrate, NULL, NULL, systemAudioCallback, NULL);AudioServicesRemoveSystemSoundCompletion(kSystemS... 阅读全文
posted @ 2015-05-08 18:31 pocket_live 阅读(639) 评论(0) 推荐(0)
摘要:UISegmentedControl/*typedef enum {UISegmentedControlStylePlain,UISegmentedControlStyleBordered,UISegmentedControlStyleBar,UISegmentedControlStyleBezel... 阅读全文
posted @ 2015-05-07 18:06 pocket_live 阅读(396) 评论(0) 推荐(0)
摘要:iOS 锁屏判断应用程序的单例类对象中得到应用程序委托的对象UIApplicationDelegate* myDelegate = [[UIApplication sharedApplication] delegate];UIApplication接收到所有的系统事件和生命周期事件时,都会把事件传递... 阅读全文
posted @ 2015-05-06 18:30 pocket_live 阅读(1714) 评论(0) 推荐(0)
摘要:UIwindow 的学习层级关系测试代码:@interface AppDelegate ()@property (nonatomic, strong) UIWindow *arlewWindow;@property (nonatomic, strong) UIWindow *norWindow;@p... 阅读全文
posted @ 2015-05-05 18:39 pocket_live 阅读(267) 评论(0) 推荐(0)
摘要:显示 Mac 隐藏文件的命令: defaults write com.apple.finder AppleShowAllFiles -bool true隐藏 Mac 隐藏文件的命令: defaults write com.apple.finder AppleShowAllFiles -boo... 阅读全文
posted @ 2015-05-05 18:32 pocket_live 阅读(165) 评论(0) 推荐(0)
摘要:获取iOS系统版本 --- UIDevice的使用UIDevice类是一个单例,其唯一的实例( [UIDevice currentDevice] ) 代表了当前使用的设备。通过这个实例,可以获得设备的相关信息(包括系统名称,版本号,设备模式等等)。也可以使用使用该实例来监测设备的特征(比如物理方向)... 阅读全文
posted @ 2015-05-04 18:14 pocket_live 阅读(273) 评论(0) 推荐(0)
摘要:// 设置音量- (void)setVolume:(float)newVolume{ [[MPMusicPlayerController applicationMusicPlayer] setVolume:newVolume];}// 获取音量- (float)volume{ return [[... 阅读全文
posted @ 2015-04-30 18:03 pocket_live 阅读(154) 评论(0) 推荐(0)
摘要:错误类型: error: linker command failed with exit code 1 (use -v to see invocation)这种问题,通常出现在添加第三方库文件或者多人开发时。这种问题一般是找不到文件而导致的链接错误。1.如果是多人开发,你同步完成后发现出现如下的错误... 阅读全文
posted @ 2015-04-29 18:21 pocket_live 阅读(153) 评论(0) 推荐(0)
摘要:一、 添加两个框架 :MediaPlayer.framework和AudioToolbox.framework添加两个头文件#import #import 添加通知一般在程序刚刚启动的时候添加:- (BOOL)application:(UIApplication *)application didF... 阅读全文
posted @ 2015-04-29 18:20 pocket_live 阅读(228) 评论(0) 推荐(0)
摘要:NSLocalizedString(@"Foo %@",nil);这句话实际上是在多语言文件中寻找一个key为“Foo %@”的文字,千万不要把这个和[NSString stringWithFormat:@"%@",@“hehe”];弄混了。特别的有一种很特殊的情况,发生在Appirater这个开源... 阅读全文
posted @ 2015-04-28 18:06 pocket_live 阅读(2078) 评论(0) 推荐(0)
摘要:自定义状态栏:第一步:AppDelegate *_delegate;//获得程序代理,以便对设备StatusBar进行控制 _delegate = (AppDelegate *)[UIApplication sharedApplication].delegate; //获得设备Statu... 阅读全文
posted @ 2015-04-27 18:12 pocket_live 阅读(122) 评论(0) 推荐(0)
摘要:手势学习:除了用touchesBegan / touchesMoved / touchesEnded这组方法来控制使用者的手指触控外,也可以用UIGestureRecognizer的衍生类別来进行判断。一、UIGestureRecognizerUITapGestureRecognizer //点一... 阅读全文
posted @ 2015-04-27 18:11 pocket_live 阅读(223) 评论(0) 推荐(0)
摘要:4-22 学习心得// 设置每组尾部View- (UIView *) tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section// 设置每组头部View- (UIView *) tableView:(UI... 阅读全文
posted @ 2015-04-23 18:13 pocket_live 阅读(99) 评论(0) 推荐(0)
摘要:ARC只能作用于Objective-C对象1.sleep(unsigned int);该函数给当前线程挂起给定时间(unsignedint)秒后继续执行下一句。(使程序睡眠)例如: int main(int argc, const char * argv[]) { @autoreleasepool... 阅读全文
posted @ 2015-04-22 18:03 pocket_live 阅读(78) 评论(0) 推荐(0)
摘要:mac电脑开启开发者模式,避免xcode每次运行都要密码开启模式: 终端命令:DevToolsSecurity -enable完成后会提示:Developer mode is already enabled.代表开发人员模式已启用如果还是要输入密码:1.解锁登陆钥匙串,尝试把证书移到登陆那里 ... 阅读全文
posted @ 2015-04-21 18:29 pocket_live 阅读(116) 评论(0) 推荐(0)
摘要://设置自动行数与字符换行 [labelsetNumberOfLines:0]; label.lineBreakMode=UILineBreakModeWordWrap;/** 去除多余分割线 */ self.tableView.tableFooterView = [[UIView alloc... 阅读全文
posted @ 2015-04-17 18:33 pocket_live 阅读(88) 评论(0) 推荐(0)