xcode11更新報錯問題整理

1、錯誤信息:Multiple methods named 'numberOfItemsInSection:' found with mismatched result, parameter type or attributes
報錯的代碼:

 NSInteger numberOfBeforeSection = [_update[@"oldModel"] numberOfItemsInSection:updateItem.indexPathBeforeUpdate.section];

修改的代碼:

NSInteger numberOfBeforeSection = [(UICollectionView *)_update[@"oldModel"] numberOfItemsInSection:updateItem.indexPathBeforeUpdate.section];

2、錯誤信息:'playbackState' is only available in iOS 13.0 or newer
解決代碼:

   if #available(iOS 13.0, *) {
         MPNowPlayingInfoCenter.default().playbackState = .playing
   } else {
        // Fallback on earlier versions
   }

官方的API:

@available(iOS 5.0, *)
open class MPNowPlayingInfoCenter : NSObject {

    
    /// Returns the default now playing info center.
    /// The default center holds now playing info about the current application.
    open class func `default`() -> MPNowPlayingInfoCenter

    
    /// The current now playing info for the center.
    /// Setting the info to nil will clear it.
    open var nowPlayingInfo: [String : Any]?

    
    /// The current playback state of the app.
    /// This only applies on macOS, where playback state cannot be determined by
    /// the application's audio session. This property must be set every time
    /// the app begins or halts playback, otherwise remote control functionality may
    /// not work as expected.
    @available(iOS 13.0, *)
    open var playbackState: MPNowPlayingPlaybackState
}

3、問題:iOS13上,viewController在present出來后,沒有全屏,頂部會留白。
解決方式:

viewController.modalPresentationStyle = UIModalTransitionStyle.overFullScreen
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
【社區(qū)內容提示】社區(qū)部分內容疑似由AI輔助生成,瀏覽時請結合常識與多方信息審慎甄別。
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發(fā)布,文章內容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。

相關閱讀更多精彩內容

友情鏈接更多精彩內容