Skip to content

my injection doesn't work #93

Open
@ghost

Description

I just change the text of uilabel for test.
2016-03-14 7 40 45
2016-03-14 7 43 01

I don't understand.
Can you help me fix that issue

Activity

TangTangWan

TangTangWan commented on Mar 14, 2016

@TangTangWan

The same problem came up to me. And the outputs in the console are similar to yours.
I downloaded my injection plugin from http://injectionforxcode.com/, and my Xcode version is 7.2.1.

johnno1962

johnno1962 commented on Mar 14, 2016

@johnno1962
Owner

Normally this is becuase the ViewController has not been reloaded.

ghost

ghost commented on Mar 14, 2016

@ghost

ctrl + = didn't make ViewController reload.I must try command + R.

johnno1962

johnno1962 commented on Mar 14, 2016

@johnno1962
Owner

Injection changes the code but it needs to be re-executed i.e. -viewDidLoad needs to be called again. You could add a -injected method to the view controller and have it call -viewDidLoad for testing.

ghost

ghost commented on Mar 14, 2016

@ghost

Thank you very much.You save my life:)

huanghe810229530

huanghe810229530 commented on Mar 16, 2016

@huanghe810229530

why close? I can't solve this problem, help...

ghost

ghost commented on Mar 16, 2016

@ghost
func injected(){
     viewdidload()
}

just do that,then it works.

jonsnowwinterfell

jonsnowwinterfell commented on Mar 16, 2016

@jonsnowwinterfell

i still have no idea to make the plugin works ,when i Use the shortcut “control =" nothing happen in xocde
127af1e8-4a44-4aec-b872-934b9e7131b4

ghost

ghost commented on Mar 16, 2016

@ghost

Maybe u can install injection once again,then use command + q to close Xcode and reopen Xcode.
U will see injection work.Hope to be useful to u.

superleexpert

superleexpert commented on Mar 16, 2016

@superleexpert

I have met the similar issue about that do not work in a UIView class when adjust some properties on xcode7.2.

And I solved through changed method in -(void)injection. But it is not flexible. I really expect that code change everywhere and all will worked by "control+=".

huanghe810229530

huanghe810229530 commented on Mar 16, 2016

@huanghe810229530

@lingang009 It is not flexible, but thank you! It improves the efficiency!

orta

orta commented on Mar 19, 2016

@orta
Collaborator

People on this thread, maybe it might be a good idea to ask someone with good english and chinese skills to work on a translation of the README/docs?

ghostSamu

ghostSamu commented on Jul 10, 2016

@ghostSamu

i have the same problem, my Xcode version is 7.2.
i had added the method
-(void)injected{
[self viewDidLoad];
}

it can refresh UI
but it still print the message :

Class HomeViewController is implemented in both
Developer/CoreSimulator/Devices/0C35732D-086B-4BDA-9C0E-DF10E731D82F/data/Containers/Bundle/Application/302CFF8A-9645-4721-88FC-F7C12D92A2C7/GaoKaoHelper.app/GaoKaoHelper
and
Desktop/GaoKaoHelper/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle.
One of the two will be used. Which one is undefined.
2016-07-11 00:19:26.350 GaoKaoHelper[61611:9789048] Ignore any warning, Swizzled HomeViewController 0x111760598 -> 0x104fa7b48
8 injections performed so far.

johnno1962

johnno1962 commented on Jul 10, 2016

@johnno1962
Owner

The message is a warning. Add an NSLog to see if -injected gets called.

ghostSamu

ghostSamu commented on Jul 11, 2016

@ghostSamu

@johnno1962

yes ,it is called.

i just don't understand this message:
One of the two will be used. Which one is undefined.
one is in .app
one is in bundle
can i choose just one? how?

johnno1962

johnno1962 commented on Jul 11, 2016

@johnno1962
Owner

The warning comes from the runtime. You can ignore it. Injection does the right thing.

tolord

tolord commented on Jul 18, 2016

@tolord
  • (void)loadView {
    [super loadView];
    self.title = @"服务管理";
    self.view.backgroundColor = COLOR_GRAY_EE;
    [self initLeftBarButtonBack];
    self.emptyString = @"您还没开通任何服务,赶快开通吧";
    }

i change the self.title's name,and then i press shift + control + = ,then,the window became empty
why??

log is here
//--------------------------------------------
objc[40764]: Class InjectionBundle3 is implemented in both /Users/liaozhongru/Desktop/3.application/AKServer/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle and /Users/liaozhongru/Desktop/3.application/AKServer/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle5.bundle/InjectionBundle. One of the two will be used. Which one is undefined.
objc[40764]: Class AKServiceManageViewController is implemented in both /Users/liaozhongru/Library/Developer/CoreSimulator/Devices/7C1D8286-1B79-43BF-934B-61CAC7F70326/data/Containers/Bundle/Application/62F43460-59E2-45CD-9066-D4F677705BD0/alijkManager.app/alijkManager and /Users/liaozhongru/Desktop/3.application/AKServer/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle5.bundle/InjectionBundle. One of the two will be used. Which one is undefined.
2016-07-18 17:40:26.268 alijkManager[40764:4320988] BundleInjection.h [Line: 1005] __41+[BundleInjection autoLoadedNotify:hook:]_block_invoke Ignore any warning, Swizzled AKServiceManageViewController 0x122535c00 -> 0x107448bb8
30 injections performed so far.

johnno1962

johnno1962 commented on Jul 18, 2016

@johnno1962
Owner

You are using “inject and reset” by mistake whicih doesn’t always work. Use "control - =" not "control - shift - ="

Huang-Libo

Huang-Libo commented on Jan 22, 2017

@Huang-Libo

@lingang009
Thanks, you save my life!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @orta@superleexpert@johnno1962@huanghe810229530@tolord

        Issue actions

          my injection doesn't work · Issue #93 · johnno1962/injectionforxcode