2019独角兽企业重金招聘Python工程师标准>>>
-
iOS simulator运行程序出现问题:An error was encountered while running (Domain = FBSOpenApplicationErrorDomain, Code = 4)
-
解决办法:iOS Simulator----> Reset Contents and Settings ----> Reset(其实就是还原模拟器-_-!!!)
-
xcode6中添加pch文件:
-
1.Command + N 然后在Other里面选择PCH File --- >Next --->Save As(这里写工程名字格式为xxx.pch)--->Create
-
2.在Build Settings里面找到Prefix Header,双击添加pch文件路径,格式为是 xxx/xxx.pch
-
ios8tableView分割线左边空白问题 ---viewdidload里面调用[self viewDidLayoutSubviews];方法
-
-(void)viewDidLayoutSubviews { if ([myTableView respondsToSelector:@selector(setSeparatorInset:)]) { [myTableView setSeparatorInset:UIEdgeInsetsMake(0,0,0,0)]; } if ([myTableView respondsToSelector:@selector(setLayoutMargins:)]) { [myTableView setLayoutMargins:UIEdgeInsetsMake(0,0,0,0)]; } } -(void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if ([cell respondsToSelector:@selector(setSeparatorInset:)]) { [cell setSeparatorInset:UIEdgeInsetsZero]; } if ([cell respondsToSelector:@selector(setLayoutMargins:)]) { [cell setLayoutMargins:UIEdgeInsetsZero]; } }
-
报错:Link against the umbrella framework 'System.framework' instead. for architecture x86_64
-
在用x6写gcd的时候,由于没有代码提示,误以为x6里面没有了libdispatch.dylib框架,所以导入了,然后报上面的错误,又继续导入了libSystem.dylib框架,仍然报如上错误。于是把刚才导入的两个框架删掉了,然后没问题了,总结就是x6代码提示的问题。
-
报错:Dwarf Exception Unwind Info (__eh_frame) in AppDelegate.o
-
加上libc++.dylib,问题解决
-
报错:Unknown type name “CGFloat” 或者 Unknown type name 'UIColor'
-
我的是extern const引起的,在使用到extern const的类里面添加头文件#import
就行了 -
Xcode6编译SDWebImage报错:Use of undeclared identifier '_executing';Use of undeclared identifier '_finished';
-
解决办法:在SDWebImageDownloaderOperation.m下面的
-
@implementation SDWebImageDownloaderOperation{}下面添加如下代码:
-
@synthesize executing = _executing ;
-
@synthesize finished = _finished;
-
xcode6.0以后地图无法定位的问题
-
//在ios 8.0上要授权 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [myLocationManager requestWhenInUseAuthorization]; //调用了这句,在程序前台运行的时候,就会弹出允许框了允许定位 // [myLocationManager requestAlwaysAuthorization];//程序前台后台运行一直允许定位 }
-
记住要在info.plist里面添加缺省字段NSLocationWhenInUseUsageDescription或者NSLocationAlwaysUsageDescription(具体添加哪个根据你上面设置而定)
-
iOS8系统下的无法弹出通知:Attempting to schedule a local notification ,with an alert but haven't received permission from the user to display alerts,with a sound but haven't received permission from the user to play sounds
-
原因在于iOS8系统变更了注册方法,需要在ApplicationDelegate里面注册通知才可以。
-
再appdelegate.m的didFinishLaunchingWithOptions方法里面,添加如下代码:
-
if ([UIApplication instancesRespondToSelector:@selector(registerUserNotificationSettings:)]) { [application registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:UIUserNotificationTypeAlert|UIUserNotificationTypeBadge|UIUserNotificationTypeSound categories:nil]]; }
-
ios8系统下的推送:registerForRemoteNotificationTypes: is not supported in iOS 8.0 and later
-
// IOS8系统以后需要这么写 if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { [[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; [[UIApplication sharedApplication] registerForRemoteNotifications]; } else { //这里还是原来的代码 [[UIApplication sharedApplication] registerForRemoteNotificationTypes: (UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; }
运行报错:No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=x86_64, VALID_ARCHS=i386).
解决办法:这是缺少arm64的原因导致,需要在下图两个地方的valid architectures里面添加上arm64
报错:could not build module 'Foundation'
解决方法:在Build Settings 下的 Apple LLVM xxx - Language (xxx代表的是你当前的xcode默认的LLVM编译器版本),找到Compile Sources As ,将其改成 Objective-C即可。默认的是第一个“According to File Type”,如此修改的意思是把工程按照哪一种语言进行编译,可根据实际情况选择编译语言。
报错:library not found for -
出现此种错误的原因是因为,我们工程里面使用的第三方库。当xcode进行编译的时候,没有找到此库文件。所以,我们需要在Build Settings下面的Search Paths里面的Library Search Paths中添加该库所在的文件夹的路径。这样编译的时候就可以找到该库了。
报错:[__NSCFDictionary setObject:forKey:]: mutating method sent to immutable object'
将NSMutableDictionary *uuDic = [ [NSUserDefaults standardUserDefaults] objectForKey:@"mycollect"];改成NSMutableDictionary *uuDic = [NSMutableDictionary dictionaryWithDictionary:[ [NSUserDefaults standardUserDefaults] objectForKey:@"mycollect"]];
报错:[UIImage imageWithRenderingMode:]: unrecognized selector sent to instance 0x2017c720
[UIImage imageWithRenderingMode:]这个方法在ios7以上的版本里面才支持,所以需要判断一下当前的系统版本
报错:Multiple build commands for output file /xxx
选中工程,点击 Build Phases, 展开Copy Bundle Resources,删除里面的刚才提示警告的文件,一般为红色的名字的文件。 或者有多个相同的文件,删除一个多余的。
警告:Block implicitly retains 'self'; explicitly mention 'self' to indicate this
选中工程,点击 Building Settings ,搜索 implicit retain of 'self' ,将对应的值改为NO
报错:Safe Area Layout Guide before iOS 9.0