app:resource fork, Finder information, or similar detritus not al site:forums.developer.apple.com......
(1)关闭Xcode,打开终端;
(2)在终端中输入cd(cd后跟一个空格,先不慌张按回车);
(3)打开项目的文件夹,文件夹中有四个文件,一个.md文件,一个.xcodeproj文件,一个工程文件和一个带有Tests单词的文件。将工程文件拉到终 端中(知道路径的可以在c的后面直接敲路径),路径会自动显示出来,这时直接按回车键;
(4)输入指令“xattr -rc .”,回车;
(5)打开项目重新运行,OK了!
3.上传 AppStore报错:
ERROR ITMS-90529: "Invalid package. Applications built with sdk 9.0 or later must be packaged as proper IPA files."
升级macOS Sierra 10.12 系统后必须在application loader 3.6及以上版本才能上传,所以必须用 xcode8.0版本上传,也可以按一下方法试一试:
1、先使用 Xcode7.3.1 打包。
2、选中打好的包,“show in Finnder”, 有个 “xx.xcarchive”,选中它 显示包内容,然后是:”Products”–>”Applications”,这里有一个 “xx.app”,选中它显示包内容。找到 “info.plist”,修改 “info.plist” 中 “BuildMachineOSBuild” 键所对应的值为:”16A323”, 修改 “DTXcodeBuild” 键所对应的值为 “8A218a”, 然后用 “Xcode8”(我用的是Xcode8 beta版) 或者 “Application Loader” 提交。
info.plist
添加
NSContactsUsageDescription
的key, value,用到那个写那个
6.推送 相关
ios7及以下版本推送方法
- (
void
)application:(UIApplication *)application didReceiveRemoteNotification:
(
NSDictionary
*)userInfo {}
- (
void
)application:(UIApplication *)application didReceiveRemoteNotification:(
NSDictionary
*)userInfo fetchCompletionHandler:(
void
(^)(UIBackgroundFetchResult))completionHandler {}
ios10.0及以后
- (
void
)jpushNotificationCenter:(UNUserNotificationCenter *)center willPresentNotification:(UNNotification *)notification withCompletionHandler:(
void
(^)(
NSInteger
))completionHandler {}
- (
void
)jpushNotificationCenter:(UNUserNotificationCenter *)center didReceiveNotificationResponse:(UNNotificationResponse *)response withCompletionHandler:(
void
(^)())completionHandler {}
ios 9 之前的lab 字体可以显示全,但是到了ios10 发觉字体显示不全了.得适配啊.app 会跟随手机系统字体大小而改变了.
简单粗暴地方法就是不让他跟着手机系统的字体改变而改变.
label.adjustsFontForContentSizeCategory = YES;
或
9.xcode8的注释快捷键注释不能用了, command+/ 不行了
因为苹果解决xcode ghost。把插件屏蔽了。解决方法
命令运行: sudo /usr/libexec/xpccachectl
然后必须重启电脑后生效
10.判断版本问题
OC建议使用[[UIDevice currentDevice] systemVersion]
或
#define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame)
#define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending)
#define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending)
#define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending)
swift
使用 if #available( ios 10.0,*){ //是10.0 }else{//不是10.0}
在iOS 10 中, UIRefreshControl可以直接在UICollectionView和UITableView中使用,并且脱离了UITableViewController.现在RefreshControl是UIScrollView的一个属性.
使用方法:
UIRefreshControl *refreshControl = [[UIRefreshControl alloc] init];
[refreshControl addTarget:self action:@selector(loadData) forControlEvents:UIControlEventValueChanged];
collectionView.refreshControl = refreshControl;
12.UIStatusBar方法过期
//属性&&方法
@property(nonatomic, readonly) UIStatusBarStyle preferredStatusBarStyle NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED; // Defaults to UIStatusBarStyleDefault
@property(nonatomic, readonly) BOOL prefersStatusBarHidden NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED; // Defaults to NO
- (UIStatusBarStyle)preferredStatusBarStyle NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED; // Defaults to UIStatusBarStyleDefault
- (BOOL)prefersStatusBarHidden NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED; // Defaults to NO
// Override to return the type of animation that should be used for status bar changes for this view controller. This currently only affects changes to prefersStatusBarHidden.- (UIStatusBarAnimation)preferredStatusBarUpdateAnimation NS_AVAILABLE_IOS(7_0) __TVOS_PROHIBITED; // Defaults to UIStatusBarAnimationFade
//可以这样写
- (UIStatusBarStyle)preferredStatusBarStyle {
return UIStatusBarStyleDefault;
}