-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[TIMOB-27082] fix(ios): restore SDK < 8.1.0 compatibility #10897
Conversation
|
@sgtcoolguy i did a quick check of #10381 and it looks like a few more proxies are affected:
|
@hansemannn Technically, anything that went from TiProxy -> ObjcProxy hierarchy would be affected in this way, but obviously we don't expect people to instantiate any modules as they're intended to be singletons. So I guess that'd mean these particular types are affected:
And just adding back the old init methods seems to fix the issue for you? |
Yep, that works, because the linked (compiled) modules only search for the selectors and performs them if found. For classic proxies, having the default EDIT: We should also keep in mind that those proxies have usually been |
@hansemannn I've added back the old init page context methods for the other proxies I listed above. Can you confirm this works fine for you, and then I'll merge it? |
@@ -111,6 +111,26 @@ - (NSUInteger)size | |||
} | |||
GETTER_IMPL(NSUInteger, size, Size); | |||
|
|||
- (id)_initWithPageContext:(id<TiEvaluator>)pageContext | |||
{ | |||
return [[TiBlob alloc] init]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default _initWithPageContext:
constructor should be re-added to the parent class (TiProxy
) again, since other proxies (especially in modules) may be constructed that way as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, I can do that too, I suppose.
Related: why do we need to alloc calls here? Typical usage before was:
[[TiBlob alloc] _initWithPageContext:context];
so should the redirecting version just be:
- (id)_initWithPageContext:(id<TiEvaluator>)pageContext
{
return [self init];
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, no alloc required!
@@ -15,6 +15,11 @@ @implementation TiCalendarRecurrenceRule | |||
|
|||
#pragma mark - Internals | |||
|
|||
- (id)_initWithPageContext:(id<TiEvaluator>)context rule:(EKRecurrenceRule *)rule_ | |||
{ | |||
return [self initWithRule:rule]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sgtcoolguy rule_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can run the project locally in iphone/iphone/Titanium.xcodeproj.
add _initWithPageContext to base ObjcProxy, add other legacy initializer methods to changed proxies Fixes TIMOB-27082
JIRA: https://jira.appcelerator.org/browse/TIMOB-27082
Note: There may be more classes that are affected by moving to the JSCore ObjC API, so this may need to be extended further. We're currently testing all cases.
cc @sgtcoolguy
EDIT: No more affected cases for us.