Note that there are some explanatory texts on larger screens.

plurals
  1. POTwitter Feed not showing full tweet
    primarykey
    data
    text
    <p>So I am making an app that one part of it displays the users tweets in a table view. However there's something getting corrupted with some tweets such as its only showing a single character such as (") or an emoji character. In example if the tweet says:</p> <p><code>RT @jakemillermusic: Everyone upload your pics that you took today during the ustream and caption it "follow @jakemillermusic #jakemiller"</code></p> <p>when shown with NSLog it prints :</p> <hr> <p>2013-04-03 00:34:30.476 ParsingXMLTutorial[3308:c07] RT @jakemillermusic: Everyone upload your pics that you took today during the ustream and caption it</p> <p>2013-04-03 00:34:30.476 ParsingXMLTutorial[3308:c07] "</p> <p>2013-04-03 00:34:30.477 ParsingXMLTutorial[3308:c07] follow @jakemillermusic #jakemiller</p> <p>2013-04-03 00:34:30.478 ParsingXMLTutorial[3308:c07] "</p> <hr> <p>Here's the URL I am using to fetch the XML format:</p> <p><a href="http://api.twitter.com/1/statuses/user_timeline/LexxiSaal.xml?include_entities=true&amp;include_rts=true&amp;screen_name=twitterapi&amp;trim_user=false&amp;contributor_details=true&amp;count=50" rel="nofollow">http://api.twitter.com/1/statuses/user_timeline/LexxiSaal.xml?include_entities=true&amp;include_rts=true&amp;screen_name=twitterapi&amp;trim_user=false&amp;contributor_details=true&amp;count=50</a></p> <hr> <p>HERES THE PARSING CODE:</p> <pre><code>-(id) loadXMLByURL:(NSString *)urlString { _tweets = [[NSMutableArray alloc] init]; NSURL *url = [NSURL URLWithString:urlString]; NSData *data = [[NSData alloc] initWithContentsOfURL:url]; parser = [[NSXMLParser alloc] initWithData:data]; parser.delegate = self; [parser parse]; return self; } - (void) parser:(NSXMLParser *)parser foundCharacters:(NSString *)string { //string = [string stringByReplacingOccurrencesOfString:@" " withString:@""]; // space string = [string stringByReplacingOccurrencesOfString:@"\n" withString:@""]; // newline string = [string stringByReplacingOccurrencesOfString:@"\t" withString:@""]; currentNodeContent = (NSMutableString *) [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; } - (void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementname namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict { if ([elementname isEqualToString:@"status"]) { currentTweet = [Tweet alloc]; isStatus = YES; } if ([elementname isEqualToString:@"user"]) { isStatus = NO; } } - (void) parser:(NSXMLParser *)parser didEndElement:(NSString *)elementname namespaceURI: (NSString *)namespaceURI qualifiedName:(NSString *)qName { if (isStatus) { if ([elementname isEqualToString:@"created_at"]) { currentTweet.dateCreated = currentNodeContent; } if ([elementname isEqualToString:@"text"]) { currentTweet.content = currentNodeContent; } } if ([elementname isEqualToString:@"status"]) { [self.tweets addObject:currentTweet]; currentTweet = nil; currentNodeContent = nil; } } @end </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload