日本熟妇hd丰满老熟妇,中文字幕一区二区三区在线不卡 ,亚洲成片在线观看,免费女同在线一区二区

iOS Pod集成移動監控引入FBRetainCycleDetector的問題處理

問題描述

Pod集成移動監控引入FBRetainCycleDetector,會出現以下問題:

  • 問題一:FBRetainCycleDetector編譯報錯Cannot initialize a parameter of type 'id<NSCopying> _Nonnull' with an rvalue of type 'Class'10846568-5404d33c0b929fa9.webp

  • 問題二:應用切換到到后臺就報錯。 IMG_6120.JPG

解決方案

在Podfile的末尾添加以下內容:

post_install do|installer|
   #解決問題一
   find_and_replace("Pods/FBRetainCycleDetector/FBRetainCycleDetector/Layout/Classes/FBClassStrongLayout.mm",
       "layoutCache[currentClass] = ivars;", "layoutCache[(id)currentClass] = ivars;")
   #解決問題二
   find_and_replace("Pods/FBRetainCycleDetector/fishhook/fishhook.c",
   "indirect_symbol_bindings[i] = cur->rebindings[j].replacement;", "if (i < (sizeof(indirect_symbol_bindings) /
        sizeof(indirect_symbol_bindings[0]))) { \n indirect_symbol_bindings[i]=cur->rebindings[j].replacement; \n }")
end

def find_and_replace(dir, findstr, replacestr)
  Dir[dir].each do |name|
    FileUtils.chmod("+w",name) #add
      text = File.read(name)
      replace = text.gsub(findstr,replacestr)
      if text != replace
         puts "Fix: " + name
         File.open(name, "w") { |file| file.puts replace }
         STDOUT.flush
      end
  end
  Dir[dir + '*/'].each(&method(:find_and_replace))
end

系統顯示類似如下。

再重新執行Pod install。

適用于

  • 崩潰分析

  • 性能分析