Hey, I want to start by thanking you for implementing this awesome support!
There are some problems with ARC (i tested it in Xcode Version 6.1.1 (6A2008a)) with variables that are "@synthesize varName" and invoking their @selectors like ["varName" function] instead of ["self.varName" function] will throw an "unknown selector exception" because, it seems, that the variable gets an arbitrary type that does not have implemented that selector, or if the random type implements the @selector "function" then the object pointed by "varName" will be released and deallocated from memory.
For example in file LiveConnectClientCore.m
@synthesize clientId = _clientId,
scopes = _scopes,
session = _session,
status = _status,
authRequest = _authRequest,
authRefreshRequest;
FUNCTION:
(void)dealloc
{
[authRefreshRequest cancel];
--here "authRefreshRequest" has some times type NSData, some times NSString, etc... and it will crash with "unknown selector exception" since none of this types don't implement "cancel" method.
--calling [self.authRefreshRequest cancel] will fix the problem.
[authRefreshRequest release];
--here at this call will release arbitrary objects from memory
--calling [self.authRefreshRequest release]; will fix the problem
The problem is most visible and frequent in LiveConnectClientCore.m for @syntethize authRefreshRequest.
Steps to reproduce in an ARC enabled project with LiveSDK pod installed
A) Obtain an access token for an OneDrive account with "wl.offline_access" visible in scopes;
B) Kill the application;
C)Start the application (at this moment an refresh token exists and authRefreshRequest will be instantiated).
D)Do a logout like this:
[self.liveConnectClient logout];
self.liveConnectClient = nil;
Observe in LiveConnectClientCore.m -(void) dealloc "unknown selector exception" when calling [authRefreshRequest cancel] => authRefreshRequest has wrong type or if a random type implements @selector cancel then the object pointing to authRefreshRequest address will be released and deallocated from memory.
Hey, I want to start by thanking you for implementing this awesome support!
There are some problems with ARC (i tested it in Xcode Version 6.1.1 (6A2008a)) with variables that are "@synthesize varName" and invoking their @selectors like ["varName" function] instead of ["self.varName" function] will throw an "unknown selector exception" because, it seems, that the variable gets an arbitrary type that does not have implemented that selector, or if the random type implements the @selector "function" then the object pointed by "varName" will be released and deallocated from memory.
For example in file LiveConnectClientCore.m @synthesize clientId = _clientId, scopes = _scopes, session = _session, status = _status, authRequest = _authRequest, authRefreshRequest;
FUNCTION:
(void)dealloc { [authRefreshRequest cancel]; --here "authRefreshRequest" has some times type NSData, some times NSString, etc... and it will crash with "unknown selector exception" since none of this types don't implement "cancel" method. --calling [self.authRefreshRequest cancel] will fix the problem.
[_clientId release]; [_scopes release]; [_session release]; [_authRequest release]; [_storage release];
[authRefreshRequest release]; --here at this call will release arbitrary objects from memory --calling [self.authRefreshRequest release]; will fix the problem
[super dealloc]; }
Similar problems are in multiple files:
StreamReader.m: @synthesize data,
The problem is most visible and frequent in LiveConnectClientCore.m for @syntethize authRefreshRequest.
Steps to reproduce in an ARC enabled project with LiveSDK pod installed A) Obtain an access token for an OneDrive account with "wl.offline_access" visible in scopes; B) Kill the application; C)Start the application (at this moment an refresh token exists and authRefreshRequest will be instantiated). D)Do a logout like this: [self.liveConnectClient logout]; self.liveConnectClient = nil;
Thanks, Have a nice day!