Core Data Sorting Error - sorting

I am attempting to sort a core data array by an entity called company. However, my app currently doesn't sort the data with the code I'm using. What's up?
Here is the error:
2013-11-15 17:07:59.615 Minutes[70925:a0b] (
"<NSManagedObject: 0x89d4d40> (entity: Device; id: 0x89bdff0 <x-coredata://29EA13EB-909E-46E8-B8FD-C71A9B6436CE/Device/p2> ; data: {\n company = Reading;\n name = 1;\n version = \"Minutes of Harry Potter\";\n})",
"<NSManagedObject: 0x89d4ad0> (entity: Device; id: 0x8986ff0 <x-coredata://29EA13EB-909E-46E8-B8FD-C71A9B6436CE/Device/p1> ; data: {\n company = Service;\n name = 2;\n version = \"Minutes of Community\";\n})",
"<NSManagedObject: 0x89d4db0> (entity: Device; id: 0x8997950 <x-coredata://29EA13EB-909E-46E8-B8FD-C71A9B6436CE/Device/p3> ; data: {\n company = Service;\n name = 0;\n version = \"Minutes of Blank\";\n})"
)
Here is the code used to sort the array:
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
// Fetch the devices from persistent data store
NSManagedObjectContext *managedObjectContext = [self managedObjectContext];
NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] initWithEntityName:#"Device"];
self.devices = [[managedObjectContext executeFetchRequest:fetchRequest error:nil] mutableCopy];
fetchRequest.sortDescriptors = #[[NSSortDescriptor sortDescriptorWithKey:
#"company" ascending:YES]];
[self.tableView reloadData];
}
Thanks in advance!!
EDIT: Here is some code showing how I display the data:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return self.devices.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
// Configure the cell...
NSManagedObject *device = [self.devices objectAtIndex:indexPath.row];
[cell.textLabel setText:[NSString stringWithFormat:#"%# %#", [device valueForKey:#"name"], [device valueForKey:#"version"]]];
[cell.detailTextLabel setText:[device valueForKey:#"company"]];
return cell;
}

Works as expected. "Reading" <= "Service" <= "Service".
You sort self.devices into sortedPeople, but in your table view's datasource you are displaying self.devices which is unsorted.
Attach the sort descriptor to the fetch request and dispense with the sortedPeople array, and you your code should work as expected again.
fetchRequest.sortDescriptors = #[[NSSortDescriptor sortDescriptorWithKey:
#"company" ascending:YES]];
Also, not that you probably have a type in your cell method: it should be NSManagedObject, not NSManagedObjectModel. I recommend to use a subclass named Device (Xcode can auto generate that for you) and use its properties rather than Key-Value-Coding.
Edit:
BTW. If you change something after you use it, then whatever you used it for will not include that change. For example:
x = 1;
y = x + 1; // y == 2
x = 3; // y == 2 (nothing changed for y)
y = x + 1; // y == 4 (y was used after the change)
The same applies to fetch results generated by executing fetches (y) and the corresponding fetch request (x).

Related

PFQueryTableView Memory

I've been working with the PFQueryTableView with images and text. After implementing this code:
- (id)initWithCoder:(NSCoder *)aDecoder {
self = [super initWithClassName:#"Story"];
self = [super initWithCoder:aDecoder];
if (self) { // This table displays items in the Todo class
self.parseClassName = #"Story";
self.pullToRefreshEnabled = YES;
self.paginationEnabled = YES;
self.objectsPerPage = 25;
}
return self;
}
- (PFQuery *)queryForTable {
PFQuery *query = [PFQuery queryWithClassName:self.parseClassName];
if (self.objects.count == 0) {
query.cachePolicy = kPFCachePolicyCacheThenNetwork;
}
[query orderByDescending:#"createdAt"];
return query;
}
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
object:(PFObject *)object {
static NSString *cellIdentifier = #"cell";
PFTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
cell = [[PFTableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
reuseIdentifier:cellIdentifier];
}
// Configure the cell to show todo item with a priority at the bottom
cell.textLabel.text = object[#"snapDetails"];
PFFile *thumbnail = [object objectForKey:#"snap"];
cell.imageView.image = [UIImage imageNamed:#"placeholder.jpg"];
cell.imageView.file = thumbnail;
return cell;
}
the log gives me this strange warning:
[/BuildRoot/Library/Caches/com.apple.xbs/Sources/CoreUI/CoreUI-
371.4/Bom/Storage/BOMStorage.c:522] is not a BOMStorage file
along with a regular memory warning. Occasionally the app also crashes and XCode displays a message that claims that it has lost connection to my iPhone. When checking the memory usage, as the table goes up or down the memory continues to increase as if the images (which are screen sized) are never released as they go off screen. Any ideas as to what can be happening?
almost in all cases, this is harmless unless your url is wrong.to make the BOMStorage file more serious, you can add this:
urlString = [urlString stringByAddingPercentEncodingWithAllowedCharacters:[NSCharacterSet URLQueryAllowedCharacterSet]];
Besides,you can choose other method to replace:
[image stretchableImageWithLeftCapWidth:0 topCapHeight:0] forState:UIControlStateNormal]

TableView with Image cell, need to improve my code

I'm so frustrated with this code, It's been weeks and I can't find a solution to my problem.
My RSS application working great with some of the RSS's , it successfully pulling the image from the article into thumbnail to my table view. I figure out when the RSS XML type of file look in this structure, it's working great :
<item>
<title>" title going to be here "</title>
<description>
here is the description plus the image file <p><img src='http://img.mako.co.il/2014/05/20/maytal_7_a.jpg'/></p>
</description>
<link>
here is going to be the link
</link>
my problem is that some RSS's don't have the image in the description, so I need to pull it off the article it self .
my current cellForRowAtIndexPath code is this :
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NewsItemCell *cell = (NewsItemCell *)[tableView dequeueReusableCellWithIdentifier:STORYBOARD_KEY__ID__NEWS_ITEM_TABLE_CELL];
if (cell == nil)
{
cell = [[NewsItemCell alloc] initWithFrame:CGRectMake(0, 0, MAIN_TABLE_CELL__NEWS_ITEM_CELL_WIDTH, MAIN_TABLE_CELL__NEWS_ITEM_CELL_HEIGHT)];
}
NewsItem *currentNewsItem = [self.newsItemsForSingleSource objectAtIndex:indexPath.row];
NSString* imageURL = currentNewsItem.imageUrl;
if ( [imageURL length] > 0 ) {
[cell.thumbnailImageView setImageWithURL: [NSURL URLWithString: [imageURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] ];
}
else {
// placeholder if no image available
// cell.thumbnailImageView.backgroundColor = [UIColor colorWithRed:0.4 green:0.4 blue:0.4 alpha:0.9];
NSString * filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:#"placeholder_1.png"];
[cell.thumbnailImageView setImage:[UIImage imageWithContentsOfFile:filePath]];
}
cell.titleLabelView.text = currentNewsItem.title;
cell.newsItem = currentNewsItem;
return cell;
}
in other application I had , I used this pattern of code to grab the first image of the article and it's worked great :
MWFeedItem *item = [listadoArticulos objectAtIndex:indexPath.row];
// my Method to search and fetch the pictures to cell
if (item) {
NSString *htmlContent = item.content;
NSString *imgSrc;
// find match for image
NSRange rangeOfString = NSMakeRange(0, [htmlContent length]);
NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:#"(<img.*?src=\")(.*?)(\".*?>)" options:0 error:nil];
if ([htmlContent length] > 0) {
NSTextCheckingResult *match = [regex firstMatchInString:htmlContent options:0 range:rangeOfString];
if (match != NULL ) {
NSString *imgUrl = [htmlContent substringWithRange:[match rangeAtIndex:2]];
NSLog(#"url: %#", imgUrl);
NSLog(#"match %#", match);
if ([[imgUrl lowercaseString] rangeOfString:#"feedburner"].location == NSNotFound) {
imgSrc = imgUrl;
[cell.myCellImage setImageWithURL:[NSURL URLWithString:imgSrc] placeholderImage:[UIImage imageNamed:#"customItem30.png"]];
}}}}
my question is, how can I combine both of them codes ? or maybe someone can think about other solution ( like a better code than mine ) .
any help will be appreciated .
EDIT ** : Ohh I forgot to put the CellForRowAtIndex
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NewsItemCell *cell = (NewsItemCell *)[tableView dequeueReusableCellWithIdentifier:STORYBOARD_KEY__ID__NEWS_ITEM_TABLE_CELL];
if (cell == nil)
{
cell = [[NewsItemCell alloc] initWithFrame:CGRectMake(0, 0, MAIN_TABLE_CELL__NEWS_ITEM_CELL_WIDTH, MAIN_TABLE_CELL__NEWS_ITEM_CELL_HEIGHT)];
}
NewsItem *currentNewsItem = [self.newsItemsForSingleSource objectAtIndex:indexPath.row];
NSString* imageURL = currentNewsItem.imageUrl;
if ( [imageURL length] > 0 ) {
[cell.thumbnailImageView setImageWithURL: [NSURL URLWithString: [imageURL stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]] ];
}
else {
// placeholder if no image available
// cell.thumbnailImageView.backgroundColor = [UIColor colorWithRed:0.4 green:0.4 blue:0.4 alpha:0.9];
NSString * filePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:#"placeholder_1.png"];
[cell.thumbnailImageView setImage:[UIImage imageWithContentsOfFile:filePath]];
}
cell.titleLabelView.text = currentNewsItem.title;
cell.newsItem = currentNewsItem;
return cell;
}
First you can check whether the RSS feed contains any image url in the description tag using the regular expression (another application).If image is present,then only you have to create the News Item object and add that article.
NSMutableArry * newsItemsForSingleSource = [[NSMutableArray alloc]init];
for(int i=0;i<listadoArticulos.count;i++)
{
MWFeedItem *item = [listadoArticulos objectAtIndex:i];
// my Method to search and fetch the pictures to cell
if (item) {
NSString *htmlContent = item.content;
NSString *imgSrc;
// find match for image
NSRange rangeOfString = NSMakeRange(0, [htmlContent length]);
NSRegularExpression* regex = [NSRegularExpression regularExpressionWithPattern:#"(<img.*?src=\")(.*?)(\".*?>)" options:0 error:nil];
if ([htmlContent length] > 0) {
NSTextCheckingResult *match = [regex firstMatchInString:htmlContent options:0 range:rangeOfString];
if (match != NULL ) {
NSString *imgUrl = [htmlContent substringWithRange:[match rangeAtIndex:2]];
NSLog(#"url: %#", imgUrl);
NSLog(#"match %#", match);
if ([[imgUrl lowercaseString] rangeOfString:#"feedburner"].location == NSNotFound) {
imgSrc = imgUrl;
NewsItem * currentNewsItem = [[NewsItem alloc]init];
currentNewsItem.imageUrl = imgSrc;
currentNewsItem.title = #"title";
currentNewsItem.Description = #"description";
[self.newsItemsForSingleSource addObject:currentNewsItem];
[currentNewsItem release];
}}}}
}
Then populate the NewsItem in the tableview cellForRowAtIndexPath.You have news which surely contains image.

The "index 1 beyond bounds" error after JSON parsing and UITableView populating

Here is my code (I need to parse multiple JSON files from a source on a remote server) and I need to populate UITableView with the SINGLE value of each parse:
The single JSON source (simple), at h**p://WWW.REMOTESERVERWITHJSONSOURCE.NET/A1:
{
"id": 0001,
"main": {
"main1A": 100,
},
"main2": {
"main2A": 200,
},
"url": "http...",
}
Alloc and initialize my Array:
- (void)viewDidLoad {
// other stuff
arrayA = [[NSMutableArray alloc] initWithObjects:#"A1", #"A2", nil]; //each object A1, A2...An is the single JSON source I need to parse
arrayB = [[NSMutableArray alloc] initWithObjects:#"B1", #"B2", nil];
}
Parse Method:
- (void)LoadParse {
main = [[NSMutableArray alloc] init];
main2 = [[NSMutableArray alloc] init];
for (int i=0; i < [arrayA count]; i++) {
NSURL *url = [NSURL URLWithString:
[NSString stringWithFormat:
#"http://WWW.REMOTESERVERWITHJSONSOURCE.NET/%#",[arrayA objectAtIndex:i]]];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) {
NSMutableDictionary *arrayMain = [JSON valueForKey:#"main"];
[main addObject:[arrayMain objectForKey:#"main1A"]];
NSMutableDictionary *arrayMain2 = [JSON valueForKey:#"main2"];
[main2 addObject:[arrayMain2 objectForKey:#"main2A"]];
[table reloadData];
[table scrollRectToVisible:CGRectMake(0, 0, 1, 1) animated:YES];
}
failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id JSON){
}];
[operation start];
}
}
The UITableView methods:
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [arrayA count];
}
// other methods
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"Cell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:
UITableViewCellStyleSubtitle reuseIdentifier:#"Cell"];
}
cell.textLabel.font = [UIFont systemFontOfSize:12];
cell.detailTextLabel.font = [UIFont systemFontOfSize:11];
cell.textLabel.text = [NSString stringWithFormat:#"%# - %#",[main objectAtIndex:indexPath.row],[main2 objectAtIndex:indexPath.row]]; // here I get error 'NSRangeException', reason: '*** -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]'
cell.textLabel.backgroundColor = [UIColor clearColor];
cell.detailTextLabel.backgroundColor = [UIColor clearColor];
return cell;
}
THE ERROR: when I alloc and initialize ONLY ONE object in arrayA it's all right: UITableView populates with ONE row and get values of main1 and main2; IF I alloc and initialize MORE THAN ONE object in arrayA, like in this example, app crashes with error signal SIGABRT: 'NSRangeException', reason: '* -[__NSArrayM objectAtIndex:]: index 1 beyond bounds [0 .. 0]' ... what is wrong? Please help me to find the trouble, thank you!
[ADDITION]
// Implement this for your numberOfRowsInSection
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
unsigned int mCount = [main count];
unsigned int m2Count = [main2 count];
return ( (mCount > m2Count) ? mCount : m2Count );
}
[ADDITION 2]
// Implement something like this within your cellForRowAtIndexPath routine
bool mainExist = ( (indexPath.row < [main count]) ? YES : NO );
bool main2Exist = ( (indexPath.row < [main2 count]) ? YES : NO );
if(YES == mainExist && YES == main2Exist){
cell.textLabel.text = [NSString stringWithFormat:#"%# - %#",[main objectAtIndex:indexPath.row],[main2 objectAtIndex:indexPath.row]];
}else if(YES == main2Exist){
cell.textLabel.text = [NSString stringWithFormat:#"___ - %#",[main2 objectAtIndex:indexPath.row]];
}else{ // YES == mainExist
cell.textLabel.text = [NSString stringWithFormat:#"%# - ___",[main objectAtIndex:indexPath.row]];
}
Looks like (from your code) that you are using arrayA to drive your cell count routine, but using main and main2 to populate. Shouldnt you be using main and / or main2 to also generate your cell count routine output.
What looks to be happening is that arrayA has 2 elements as you are initializing that way, but because of the data, main and main2 only get filled with 1. Thus when your cell count routine returns 2, the cell generator routine is looking for main and main2 index 1, when the index only goes to 0.
This is just what I see straight from your code, if your code or the data are actually different, please let me know.

Getting reddit feed as JSON and parsing it

I'm trying to parse JSON feed from reddit.com and then display it in a tableview. The JSON looks like this:
{
kind: Listing
data: {
modhash: 3lmt2d4hq6797af804da91bde566bd067ddee68e1e7f8e0dda
children: [
{
kind: t3
data: {
domain: imgur.com
banned_by: null
media_embed: { }
subreddit: funny
selftext_html: null
selftext:
likes: null
link_flair_text: null
id: 16e9so
clicked: false
title: I left my dog unattended with the 2 year old...
num_comments: 166
score: 2213
approved_by: null
over_18: false
hidden: false
thumbnail: http://c.thumbs.redditmedia.com/DaoiOlvtdjaPBG3n.jpg
subreddit_id: t5_2qh33
edited: false
link_flair_css_class: null
author_flair_css_class: null
downs: 2481
saved: false
is_self: false
permalink: /r/funny/comments/16e9so/i_left_my_dog_unattended_with_the_2_year_old/
name: t3_16e9so
created: 1357963292
url: http://imgur.com/zGMxP
author_flair_text: null
author: ShaneNickerson
created_utc: 1357934492
media: null
num_reports: null
ups: 4694
}
...more items here
}
And here's my tableview controller code:
#import "mainRedditFunViewController.h"
#define kBgQueue dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0)
#define kjsonURL [NSURL URLWithString: #"http://reddit.com/r/funny/.json"
#interface mainRedditFunViewController ()
#end
#implementation mainRedditFunViewController
- (void)viewDidLoad
{
[super viewDidLoad];
dispatch_async(kBgQueue, ^{
NSData* data = [NSData dataWithContentsOfURL:[NSURL URLWithString:#"http://reddit.com/r/funny/.json"]];
[self performSelectorOnMainThread:#selector(fetchedData:)
withObject:data waitUntilDone:YES];
});
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] ;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
NSDictionary *appsdict = [jsonResults objectAtIndex:indexPath.row];
NSString *VersionString = [appsdict objectForKey:#"url"];
NSString *priceString = [appsdict objectForKey:#"author"];
NSURL *imageURL = [NSURL URLWithString:[appsdict objectForKey:#"thumbnail"]];
NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
UIImage *imageLoad = [[UIImage alloc] initWithData:imageData];
cell.textLabel.text = [appsdict objectForKey:#"title"];
cell.detailTextLabel.text = [NSString stringWithFormat:#"URL: %# Author: $ %# USD",VersionString,priceString];
cell.imageView.image = imageLoad;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return [jsonResults count];
}
- (void)fetchedData:(NSData *)responseData {
NSError* error;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:responseData
options:kNilOptions
error:&error];
jsonResults = [json objectForKey:#"data.children"];
[self.tableView reloadData];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#end
However, the output is completly empty. Is there anyway I could fix it? I tried it before with another (smaller) feed and it worked fine. I'm sure if I'm doing the JSONPath formatting correctly, since I'd look like that:
-kind
->data
->children
->data (my items)
->data
->data
...
I'd appreciate any help I get!
Im sorry that this answer is late! hope that it is still needed...
I have altered your code a little bit to access the sub levels of the returned Json results.
You certainly have the right Idea but just need a few more dictionaries in your fetchedData method. If you add these dictionaries in you method underneath your NSJSONSerialization;
NSDictionary* json = [NSJSONSerialization
JSONObjectWithData:data
options:kNilOptions
error:&error];
//NSArray *Fullarray = [[NSArray alloc] initWithObjects:json, nil];
_jsonResult = [[NSMutableArray alloc] init];
NSDictionary *dataDict = [json objectForKey:#"data"];
NSDictionary *chilrenDict = [dataDict objectForKey:#"children"];
for (NSDictionary *informationFromChild in chilrenDict) {
NSLog(#"chil %#", chilrenDict);
[_jsonResult addObject:chilrenDict];
}
Then in your tableView cellForRow change your appsDict to this
NSDictionary *appsdict = [[_jsonResult objectAtIndex:indexPath.row] objectForKey:#"data"];
That should fix up the code and populate the tableView...
You can run a check on this too by checking
NSLog(#"count %i", [_jsonResult count]);
Let me know if this has been of help, happy coding. T

Custom cells - how can I separate out tweets into componentsseparatedbyString

I have a custom cell in a tableview. All connections are made. I am conducting a Twitter search. The results of this propagate a custom cell in a tableView. I would like to separate the individual tweets out into an array using componentsseparatedbystring so that I can assign these to 4 labels in my custom cell. Any help would be greatly appreciated. Here is my code.
- (void)fetchTweets
{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSData* data = [NSData dataWithContentsOfURL:
[NSURL URLWithString: #"https://api.twitter.com/1/statuses/public_timeline.json"]];
NSError* error;
tweets = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&error];
dispatch_async(dispatch_get_main_queue(), ^{
[self.tableView reloadData];
});
});
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return tweets.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"TweetCell";
customCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
// added this bit in
cell = [[customCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
// THIS IS THE BIT I'M STRUGGLING WITH
// I'M GUESSING THAT THIS LINE SEPARATES THE TWEETS INTO SINGLE TWEETS?
NSDictionary *tweet = [tweets objectAtIndex:indexPath.row];
// I THEN CREATE AN ARRAY TO HOLD MY COMPONENTS OF THE TWEET SO THAT I CAN SPLIT FOR MY LABELS
NSArray *arrayForCustomCell = [[NSArray alloc] init];
arrayForCustomCell = [tweet componentsSeparatedByString:#":"];
return cell;
}
You have already parsed the results in your async call. Now, you have an array of 'tweet' dictionaries and you can grab any value like this:
NSDictionary *tweet = [tweets objectAtIndex:indexPath.row];
NSString *tweetText = [tweet valueForKey:#"text"];
NSString *tweetCountry = [tweet valueForKeyPath:#"place.country"] //Nested property
and then you just set your UILabels. You get the idea...

Resources