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

Bee_Service 内通知注册问题 / performSelectorAlongChain方法兼容ARC #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions framework/system/foundation/extension/NSObject+BeeExtension.mm
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,16 @@ - (void)performSelectorAlongChain:(SEL)sel

for ( Class thisClass in classStack )
{
#if __has_feature(objc_arc)

NSMethodSignature* sig = [thisClass instanceMethodSignatureForSelector:sel];
NSAssert(nil != sig, @"%@ does not respond to selector: '%@'", self, NSStringFromSelector(sel));
NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:sig];
[invocation setTarget:self];
[invocation setSelector:sel];
// [self setArgumentsFromValues:values forInvocation:invocation];
[invocation invoke];
#else
Method method = class_getInstanceMethod( thisClass, sel );
if ( method )
{
Expand All @@ -89,6 +99,7 @@ - (void)performSelectorAlongChain:(SEL)sel
imp( self, sel, nil );
}
}
#endif
}
}

Expand All @@ -103,6 +114,16 @@ - (void)performSelectorAlongChainReversed:(SEL)sel

for ( Class thisClass in classStack )
{
#if __has_feature(objc_arc)

NSMethodSignature* sig = [thisClass instanceMethodSignatureForSelector:sel];
NSAssert(nil != sig, @"%@ does not respond to selector: '%@'", self, NSStringFromSelector(sel));
NSInvocation* invocation = [NSInvocation invocationWithMethodSignature:sig];
[invocation setTarget:self];
[invocation setSelector:sel];
// [self setArgumentsFromValues:values forInvocation:invocation];
[invocation invoke];
#else
Method method = class_getInstanceMethod( thisClass, sel );
if ( method )
{
Expand All @@ -112,6 +133,7 @@ - (void)performSelectorAlongChainReversed:(SEL)sel
imp( self, sel, nil );
}
}
#endif
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,34 @@
<key>IDESourceControlProjectFavoriteDictionaryKey</key>
<false/>
<key>IDESourceControlProjectIdentifier</key>
<string>2832C2E4-D32B-41CA-B915-356DA11088CC</string>
<string>94F59C3D-5CA0-4152-BF14-EAD64F01B5E6</string>
<key>IDESourceControlProjectName</key>
<string>BeeFramework</string>
<key>IDESourceControlProjectOriginsDictionary</key>
<dict>
<key>9A303A14-0F0E-452A-8253-B82ED4F04EDE</key>
<string>https://github.com/gavinkwoe/BeeFramework.git</string>
<key>A9722CE9-69F5-42D4-BCF0-782E0E0B30E8</key>
<string>https://github.com/mingfuwang/BeeFramework.git</string>
</dict>
<key>IDESourceControlProjectPath</key>
<string>projects/BeeFramework.xcworkspace</string>
<key>IDESourceControlProjectRelativeInstallPathDictionary</key>
<dict>
<key>9A303A14-0F0E-452A-8253-B82ED4F04EDE</key>
<key>A9722CE9-69F5-42D4-BCF0-782E0E0B30E8</key>
<string>../..</string>
</dict>
<key>IDESourceControlProjectURL</key>
<string>https://github.com/gavinkwoe/BeeFramework.git</string>
<string>https://github.com/mingfuwang/BeeFramework.git</string>
<key>IDESourceControlProjectVersion</key>
<integer>110</integer>
<key>IDESourceControlProjectWCCIdentifier</key>
<string>9A303A14-0F0E-452A-8253-B82ED4F04EDE</string>
<string>A9722CE9-69F5-42D4-BCF0-782E0E0B30E8</string>
<key>IDESourceControlProjectWCConfigurations</key>
<array>
<dict>
<key>IDESourceControlRepositoryExtensionIdentifierKey</key>
<string>public.vcs.git</string>
<key>IDESourceControlWCCIdentifierKey</key>
<string>9A303A14-0F0E-452A-8253-B82ED4F04EDE</string>
<string>A9722CE9-69F5-42D4-BCF0-782E0E0B30E8</string>
<key>IDESourceControlWCCName</key>
<string>BeeFramework</string>
</dict>
Expand Down