`
文章列表
  1. 在Preferneces > Build, Execution, Deployment option > Instant Run 中,禁用Instant Run     2. 把Gradle的插件版本,修改成和你Android Studio 匹配的版本       3. 把build目录里的文件都删了   4. Clean  Project   5 Rebuild Project     OK,成功
今天更新了Android Studio,之前的项目就无法直接编译了。看了一下,是gradle的版本和gradle的插件版本不对应。我安装的是Android Studio是最新的2.3.3版本,那么我现在的gradle版本就是2.3.3.  而我项目里,之前的Android Studio使用的是2.0.0,那么我的gradle版本就是2.0.0,使用的gradle插件版本是 2.10 gradle-wrapper.properties 文件里,是这样的   直接运行程序后就会出现gradle版本过低的提示 Warning:Android Studio 2.3.3.0 requires ...
更新了最新的VVDocumenter, Xcode中一款比较好的注释插件 VVDocumenter-Xcode 地址:https://github.com/onevcat/VVDocumenter-Xcode   现在同样支持Swift。      
今天遇到一个问题,使用模态方式PresentViewController一个视图viewcontroller1之后,需要再PresentViewController一个viewcontroller2,但是希望在viewcontroller2操作结束后,直接返回根视图,研究了一下,以下的方式,还是可行的。记录一下。     UIViewController *viewController2 = [[UIViewController alloc] init];     UIViewController *presentingViewController = self.presentingView ...

C/C++文件读写函数

    博客分类:
  • c
c 
1.fopen()   fopen的原型是:FILE *fopen(const char *filename,const char *mode),fopen实现三个功能:为使用而打开一个流,把一个文件和此流相连接,给此流返回一个FILR指针。   参数filename指向要打开的文件名,mode表示打开状态的字符 ...
书上看到的,有几点觉得还是值得注意。 1、头文件 win32: #include<winSock.h> linux: #include<sys/socket.h> 2、关闭 win32: closeScoket(s); linux: close(fd); 3、在NONBLOCKING模式下调用connect,大部分返回 win32: WSAEWOULDBLOCK linux: EINPROGRESS ...
    最近调整了自己程序的界面,觉得之前的cell.imageView尺寸太大了,又不想改动太大,就找了个简单的方法。记录一下。             UIImage *Image;             Image = [UIImage imageNamed:@"defaultPic"];             CGSize itemSize = CGSizeMake(60, 70);             UIGraphicsBeginImageContextWithOptions(itemSize, NO ,0.0);             CGRect ...
//初始化textfield并设置位置及大小   UITextField *text = [[UITextField alloc]initWithFrame:CGRectMake(20, 20, 130, 30)]; //设置边框样式,只有设置了才会显示边框样式    text.borderStyle = UITextBorderStyleRoundedRect;  typedef enum {     UITextBorderStyleNone, ...
异常情况: *** Terminating app due to uncaught exception 'CALayerInvalidGeometry', reason: 'CALayer position contains NaN: [240 nan]' *** First throw call stack: (0x325e02a3 0x3a30897f 0x325e01c5 0x3419497b 0x341948a3 0x6f3c69 0x34194833 0x343e9aed 0x3446e1cd 0x3449eb41 0x344a6189 0x344724c9 0x343eb803 0 ...
1. 用于创建NSDate实例的类方法有     + (id)date;     返回当前时间     + (id)dateWithTimeIntervalSinceNow:(NSTimeInterval)secs;       返回以当前时间为基准,然后过了secs秒的时间     + (id)dateWithTimeIntervalSinceReferenceDate:(NSTimeInterval)secs;     返回以2001/01/01 GMT为基准,然后过了secs秒的时间     + (id)dateWithTimeIntervalSince1970:(NSTimeIn ...
#import <SystemConfiguration/CaptiveNetwork.h> + (NSString *)getWifiName {     NSString *wifiName = @"Not Found";     CFArrayRef myArray = CNCopySupportedInterfaces();     if (myArray != nil) {         CFDictionaryRef myDict = CNCopyCurrentNetworkInfo(CFArrayGetValueAtIndex(myArray, ...
将UIImage缩放到指定大小尺寸: - (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size{     // 创建一个bitmap的context      // 并把它设置成为当前正在使用的context     UIGraphicsBeginImageContext(size);     // 绘制改变大小的图片      [img drawInRect:CGRectMake(0, 0, size.width, size.height)];      // 从当前context中创建一个改变大小后的图片      UI ...
1.系统默认的颜色设置 //无色  cell.selectionStyle = UITableViewCellSelectionStyleNone;  //蓝色  ,系统默认是蓝色的 cell.selectionStyle = UITableViewCellSelectionStyleBlue;  //灰色  cell.selectionStyle = UITableViewCellSelectionStyleGray; 2.自定义UITableViewCell选中后的背景颜色和背景图片 //修改背景颜色 UIView *backgroundViews = [[UIView al ...
    //手机序列号      NSString* identifierNumber = [[UIDevice currentDevice] uniqueIdentifier];     NSLog(@"手机序列号: %@",identifierNumber);     //手机别名: 用户定义的名称      NSString* userPhoneName = [[UIDevice currentDevice] name];     NSLog(@"手机别名: %@", userPhoneName);     //设备名称      ...
延时执行某个方法 1:performSelector:withObject:afterDelay: [self performSelector:@selector(delNotification:) withObject:@"name" afterDelay:5.0f]; -(void)delNotification:(NSString*)name {     [loadStateLabel setText:name]; } 该方法只能接受一个参数。如果需要传递多个参数怎么办呢??? 让selector调用的方法接受的参数类型修改为Dictionary类型。 ...
Global site tag (gtag.js) - Google Analytics