Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RxSwift.resourceCount not accessable #378

Closed
kbala opened this issue Jan 1, 2016 · 26 comments
Closed

RxSwift.resourceCount not accessable #378

kbala opened this issue Jan 1, 2016 · 26 comments

Comments

@kbala
Copy link

kbala commented Jan 1, 2016

if TRACE_RESOURCES

private let startResourceCount = RxSwift.resourceCount

endif

Says,
Module 'RxSwift' has no member named 'resourceCount'

@sergdort
Copy link
Collaborator

sergdort commented Jan 2, 2016

Please take a look on #301

@kbala
Copy link
Author

kbala commented Jan 3, 2016

Hi @sergdort I set the OtherSwift Compiler Flags same as you did, still I have same issue, Please see the below SS

2016-01-03_1318

@sergdort
Copy link
Collaborator

sergdort commented Jan 4, 2016

Hi @kbala did you make a post POD install hook ?

use_frameworks!

pod 'RxSwift'

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end

@singno
Copy link

singno commented Jan 4, 2016

I use Carthage build version: github "ReactiveX/RxSwift" ~> 2.0 . And I cann't access RxSwift. resourceCount too.

image

image

@sergdort
Copy link
Collaborator

sergdort commented Jan 4, 2016

Here is screen shot from RxExample, looks like it should be -D TRACE_RESOURCES

screen shot 2016-01-04 at 11 40 43 am

@singno
Copy link

singno commented Jan 4, 2016

It seems not working for me.

@sergdort
Copy link
Collaborator

sergdort commented Jan 4, 2016

And it off course should be in the framework build settings. I'm not sure is it possible to do some configurations with Carthage, like with Cocoapods

screen shot 2016-01-04 at 12 38 12 pm

@kzaher
Copy link
Member

kzaher commented Jan 4, 2016

You can't access resourceCount with Carthage because, as far as I'm aware of, Carthage only uses release version of the binaries, and you can't specify addition compilation flags.

Once any version of RxSwift libraries is compiled without TRACE_RESOURCES Swift flag, the code that traces resources is simply not compiled inside the library.

If Carthage supported specifying additional Swift flags during compilation, that would be possible, but I'm not sure it currently supports that or is there some other way to solve that using Carthage.

@singno
Copy link

singno commented Jan 4, 2016

@kzaher Yes, Carthage seems can not change build setting.
@sergdort I can not set the build setting of RxSwift framework.

@ikesyo
Copy link
Contributor

ikesyo commented Jan 5, 2016

You can use carthage build --configuration Debug.

@kbala
Copy link
Author

kbala commented Jan 5, 2016

yes, I run carthage build --configuration Debug

I can access the resourceCount now, and it works 👍

@kzaher
Copy link
Member

kzaher commented Jan 5, 2016

Thnx @ikesyo :)

@kzaher
Copy link
Member

kzaher commented Jan 5, 2016

And thnx @sergdort , helping with issues helps a lot 👍

@kbala kbala closed this as completed Jan 9, 2016
@sunflash
Copy link

carthage build --platform iOS --configuration Release-Tests
work too

@scotteg
Copy link
Collaborator

scotteg commented Jun 5, 2016

You can also quickly enable RxSwift.resourceCount by adding the TRACE_RESOURCES flag to the RxSwift target, e.g., in the Pods project, Build settings > Other Swift flags > Debug:

screenshot 2016-06-05 17 11 08

You'll just need to remember to re-enable it every time you do a pod update--which, maybe, isn't such a bad thing 😉

@scotteg scotteg reopened this Jun 5, 2016
@scotteg scotteg closed this as completed Jun 5, 2016
@RafaelPlantard
Copy link

Just remembering that right now, the resource count is getted from:
RxSwift.Resources.total.

@sergdort
Copy link
Collaborator

Hey guys you can also add post install to pod file

post_install do |installer|
   installer.pods_project.targets.each do |target|
      if target.name == 'RxSwift'
         target.build_configurations.each do |config|
            if config.name == 'Debug'
               config.build_settings['OTHER_SWIFT_FLAGS'] ||= ['-D', 'TRACE_RESOURCES']
            end
         end
      end
   end
end

@kzaher kzaher reopened this Oct 23, 2016
@kzaher
Copy link
Member

kzaher commented Oct 23, 2016

Let's add this to next release :)

@kzaher
Copy link
Member

kzaher commented Nov 20, 2016

Oh,

@sergdort I've thought we can add this to podspec also and not podfile. My bad.

@kzaher kzaher closed this as completed Nov 20, 2016
@nahung89
Copy link

follow to @kzaher in #1277, i can enable debugging with Carthage by using script:

carthage update --no-use-binaries --configuration Debug RxSwift

@majid701
Copy link

I'm having this issue as well even though I am not using Carthage. I added RxSwift to the project with Cocoapods and tried to access RxSwift.Resources.totalCount but after adding the post install script to the podfile I get a dyld: Symbol not found exception on the line RxSwift.Resources.totalCount
What is the correct way to access the total count?

@haider-kazal
Copy link

Is there any way to access RxSwift.Resources.totalCount if RxSwift is added via Swift Package Manager?

@uuttff8
Copy link

uuttff8 commented Oct 17, 2019

Is there any way to access RxSwift.Resources.totalCount if RxSwift is added via Swift Package Manager?

cc @kzaher

@Pyxisq
Copy link

Pyxisq commented Jun 18, 2020

@freak4pc @kzaher Sorry) Any updates about Swift package?

@realityworks
Copy link

Still no clear way to debug if using SwiftPackageManager.

@freak4pc
Copy link
Member

Still no clear way to debug if using SwiftPackageManager.

There is absolutely no need to go through every issue related to this and comment there.

@ReactiveX ReactiveX locked and limited conversation to collaborators Feb 10, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests