nst / STTwitter

A stable, mature and comprehensive Objective-C library for Twitter REST API 1.1
BSD 3-Clause "New" or "Revised" License
999 stars 161 forks source link

ARC Errors #230

Closed pinkal closed 8 years ago

pinkal commented 9 years ago

In STHttpRequest.m, STTwitterOSRequest.m files having lots of arc errors, I have set -fobjc-arc flag for both the files. My project is non arc.

Error list: Twitter/STTwitter/STTwitterOSRequest.m:188:26: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:188:17: warning: 'strong' only applies to Objective-C object or block pointer types; type here is 'int' [-Wignored-attributes] block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:188:33: error: a parameter list without types is only allowed in a function definition block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:188:42: error: expected ';' at end of declaration block strong typeof(weakSelf) strongSelf = weakSelf; ^ ; Twitter/STTwitter/STTwitterOSRequest.m:189:12: error: use of undeclared identifier 'strongSelf' if(strongSelf == nil) { ^ Twitter/STTwitter/STTwitterOSRequest.m:194:13: error: use of undeclared identifier 'strongSelf' strongSelf.streamBlock(strongSelf, data); ^ Twitter/STTwitter/STTwitterOSRequest.m:194:36: error: use of undeclared identifier 'strongSelf' strongSelf.streamBlock(strongSelf, data); ^ Twitter/STTwitter/STTwitterOSRequest.m:196:14: error: use of undeclared identifier 'strongSelf' [strongSelf.data appendData:data]; ^ Twitter/STTwitter/STTwitterOSRequest.m:209:20: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] block weak typeof(self) weakSelf = self; ^ Twitter/STTwitter/STTwitterOSRequest.m:209:13: warning: 'weak' only applies to Objective-C object or block pointer types; type here is 'int' [-Wignored-attributes] block weak typeof(self) weakSelf = self; ^ Twitter/STTwitter/STTwitterOSRequest.m:209:27: error: a parameter list without types is only allowed in a function definition block weak typeof(self) weakSelf = self; ^ Twitter/STTwitter/STTwitterOSRequest.m:209:32: error: expected ';' at end of declaration block weak typeof(self) weakSelf = self; ^ ; Twitter/STTwitter/STTwitterOSRequest.m:213:26: warning: type specifier missing, defaults to 'int' [-Wimplicit-int] block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:213:17: warning: 'strong' only applies to Objective-C object or block pointer types; type here is 'int' [-Wignored-attributes] block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:213:33: error: a parameter list without types is only allowed in a function definition block strong typeof(weakSelf) strongSelf = weakSelf; ^ Twitter/STTwitter/STTwitterOSRequest.m:213:42: error: expected ';' at end of declaration block __strong typeof(weakSelf) strongSelf = weakSelf; ^ ; fatal error: too many errors emitted, stopping now [-ferror-limit=] 12 warnings and 20 errors generated.

softmixt commented 9 years ago

Yes I have same error :

__weak typeof(self) weakSelf = self; STTwitter/STTwitterAppOnly.m:116:19: A parameter list without types is only allowed in a function definition

pinkal commented 9 years ago

I have resolved this by replacing typeof with __typeof.

softmixt commented 9 years ago

cool anyway I also fix that by settings this in my XCode :

To change this: open the Project Navigator > click the project > click the target > Select the C Language Dialect > Hit backspace to set the default value. izamg

JibranTassaduq commented 8 years ago

Thanks Alot softmixt :+1: its perfect solution for me.