-
Notifications
You must be signed in to change notification settings - Fork 463
@weakify(self) optimized out(?) in Release builds xcode 6 beta 6 #80
Comments
Are you seeing the same in beta 7? |
Yes I have the same problem. I will try to reproduce it in a clear context knowing that the original one is rather complex. Unfortunately my storyboard doesn't build in xcode5 so I cannot test it in ordre to pinpoint a xcode6 issue. Still, the problem seems real to me. |
Now I can see how the problem arrises. In face I am in viewDidLoad and after a few assignment statements self becomes nil :
After this line self is nil :-( so @weakify(self) cannot work. I've tried with this just after entering in `viewDidLoaf:
But again SELF is nil. Somehow it doesn't see as the content of the block might use this weak self. |
To get a better idea, can you include the full method here? |
Here is the code:
|
I have no idea how this would happen. Have you tried with Xcode 6.0? If you can make a sample project that reproduces the problem, that could help. |
Submodule changes to be committed: * Configuration c8e5527...4ac967d (12): > Merge pull request jspahrsummers#80 from cocologics/feature/xcode9-update > Merge pull request jspahrsummers#79 from cocologics/feature/xcode9-update > Merge pull request jspahrsummers#71 from fabb/analyzer_localized > enable CLANG_ANALYZER_NONNULL > enable CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION > enables SWIFT_TREAT_WARNINGS_AS_ERRORS > Merge pull request jspahrsummers#67 from fabb/enable_nullability_completeness_warning > Merge pull request jspahrsummers#65 from Abizern/xcode8_debug_flag > Merge pull request jspahrsummers#64 from diederich/enableTestability > Merge pull request jspahrsummers#63 from diederich/implicitCaptureOfSelf > Merge pull request jspahrsummers#62 from calebd/xcode-8-beta-5-warnings > Merge pull request jspahrsummers#61 from ikesyo/disable-framework-codesigning
* bumped the xcconfigs to latest version * fix build on Xcode 9 ('void' missing in strict declaration checking) Submodule changes to be committed: * Configuration c8e5527...4ac967d (12): > Merge pull request #80 from cocologics/feature/xcode9-update > Merge pull request #79 from cocologics/feature/xcode9-update > Merge pull request #71 from fabb/analyzer_localized > enable CLANG_ANALYZER_NONNULL > enable CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION > enables SWIFT_TREAT_WARNINGS_AS_ERRORS > Merge pull request #67 from fabb/enable_nullability_completeness_warning > Merge pull request #65 from Abizern/xcode8_debug_flag > Merge pull request #64 from diederich/enableTestability > Merge pull request #63 from diederich/implicitCaptureOfSelf > Merge pull request #62 from calebd/xcode-8-beta-5-warnings > Merge pull request #61 from ikesyo/disable-framework-codesigning
Hello everybody,
I have a
@weakify(self);
inside myviewDidLoad
. Later in the code I have a call toI've noticed that in Release builds weak_self just after creation is nil as it is nil inside of the do block.
I will try to replace my
doCompleted
with asubscribeCompleted
in order to clean up a bit, but it doesn't see how it can be the cause of the problem.Do you have an idea on how this could be fixed ?
Thank you
The text was updated successfully, but these errors were encountered: