记录自己开发遇到的问题
cannot create __weak reference because the current deployment target does not support weak reference
需要在主线程操作UI
NSInternalInconsistencyException
accessing _cachedSystemAnimationFence requires the main thread
CoreFoundation ___exceptionPreprocess + 228
libobjc.A.dylib objc_exception_throw + 56
CoreFoundation +[NSException raise:format:]
Foundation -[NSAssertionHandler handleFailureInMethod:object:file:lineNumber:description:] + 112
UIKit -[UIApplication _cachedSystemAnimationFenceCreatingIfNecessary:] + 348
UIKit +[UIWindow _synchronizeDrawingWithPreCommitHandler:] + 68
UIKit -[UIInputViewAnimationStyle launchAnimation:afterStarted:completion:forHost:fromCurrentPosition:]
- (void)emptyDataSetDidAppear:(UIScrollView *)scrollView{
CGRect frame = scrollView.frame;
frame.origin.y = 0;
UIView *view = objc_getAssociatedObject(scrollView,emptyDataSetView);
if (view) {
view.frame = frame;
}
}
@property(nonatomic) BOOL alwaysBounceVertical;
@property(nonatomic) BOOL alwaysBounceHorizontal
选择上面的属性,设置为YES,当数据量少的时候也可滚动
textField.enablesReturnKeyAutomatically = YES;
输入框未输入任何文字键盘禁止输入,只需将enablesReturnKeyAutomatically
设置为YES,默认是NO,需要注意的是微信检索功能也是利用这个属性做的。
'NSInternalInconsistencyException', reason: 'negative sizes are not supported in the flow layout'
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
return CGSizeMake(非负数,非负数);
}