NSDictionary *infoDictionary = [[NSBundle mainBundle] infoDictionary]; CFShow(infoDictionary);// app名称 NSString *app_Name = [infoDictionary objectForKey:@"CFBundleDisplayName"]; // app版本 NSString *app_Version = [infoDictionary objectForKey:@"CFBundleShortVersionString"]; // app build版本 NSString *app_build = [infoDictionary objectForKey:@"CFBundleVersion"];//手机别名: 用户定义的名称 NSStr...
一、简单介绍UITableViewCell是UITableView的核心部分,我们在开发中因为功能的扩展经常需要自定义,以便在其上面添加子控件,例如button、label等。添加后获取这些子控件的cell,因为iOS不同系统的缘故此处会有一个坑,可能会崩溃。接下来以button为例来解决。 二、崩溃情况在自定义cell的时候,在cell上添加了一个button,然后在controller中调用这个button的时候要获取到cell,在iOS6中直接button.superView就可以。但是iOS7中不...
今天要获取之前真机测试时写入沙盒的数据, 本来以为挺麻烦的。后来捣腾了一下, 才知道原来这么简单...下面直接看具体步骤。前提: 真机已经通过USB和你的电脑连接上了!1.进入Organizer2.选择你的应用。 并导出数据。(点击Download)3.保存数据到相应位置。(点击Save)4.打开, 查看数据。保存完毕后, 你后发现一个这样的文件。选中它, 右键---->显示包内容。然后进入------->AppData ------>Documents。即可看到你保存在沙盒里的数据了...
React Native之获取通讯录信息并实现类通讯录列表(ios android)一,需求分析 1,获取通讯录信息,筛选出通讯录里有多少好友在使用某个应用。 2,获取通讯录信息,实现类通讯录,可拨打电话 发短信等。二,技术介绍与配置 2.1 技术介绍 1,react-native-contacts地址:https://www.npmjs.com/package/react-native-contacts 2,下载安装:npm install react-native-contacts --save 3,自动链接:react-na...
#import <UIKit/UIKit.h>@interface AppDelegate : UIResponder <UIApplicationDelegate>@property (strong, nonatomic) UIWindow *window;@end#import"AppDelegate.h"#import"MovieHomeController.h"@interface AppDelegate ()@end@implementation AppDelegate- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {self.window = [[UIWindow alloc] initWithFrame:[[...
//手机序列号 NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier]; NSLog(@"手机序列号: %@",identifierNumber); //手机别名: 用户定义的名称 NSString* userPhoneName = [[UIDevice currentDevice] name]; NSLog(@"手机别名: %@", userPhoneName); //设备名称 NSString* deviceName = [[UIDevice currentDevice] systemName]; NSLog(@"设备名称: %@",deviceName ); ...
进入正题 获取系统通讯录,不想多讲,留下链接http://my.oschina.net/joanfen/blog/140146通常做法:首先创建一个ABAddressBookRef类的对象addressBooks,然后获取系统权限,获取权限的代码:// 获取系统权限,并获得通讯录内容存入addressBooks。ABAddressBookRef addressBooks = nil;addressBooks = ABAddressBookCreateWithOptions(NULL, NULL);dispatch_semaphore_t sema = dispatch_semaphore_create(0);ABAddressBookRequest...
http://blog.csdn.net/betterbb/article/details/25984455 FMDB存储字典或数组时会变成字符串存入sqlite里,但如果不将其转换成json格式存储,你查询获取数据时就会获取无法转换成字典或数组的字符串。转换JSON存储: NSArray *picArr = (NSArray *)dic[@"pic"]; NSError *err = nil; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:picArroptions:NSJSONWritingPrettyPrinted error:&err]; NS...
ios获取权限by 伍雪颖-(void)requestRecord{[[AVAudioSession sharedInstance] requestRecordPermission:^(BOOL granted) {dispatch_async(dispatch_get_main_queue(), ^{});}];
}-(void)requestAccessEventWithType:(EKEntityType)eventType{[[EKEventStore new] requestAccessToEntityType:eventType completion:^(BOOL granted, NSError *error) {dispatch_async(dispatch_get_main_queue(), ^{});}];
}- (void)requestAccessSo...
1.添加代理UIImagePickerControllerDelegate 2.设置点击跳转事件- (IBAction)picButton:(UIButton *)sender { NSLog(@"我的相册"); if([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]){ //a.初始化相册拾取器 UIImagePickerController *controller = [[UIImagePickerController alloc] init]; //b.设置代理 controller.delegate = self; ...
原文链接:iOS键盘弹出高度以及动画时间获取 简书主页:http://www.jianshu.com/users/37f2920f6848Github主页:https://github.com/MajorLMJiOS开发者公会-技术1群 QQ群号:87440292iOS开发者公会-技术2群 QQ群号:232702419iOS开发者公会-议事区 QQ群号:413102158 原文:http://www.cnblogs.com/lmj123/p/5829119.html
UDID被弃用,使用UUID来作为设备的唯一标识。获取到UUID后,如果用NSUserDefaults存储,当程序被卸载后重装时,再获得的UUID和之前就不同了。使用keychain存储可以保证程序卸载重装时,UUID不变。但当刷机或者升级系统后,UUID还是会改变的。但这仍是目前为止最佳的解决办法了,如果有更好的解决办法,欢迎留言。(我整理的解决办法的参考来源:http://blog.k-res.net/archives/1081.html)给大家两个类: UUID.h中的代码: #impor...
GetCodeViewController仿某某获取验证码,并验证方式。提供很多自定义接口,高度自定义。也可以自己更改源代码,界面用xib文件,加自动布局实现,直观易懂。运行项目,请先cd到该目录后,pod update一下,即可运行,因为用到了POP动画库。用法将 项目中 popCodeViewController 整个文件夹拖到你的项目里面。导入依赖库POP动画库自定义控制器中,导入GetCodeViewController、PresentingAnimator、DismissingAnimator类自定义控制器中...
1.访问音乐库的两种方法,如下图(只能访问音频文件,如music,podcast,audiobook等)2.MPMusicPlayerController的使用有两种播放器可以选择,一种是application music player,另外一种是iPod music player。第一种播放器是一种内部播放器,当程序对出后停止播放;而第二种播放器则与iPod播放器内的信息相关,退出之后不会停止播放。获取方式如下: + applicationMusicPlayer+ iPodMusicPlayer 播放之前需要设置播放器的播放...
在开发中,需要获取当前设备的一些信息,可以通过UIDevice,NSbundle,NSlocale获取.UIDeviceUIDevice 提供了多种属性,类函数及状态通知,可以检测手机电量,定位,感应,机型,当前系统版本等等.//设备相关信息的获取 NSString *strName = [[UIDevice currentDevice] name]; NSLog(@"设备名称:%@", strName);//e.g. "My iPhone" NSString *strSysName = [[UIDevice currentDevice] systemName]; NSLog(@"系统名称:%@", strSysName);/...