Comments (5)
Hi I tried to fetch the profile image using this block method
[_twitter getUsersShowForUserID:nil orScreenName:username_twitter includeEntities:nil successBlock:^(NSDictionary *user){
NSLog(@"%@",[user valueForKey:@"profile_image_url"]);
}errorBlock:^(NSError *error) {
NSLog(@"%@",[error localizedDescription]);
}];
But the app crashes when I use it
Crash log:
-[TWRequest preparedURLRequest]: unrecognized selector sent to instance 0xaa382f0
2014-01-05 12:22:19.449 360SA[3165:c07] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[TWRequest preparedURLRequest]: unrecognized selector sent to instance 0xaa382f0'
*** First throw call stack:
(0x2be8012 0x2286e7e 0x2c734bd 0x2bd7bbc 0x2bd794e 0x1aab04 0x1ac6dd 0x155946 0x1574bb 0x1774ab 0x3ccd7 0x154ced 0x1aa3a2 0x1cf175a 0x1cbf453 0x1cbf164 0x1d4ba31 0x23f953f 0x240b014 0x23fb7d5 0x2b8eaf5 0x2b8df44 0x2b8de1b 0x2ed37e3 0x2ed3668 0x11caffc 0x26bd 0x25e5 0x1)
libc++abi.dylib: terminate called throwing an exception
from sttwitter.
I figured it out and that is because the method is compatible with iOS 6.0+ and it doesn't work for iOS 5
Could you please make it compatible with iOS 5?
from sttwitter.
Thank you for reporting this!
I cannot test on iOS 5 right now.
Please let me know it this commit does fix the issue.
from sttwitter.
Just ran across this issue my self, so glad there was already a response as was scratching my head.. not wanting to dig in.
Ok testing running ios 7 executes the TW code, which does not give a result at all..
flipping the > than sign in these two places ran the right code block, and yup code worked (ie followed someone on twitter) ... except none of the call back blocks worked (success or error)
#if (TARGET_OS_IPHONE) && (__IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)
TWRequestMethod method = (httpMethod == 0) ? TWRequestMethodGET : TWRequestMethodPOST;
request = [[TWRequest alloc] initWithURL:url parameters:paramsWithoutMedia requestMethod:method];
#else
request = [SLRequest requestForServiceType:SLServiceTypeTwitter requestMethod:httpMethod URL:url parameters:paramsWithoutMedia];
#endif
[request setAccount:self.account];
if(mediaData) {
[request addMultipartData:mediaData withName:@"media[]" type:@"application/octet-stream" filename:@"media.jpg"];
}
self.completionBlock = completionBlock;
self.errorBlock = errorBlock;
// we use NSURLConnection because SLRequest doesn't play well with the streaming API
NSURLRequest *preparedURLRequest = nil;
#if TARGET_OS_IPHONE && (__IPHONE_OS_VERSION_MIN_REQUIRED > __IPHONE_6_0)
preparedURLRequest = [request signedURLRequest];
#else
preparedURLRequest = [request preparedURLRequest];
#endif
from sttwitter.
Thank you @nst - Perfect it works like charm now! with version iOS 5 and later versions
from sttwitter.
Related Issues (20)
- _getUserStreamStallWarning:... cancelling on receiving friends list?
- Attachment_url HOT 2
- postTokenRequest never callsback success or failure HOT 1
- Use of API only available in iOS 8
- Support for new events APIs HOT 1
- Modify character counter to take into account usernames at beginning of tweets HOT 1
- Carthage Support HOT 1
- STTwitter and iOS 11 HOT 2
- Twitter API request with JSON body HOT 2
- STTwitter in macOS 10.13 HOT 3
- Saving account to device settings HOT 1
- Perform video uploads from local NSData
- SLServiceTypeTwitter is deprecated in ios11 objc "SLServiceTypeTwitter' is deprecated: first deprecated in iOS 11.0"
- media_ids parameter is invalid.
- newest XCode throws warnings: This block declaration is not a prototype
- ⚠️ Legacy APIs must be migrated to new ones within 5 months! HOT 2
- Supporting “full_text” of a tweet with “tweet_mode=extended” HOT 1
- Twitter API 2.0
- How do I set up to jump to the Twitter App to sign in?
- Thread 1: "-[STTwitterAppOnly postTokenRequest:authenticateInsteadOfAuthorize:forceLogin:screenName:oauthCallback:errorBlock:]: unrecognized selector sent to instance 0x280371140" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sttwitter.