-
Notifications
You must be signed in to change notification settings - Fork 74
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
@synthesize of 'weak' property is only allowed in ARC or GC mode #104
Comments
Hey @loretoparisi, It’s indeed an ARC project. It looks like you need to init our submodules, which contains an Xcode config file defining almost all of our settings. Including the “use ARC” one. Running the following command from the root of the project and then re-opening the Xcode workspace should resolve the issue: git submodule update --init |
@rastersize right I initialized the submodules, cleaned up, it fixed that error, but now I get
since the property is @Property (nonatomic, strong, readonly, nullable) NSData *body; Ok it's something else since I get this in several locations like:
|
Should'n it an unwrap like NSDictionary *jsonDictionary=nil;
NSData *responseBody=response.body;
if(responseBody) {
jsonDictionary = [NSJSONSerialization JSONObjectWithData:responseBody
options:NSJSONReadingAllowFragments
error:&error];
}
if (!jsonDictionary) {
NSLog(@"Error: %@", error);
return;
} |
I was able to fix after unwrapping all those ones like in AppDelegate.m where I had two: NSError *error = nil;
NSDictionary *oauthTokenDictionary = nil;
NSData *responseBody=response.body;
if(responseBody) {
oauthTokenDictionary = [NSJSONSerialization JSONObjectWithData:responseBody
options:NSJSONReadingAllowFragments
error:&error];
} and in - (void)dataLoader:(SPTDataLoader *)dataLoader didReceiveErrorResponse:(SPTDataLoaderResponse *)response
{
@synchronized(self.pendingRequests) {
for (SPTDataLoaderRequest *pendingRequest in self.pendingRequests) {
NSError *error=response.error;
[self.delegate dataLoaderAuthoriser:self didFailToAuthoriseRequest:pendingRequest withError:error];
}
}
} |
- Explicitly unwraps the properties that might be nil. - Resolves #104.
@loretoparisi Ah yes, thank you! I’ve created a PR that should fix these, #105. |
- Explicitly unwraps the properties that might be nil. - Resolves #104.
+1 the last one was in here #pragma mark SPTDataLoaderDelegate
- (void)dataLoader:(SPTDataLoader *)dataLoader didReceiveSuccessfulResponse:(SPTDataLoaderResponse *)response
{
NSError *error = nil;
NSDictionary *tokenDictionary = nil;
NSData *responseBody=response.body;
if(responseBody) {
tokenDictionary = [NSJSONSerialization JSONObjectWithData:responseBody
options:NSJSONReadingAllowFragments
error:&error];
} |
@loretoparisi Thanks for taking the time to report the issue 🙇🎈 |
@rastersize you're welcome, thanks for share it, very interesting and useful! Closing then! |
Is the library a ARC project?
The text was updated successfully, but these errors were encountered: