UITableView Scrolling stuck when content/text of TableCell is big - iphone

Am creating a Rss feed app. Where i need to show Description (more than 5000 characters each). Am able to show all feeds in my app but my problem when i try to scroll the UITableView the scrolling not smooth i believe i need to make lazy loading for my content but am new to iphone development. Can any one show me correct way. And also set correct Cell Size according to the content size.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *simpleTableIdentifier = #"SimpleTableCell";
SimpleTableCell *cell = (SimpleTableCell *)[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"SimpleTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
}
MWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row];
if (item) {
if(cell.gestureRecognizers.count==0){
UILongPressGestureRecognizer *longPress=[[UILongPressGestureRecognizer alloc] initWithTarget:self action:#selector(longSelection:)];
longPress.minimumPressDuration=1.0;
[cell addGestureRecognizer:longPress];
}
UIImageView *imageView=[[UIImageView alloc] initWithFrame:cell.frame];
UIImage *image=[UIImage imageNamed:#"Background.png"];
imageView.image=image;
cell.backgroundView=imageView;
[[cell textLabel] setBackgroundColor:[UIColor clearColor]];
cell.textLabel.textAlignment=NSTextAlignmentRight;
cell.textLabel.text=item.content;
cell.textLabel.numberOfLines=0;
cell.textLabel.font=[UIFont systemFontOfSize:15.0];
[cell.textLabel sizeToFit];
}
return cell;
}
Thanks

You have to use the -(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
like so:
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
MWFeedItem *item = [itemsToDisplay objectAtIndex:indexPath.row];
//make sure to add the font you're using
CGSize stringSize = [item.content sizeWithFont:[UIFont fontWithName:#"HelveticaNeue" size:14]
constrainedToSize:CGSizeMake(320, MAXFLOAT)
lineBreakMode:UILineBreakModeWordWrap];
int rowHeight = stringSize.height;
return rowHeight;
}
Put this code:
UIImageView *imageView=[[UIImageView alloc] initWithFrame:cell.frame];
UIImage *image=[UIImage imageNamed:#"Background.png"];
imageView.image=image;
cell.backgroundView=imageView;
Inside of here like so and remove it from where it is now (keeping it there causes you to have new imageviews created every time you scroll:
if (cell == nil)
{
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"SimpleTableCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
UIImageView *imageView=[[UIImageView alloc] initWithFrame:cell.frame];
UIImage *image=[UIImage imageNamed:#"Background.png"];
imageView.image=image;
cell.backgroundView=imageView;
}

Related

UITableViewCell shifts the content when reloaded

I am using a custom UITableViewCell with a UILabel at the top ,a UIButton just below the label and another UILabel,just under this button.
Final UILabel will be hidden initially,and will be opened when button action is called.The height of all the label and the cell are dynamic.
But
When i select the button ,the cell shifts its contentview to the.
center
I need the content of the cells to start at the origin itself.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = #"ReferenceCell";
ReferenceiPadTableCell *cell = (ReferenceiPadTableCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:#"ReferenceiPadTableCell" owner:self options:Nil];
cell = [nib objectAtIndex:0];
cell.accessoryView = nil;
}
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
NSDictionary *referenceDictionary = [self.referencesList objectAtIndex:indexPath.row];
NSString *nameString = [referenceDictionary objectForKey:#"name"];
CGSize labelSize = [nameString sizeWithFont:[UIFont systemFontOfSize:14]
constrainedToSize:CGSizeMake(listTableView.frame.size.width - 15, 125)
lineBreakMode:UILineBreakModeWordWrap];
labelSize.height = labelSize.height > 96? labelSize.height : 96;
cell.l1.text = nameString;
cell.l1.frame = CGRectMake(cell.l1.frame.origin.x, 6, cell.l1.frame.size.width, labelSize.height);
cell.button.tag = [[referenceDictionary objectForKey:#"sort"] intValue];
[cell.button addTarget:self action:#selector(showList:) forControlEvents:UIControlEventTouchUpInside];
cell.l2.hidden = YES;
cell.button.frame = CGRectMake(cell.button.frame.origin.x, cell.l1.frame.origin.y+ labelSize.height + 1, cell.l1.frame.size.width, cell.l1.frame.size.height);
if ([self.showList objectForKey:[NSString stringWithFormat:#"showList-%d", indexPath.row]] )
{
cell.l2.hidden = NO;
NSDictionary *dic = [self.abstractList objectAtIndex:indexPath.row];
NSString *abtString = [dic objectForKey:#"name"];
CGSize absSize = [abtString sizeWithFont:[UIFont systemFontOfSize:14]
constrainedToSize:CGSizeMake(tableView.frame.size.width - 15, 125)
lineBreakMode:UILineBreakModeWordWrap];
cell.l2.frame = CGRectMake(cell.button.frame.origin.x, cell.button.frame.origin.y+ cell.button.frame.size.height + 3, cell.button.frame.size.width, absSize.height);
cell.l2.text = abtString;
}
return cell;
}
it's doesn't shift the content but added more subview on UITableViewCell because you are not using reusing cell concept well.So use concept like this
-(UITableViewCell *)tableView:(UITableView *)tableView reuseTableViewCellWithIdentifier:(NSString *)identifier withIndexPath:(NSIndexPath *) indexPath
{
UITableViewCell *cell=[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
UILabel *lbl=[[UILabel alloc]init];
lbl.lineBreakMode = NSLineBreakByWordWrapping;
lbl.numberOfLines = 0;
lbl.backgroundColor=[UIColor clearColor];
lbl.textAlignment=NSTextAlignmentCenter;
UIImageView *imgView=[[UIImageView alloc]init];
UIImageView *imgView1=[[UIImageView alloc]init];
UIImageView *imgView2=[[UIImageView alloc]init];
UIImageView *imgView3=[[UIImageView alloc]init];
UIImageView *imgView4=[[UIImageView alloc]init];
if(UI_USER_INTERFACE_IDIOM()==UIUserInterfaceIdiomPhone)
{
lbl.font=[UIFont fontWithName:#"Marker Felt" size:20];
}
else
{
lbl.font=[UIFont fontWithName:#"Marker Felt" size:30];
}
[cell.contentView addSubview:lbl];
[cell.contentView addSubview:imgView];
[cell.contentView addSubview:imgView1];
[cell.contentView addSubview:imgView2];
[cell.contentView addSubview:imgView3];
[cell.contentView addSubview:imgView4];
return cell;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell=[self tableView:tableView reuseTableViewCellWithIdentifier:CellIdentifier withIndexPath:indexPath];
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
}
}
}

Dispalying text and label in custom cell of UItableView

Hi all I've custom cells in which I've UIImageView and UILabel I want to assign Image to UIImageView and text to UILabel which are in array, please can any one help me?? thanks in advance
I tried below code
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
cell.textLabel.text =[CurArray objectAtIndex:indexPath.row];
NSString *cellIcon = [[self IconArray] objectAtIndex:indexPath.row];
UIImage *cellIconimage = [UIImage imageNamed:cellIcon];
UIImageView *imageView = [[UIImageView alloc] initWithImage:cellIconimage];
[imageView setFrame:CGRectMake(100.0, 30.0, 30.0, 30.0)];
[imageView setContentMode:UIViewContentModeScaleAspectFill];
[cell addSubview:imageView];
return cell;
}
With this code i can assign image to created imageview But I'm not able to to assign text for UILable
here IBCustomCellProjectList is an example which is UITableViewCell with XIB just follow the logic
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
IBCustomCellProjectList *cell = (IBCustomCellProjectList *) [tableView dequeueReusableCellWithIdentifier:nil];
// yourCustomeCell *cell = (yourCustomeCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];//custom cell
// UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:#"IBCustomCellProjectList" owner:self options:nil];
for (id currentObject in topLevelObjects){
if ([currentObject isKindOfClass:[UITableViewCell class]]){
cell = (IBCustomCellProjectList *) currentObject;
break;
}
}
}
// Configure the cell.
cell.cellLabel.text = [yourTextArray objectAtIndex:i];
cell.cellImageView.image = [UIImage imageNamed:[yourImageArray objectAtIndex:i]];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
Also see this bellow tutorial..
Custom cell with advance control and design
http://www.appcoda.com/customize-table-view-cells-for-uitableview/Customize tableview Cell
:)
Use this code. Maybe this is what you want. You will have to use the method cellForRowAtIndexPath .
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:[cell reuseIdentifier]];
if (cell == nil)
{
[[NSBundle mainBundle] loadNibNamed:#"CustomCell" owner:self options:nil];
cell = customCell;
customCell = nil;
}
// Configure the cell.
cell.Label.text = [[NSNumber numberWithInt:indexPath.row+1]stringValue];
cell.Label.textColor = [UIColor blackColor];
cell.ImageView.image = [UIImage imageNamed:[CountryFlag objectAtIndex:indexPath.row]];
cell.textLabel.textColor=[UIColor whiteColor];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
Use Following code:
-(UITableViewCell*) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:#"cell"];
const NSInteger IMAGE_VIEW_TAG=1001;
const NSInteger LABEL_TAG=1002;
UIImageView *imageView;
UILabel *lbl;
if(cell==nil)
{
cell=[[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:#"cell"] autorelease];
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
imageView =[[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)] autorelease];
imageView.tag=IMAGE_VIEW_TAG;
imageView.contentMode=UIViewContentModeScaleAspectFit;
[cell.contentView addSubview:imageView];
lbl=[[UILabel alloc] initWithFrame:CGRectMake(100, 20, 160, 20)];
lbl.font=[UIFont fontWithName:#"Helvetica" size:14.0];
lbl.adjustsFontSizeToFitWidth=YES;
lbl.minimumFontSize=10.0;
lbl.textAlignment=UITextAlignmentLeft;
lbl.textColor=[UIColor colorWithRed:73.0/255.0 green:73.0/255.0 blue:73.0/255.0 alpha:1.0];
lbl.backgroundColor=[UIColor clearColor];
lbl.tag=LABEL_TAG;
[cell.contentView addSubview:lbl];
}
imageView=(UIImageView*)[cell.contentView viewWithTag:IMAGE_VIEW_TAG];
lbl=(UILabel*)[cell.contentView viewWithTag:LABEL_TAG];
imageView.image=[UIImage imageNamed:#"image.png"];
lbl.text=#"Your Text";
return cell;
}
-(CGFloat) tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 65.0;
}

The difference between two ways to access UIImageView under UITableViewCell of UITableView

I have a custom tableview to load news through webservice. I change image in each cell in method cellForRowAtIndexPath. After I got the right cell, I can access the image by two ways:
UIImageView *imageView = (UIImageView *)[cell viewWithTag:12];
imageView.image = news.image;
or directly:
cell.imageView.image = news.image;
when I use the second way, some images get into wrong cell while the first way give me a perfect result. It also happend in a callback method iconDownLoadFinsh.
I feel confused about it. Can anyone try to explain it? Please do not hesitate to ask questions. Thanks in advance.
- (void)iconDownLoadFinsh:(NSData *)imageData row:(NSIndexPath *)indexPath {
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath];
UIImageView *imageView = (UIImageView *)[cell viewWithTag:12];
imageView.image = [UIImage imageWithData:imageData];
NewsModel *newsModel = [newsArray objectAtIndex:indexPath.row];
newsModel.image = [UIImage imageWithData:imageData];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"NewsCellIdentifier";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:#"NewsTableViewCell" owner:self options:nil];
cell = newsTableViewCell;
newsTableViewCell = nil;
}
// read from newsModel
NewsModel *news = [newsArray objectAtIndex:indexPath.row];
UILabel *label;
label = (UILabel *)[cell viewWithTag:10];
label.text = [NSString stringWithFormat:news.title];
label = (UILabel *)[cell viewWithTag:11];
label.text = [NSString stringWithFormat:news.description];
UIImageView *imageView;
imageView = (UIImageView *)[cell viewWithTag:12];
imageView.image = news.image;
if (news.image == nil)
{
imageView.image = [UIImage imageNamed:IconPlaceHolder];
// if (self.tableView.dragging == NO && self.tableView.decelerating == NO) {
IconDownLoader *iconDownLoader = [[IconDownLoader alloc] init];
iconDownLoader.url = news.imageUrl;
iconDownLoader.delegate = self;
iconDownLoader.indexPath = indexPath;
[downloadArray addObject:iconDownLoader];
[iconDownLoader start];
// }
}
return cell;
}
I generally always reset the cell properties in the method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
So I will do the following after getting the cell
if (cell == nil) {
[[NSBundle mainBundle] loadNibNamed:#"NewsTableViewCell" owner:self options:nil];
cell = newsTableViewCell;
newsTableViewCell = nil;
}
cell.imageView.image = nil; // Here resetting the imageview's image to nil.
Because you are reusing cells and if you do not clear old data, the cell data may get corrupt.

UITableViewCell customization - change background

I'm sure this is a question that been asked and answered, but I can't seem to find what I need. I am trying to customize the background of my UITableView, so to do this, I created a subclass of UITableViewCell, and built my custom cell with the IB. I successfully connected the custom cell to the table view, so the cell I get is getting displayed. I am trying to change the background of each cell, so here is what I use:
if(row == 1){
rowBackground = [UIImage imageNamed:#"VehicleExpenses_button.png"];
selectionBackground = [UIImage imageNamed:#"VehicleExpenses_button_selected.png"];
((UIImageView *)cell.backgroundView).image = rowBackground;
// ((UIImageView *)cell.selectedBackgroundView).image = selectionBackground;
}
within the
(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
method of my Controller class. I checked with the debugger, and all the lines in the code are getting called...
Any ideas?
This is the entire method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"HomeViewCell";
static NSString *CellNib = #"HomeViewCell";
UIImage *rowBackground;
UIImage *selectionBackground;
NSInteger row = [indexPath row];
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (UITableViewCell *)[nib objectAtIndex:0];
}
if(row == 1){
rowBackground = [UIImage imageNamed:#"VehicleExpenses_button.png"];
selectionBackground = [UIImage imageNamed:#"VehicleExpenses_button_selected.png"];
((UIImageView *)cell.backgroundView).image = rowBackground;
// ((UIImageView *)cell.selectedBackgroundView).image = selectionBackground;
}
// perform additional custom work...
return cell;
}
Maybe I'm wrong but I don't see where you initialized the backgroundView as a UIImageView. Here is what I would add to the lines where you create the cells:
UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:CellNib owner:self options:nil];
cell = (UITableViewCell *)[nib objectAtIndex:0];
cell.backgroundView = [[[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, tableView.bounds.size.width, cellHeight)] autorelease];
cell.selectedBackgroundView = [[[UIImageView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, tableView.bounds.size.width, cellHeight)] autorelease];
}
Note: replace "cellHeight" with your desired height.
I hope this helps.
You can use this:
UIImageView *cellBackGround = [[UIImageView alloc] initWithImage:[UIImage imageNamed:#"selectedRow.png"]];
[[tableView cellForRowAtIndexPath:indexPath] setBackgroundView:cellBackGround];
[cellBackGround release];
Small problem. Instead of casting and setting the backgroundView and selectedBackgroundView's image property, set them to the UIImageView created from your images.
cell.backgroundView = [[[UIImageView alloc] initWithImage:rowBackground] autorelease];
cell.selectedBackgroundView = [[[UIImageView alloc] initWithImage:selectionBackground] autorelease];

tableView cells wont change font color

I have done many approach on changing font colors from a tableView cell. apparently both method failed. Unless I am doing it wrongly, then I need some help to correct it. Here is the code I found online to change the font color.
[[cell textLabel] setTextColor:[UIColor colorWithRed:255.0/255.0 green:76.0/255.0 blue:76.0/255.0 alpha:1]];
I placed that line in the cellForRowAtIndexPath method and it did not work. Next, I searched this page and found another method to change font colors: tableView:willDisplayCell:forRowAtIndexPath: I copied and paste the setTextColor method into the willDisplayCell method and it did not work either. Below is the source code on which how I attempted and failed:
cellForRowAtIndexPath:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = #"ApplicationCell";
ApplicationCell *cell = (ApplicationCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
[[NSBundle mainBundle] loadNibNamed:#"PharmacyCell" owner:self options:nil];
cell = tempCell;
self.tempCell = nil;
}
//cell.useDarkBackground = (indexPath.row % 2 == 0);
HealthWellness *objHealth = [self.maHealthArray objectAtIndex:indexPath.row];
cell.strPharmacyName = [objHealth.healthName stringByReplacingOccurrencesOfString:#"|" withString:#""];
[[cell textLabel] setTextColor:[UIColor colorWithRed:255.0/255.0 green:76.0/255.0 blue:76.0/255.0 alpha:1]];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
return cell;
}
tableView:willDisplayCell:forRowAtIndexPath:
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath{
[[cell textLabel] setTextColor:[UIColor colorWithRed:255.0/255.0 green:76.0/255.0 blue:76.0/255.0 alpha:1]];
}
ApplicationCell.h
#interface ApplicationCell : UITableViewCell{
//variable declaration
BOOL useDarkBackground;
BOOL useMenuBackground;
NSString *strPharmacyName;
UIImage *pharmacyIcon;
NSString *strStoreName;}
//setting property
#property BOOL useDarkBackground;
#property BOOL useMenuBackground;
#property(retain) NSString *strPharmacyName;
#property(retain) UIImage *pharmacyIcon;
#property(retain) NSString *strStoreName;
ApplicationCell.m
- (void)setUseDarkBackground:(BOOL)flag{
if (flag != useDarkBackground || !self.backgroundView)
{
useDarkBackground = flag;
NSString *backgroundImagePath = [[NSBundle mainBundle] pathForResource:useDarkBackground ? #"BGDark" : #"BGLight" ofType:#"png"];
UIImage *backgroundImage = [[UIImage imageWithContentsOfFile:backgroundImagePath] stretchableImageWithLeftCapWidth:0.0 topCapHeight:1.0];
self.backgroundView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.backgroundView.frame = self.bounds;
}}
- (void)setUseMenuBackground:(BOOL)flag{
if (flag != useDarkBackground || !self.backgroundView)
{
useDarkBackground = flag;
NSString *backgroundImagePath = [[NSBundle mainBundle] pathForResource:useDarkBackground ? #"BGDark" : #"BGLight" ofType:#"png"];
UIImage *backgroundImage = [[UIImage imageWithContentsOfFile:backgroundImagePath] stretchableImageWithLeftCapWidth:0.0 topCapHeight:1.0];
self.backgroundView = [[[UIImageView alloc] initWithImage:backgroundImage] autorelease];
self.backgroundView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
self.backgroundView.frame = self.bounds;
}}
You seem to be using a custom subclass of UITableViewCell and since you mention that there is a lot going on in the ApplicationCell class. I am guessing that your subclass isn't making use of the textLabel field since your changes aren't reflecting on the UI.
Check for the property outlet that is being displayed on screen from your ApplicationCell interface declaration & the NIB file. Once you've the appropriate property outlet, change its property.
That should set the text color, I just tried it and it works. cell should be a UITableView though, does your ApplicationCell inherit from UITableView cell?
Also if ApplicationCell is nil, I'm not sure whats going on with tempCell
try
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
and go from there