remirobert / Dotzu

:iphone::eyes: In-App iOS Debugging Tool With Enhanced Logging, Networking Info, Crash reporting And More.
MIT License
1.8k stars 141 forks source link

swift 3 - crash - fix for bundle #14

Closed johndpope-karhoo closed 7 years ago

johndpope-karhoo commented 7 years ago

N.B. When using pod install on new repo that is not named remi.robert.Dotzu - sample project should crash with missing storyboard. It appears all the hardcoded references to bundle "remi.robert.Dotzu" are not working on xcode 8.2 / swift 3 - cocoapods 1.2

ManagerViewController.swift

 func didTapButton() {
        Dotzu.sharedManager.displayedList = true
        let podBundle = Bundle(for: ManagerViewController.self) // <- this line 
        let storyboard = UIStoryboard(name: "Manager", bundle: podBundle)
// otherwise  this crashes -  let storyboard = UIStoryboard(name: "Manager", bundle: Bundle(identifier: "remi.robert.Dotzu"))
        guard let controller = storyboard.instantiateInitialViewController() else {
            return
        }
        self.present(controller, animated: true, completion: nil)
    }

Could not load the "filter" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.237 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-logs" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.238 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-logs" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.245 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-app" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.246 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-app" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.250 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-settings" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:52.251 wwe-redesign-ios[30502:1861796] Could not load the "tabbar-settings" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu" 2017-03-07 10:07:56.177 wwe-redesign-ios[30502:1861796] Could not load the "bugs-icon" image referenced from a nib in the bundle with identifier "org.cocoapods.Dotzu"

johndpope commented 7 years ago

to recreate this problem create a new test cocoapod project

pod init

Podfile platform :ios, '9.0' inhibit_all_warnings! use_frameworks! target 'example' do pod 'Dotzu' end

for reference

remirobert commented 7 years ago

Here the current version :

func didTapButton() {
        Dotzu.sharedManager.displayedList = true
        let storyboard = UIStoryboard(name: "Manager", bundle: Bundle(for: ManagerViewController.self))
        guard let controller = storyboard.instantiateInitialViewController() else {
            return
        }
        self.present(controller, animated: true, completion: nil)
}

Are you using the last pod version ? Can check or try pod update The current version is the 1.6.

johndpope-karhoo commented 7 years ago

yep - my bad. thx

screen shot 2017-03-07 at 11 59 13 am
remirobert commented 7 years ago

No problem 😃