Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 10-08-2010, 01:39 PM   #1 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Exclamation Resizing Table View Cell's Height

I have a table view with cells containing a label that varies on length. I was wondering how I could change the height of the cells based on the length of each of their labels.

At the moment this is how it looks:


This is what I've tried but it doesn't work:

Code:
self.tableView.rowHeight = cell.factsLabel.length;
KidCudi10 is offline   Reply With Quote
Old 10-08-2010, 01:50 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

YOu can use the following NSString method to get the size that the text would take up in the label, and then you can adjust your table cell height accordingly..

Code:
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)
smithdale87 is offline   Reply With Quote
Old 10-08-2010, 02:19 PM   #3 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Unhappy

Quote:
Originally Posted by smithdale87 View Post
YOu can use the following NSString method to get the size that the text would take up in the label, and then you can adjust your table cell height accordingly..

Code:
- (CGSize)sizeWithFont:(UIFont *)font constrainedToSize:(CGSize)size lineBreakMode:(UILineBreakMode)
I'm confused on how to exactly use what you provided. I tried this, but it isn't working I get an error.


Code:
- (CGSize)getSizeOfText:(NSString *)factLabel withFont:(UIFont *)font
{
	return [factLabel sizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];

	self.tableView.rowHeight = [factLabel sizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];
}
But how do I exactly assign the returned height with
KidCudi10 is offline   Reply With Quote
Old 10-08-2010, 02:33 PM   #4 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

there is a uitableview delegate method that you need to implement

Code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
       NSString* theText =  //first get the text that will be displayed in the cell

    CGSize textSize = [theTextsizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];

return textSize.height;
  
   
}
smithdale87 is offline   Reply With Quote
Old 10-08-2010, 02:33 PM   #5 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Cocoa Is My Girlfriend UITableViewCell Dynamic Height
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-08-2010, 03:27 PM   #6 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Exclamation

Quote:
Originally Posted by smithdale87 View Post
there is a uitableview delegate method that you need to implement

Code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
       NSString* theText =  //first get the text that will be displayed in the cell

    CGSize textSize = [theTextsizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];

return textSize.height;
  
   
}
Hmm... okay so I added the CGFloat, but it said that my 'cell' wasn't declared, so I redeclared it in this new method but look at the table view image now.

Code:
- (CGSize)getSizeOfText:(NSString *)factLabel withFont:(UIFont *)font
{
	return [factLabel sizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];
	
	
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *CellIdentifier = @"FactsCell";
    
    FactsCell *cell = (FactsCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

	
	NSString *theText = cell.factLabel.text;
	UIFont *font = cell.factLabel.font; 
	
    CGSize textSize = [theText sizeWithFont: font constrainedToSize:CGSizeMake(280, 500)];
	
	return textSize.height;
	
	
}
KidCudi10 is offline   Reply With Quote
Old 10-08-2010, 03:30 PM   #7 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *CellIdentifier = @"FactsCell";
    
    FactsCell *cell = (FactsCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
No. Just no.

Go read some of the stuff in the table view link in my signature to pick up some table view basics.

After you grasp those, then go to the blog link I already posted.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-08-2010, 04:22 PM   #8 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Code:
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
	static NSString *CellIdentifier = @"FactsCell";
    
    FactsCell *cell = (FactsCell *) [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
No. Just no.

Go read some of the stuff in the table view link in my signature to pick up some table view basics.

After you grasp those, then go to the blog link I already posted.
Hey thanks, I looked through your links and I'm definitely going to go back for the search controller tutorial, but I basically understand building the table view, the problem for me is working with dynamic heights on custom cells. I followed the gf cocoa tutorial for a regular table view, and it worked fine, but when I keep trying to implement the same concepts into my project with custom cells it just looks horrendous...

The custom cells work perfectly though, now I'm getting the cells to resize according to the facts label length, but the actual label won't show all of it's text, just the ellipsis...

KidCudi10 is offline   Reply With Quote
Old 10-08-2010, 04:25 PM   #9 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Number of lines in the label should be 0.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-08-2010, 05:53 PM   #10 (permalink)
Student Developer
 
KidCudi10's Avatar
 
Join Date: May 2010
Posts: 55
KidCudi10 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Number of lines in the label should be 0.
Figured it out! Even though I had lines at ZERO in the code

Code:
[label setLineBreakMode:UILineBreakModeWordWrap];
        [label setMinimumFontSize:FONT_SIZE];
        [label setNumberOfLines:0];
        [label setFont:[UIFont systemFontOfSize:FONT_SIZE]];
I realized the XIB file had each label on 1 line!

THANK YOU SO MUCH MANN! Honestly iphonedevsdk would be worthless without you!

Last edited by KidCudi10; 10-08-2010 at 06:14 PM.
KidCudi10 is offline   Reply With Quote
Old 10-09-2010, 06:15 AM   #11 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

@Brian: I followed the tutorial you linked and it works perfectly, but I can't come up on where I'm wrong when I try to make the table view sectioned and divide the cell exemples provided in sections: I've created arrays and dictionaries in the viewDidLoad method but probably I'm missing something in the display method…
algor_angel is offline   Reply With Quote
Old 10-09-2010, 09:20 AM   #12 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Well, without knowing what you are now doing, or knowing the specific problem you are having, it's a little tough to answer that.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 01:17 AM   #13 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

I'm just using the sample code of the tutorial before coping the code I need into my app. I've tried to divide the sample cells into section but I'm missing something and my try went wrong. So, my question is: from that sample code, how do I divide the cells into sections? Can you give me some code? I've tried several ways but either the app crashes or doesn't start at all…
algor_angel is offline   Reply With Quote
Old 10-10-2010, 09:40 AM   #14 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Well, you've obviously changed something. So knowing what you've changed will be useful. And knowing what error message you get when you crash would be helpful too.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 01:21 PM   #15 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Well, you've obviously changed something. So knowing what you've changed will be useful. And knowing what error message you get when you crash would be helpful too.
Here is my modified code: you will see I made just a few changes but when you Build&Run it starts but crashes on loading… I'm sure the solution it's really simple but I don't get it…

Code:
#import "DynamicHeightsViewController.h"

#define FONT_SIZE 14.0f
#define CELL_CONTENT_WIDTH 305.0f
#define CELL_CONTENT_MARGIN 10.0f

@implementation DynamicHeightsViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    items = [[NSMutableArray alloc] init];
    
    NSArray *JGDInfoDictionaryArray = [NSArray arrayWithObjects:@"Happiness is having a large, loving, caring, close-knit family in another city.\n\n\t\t-George Burns (1896 - 1996)", nil];
    NSDictionary *JGDInfoDictionaryDict = [NSDictionary dictionaryWithObject:JGDInfoDictionaryArray forKey:@"Info"];
    
    NSArray *HowToUseDictionaryArray = [NSArray arrayWithObjects:@"When I am abroad, I always make it a rule never to criticize or attack the government of my own country. I make up for lost time when I come home.\n\n\t\t-Sir Winston Churchill (1874 - 1965)", nil];
    NSDictionary *HowToUseDictionaryDict = [NSDictionary dictionaryWithObject:HowToUseDictionaryArray forKey:@"Info"];

    NSArray *CreditsDictionaryArray = [NSArray arrayWithObjects:@"After two years in Washington, I often long for the realism and sincerity of Hollywood.\n\n\t\t-Fred Thompson, Speech before the Commonwealth Club of California", nil];
    NSDictionary *CreditsDictionaryDict = [NSDictionary dictionaryWithObject:CreditsDictionaryArray forKey:@"Info"];
    
    [items addObject:JGDInfoDictionaryDict];
    [items addObject:HowToUseDictionaryDict];
    [items addObject:CreditsDictionaryDict];
    
}

- (void)dealloc {
    [items release], items = nil;
    [super dealloc];
}

#pragma mark -
#pragma mark UITableView Delegaates

- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    NSDictionary *dictionary = [items objectAtIndex:section];
    NSArray *array = [dictionary objectForKey:@"Info"];
    return [array count];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
{
    return [items count];
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;
{
    NSString *text = [items objectAtIndex:[indexPath row]];
    
    CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);
    
    CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
    
    CGFloat height = MAX(size.height, 44.0f);
    
    return height + (CELL_CONTENT_MARGIN * 2);
}

- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell;
    UILabel *label = nil;
    
    cell = [tv dequeueReusableCellWithIdentifier:@"Cell"];
    if (cell == nil)
    {
        cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:@"Cell"] autorelease];
        
        label = [[UILabel alloc] initWithFrame:CGRectZero];
        [label setLineBreakMode:UILineBreakModeWordWrap];
        [label setMinimumFontSize:FONT_SIZE];
        [label setNumberOfLines:0];
        [label setFont:[UIFont systemFontOfSize:FONT_SIZE]];
        [label setTag:1];
        
        [[cell contentView] addSubview:label];
        
    }
    NSString *text = [items objectAtIndex:[indexPath row]];
    
    CGSize constraint = CGSizeMake(CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), 20000.0f);
    
    CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap];
    
    if (!label)
        label = (UILabel*)[cell viewWithTag:1];
    
    [label setText:text];
    [label setFrame:CGRectMake(CELL_CONTENT_MARGIN, CELL_CONTENT_MARGIN, CELL_CONTENT_WIDTH - (CELL_CONTENT_MARGIN * 2), MAX(size.height, 44.0f))];
    
    return cell;

}



@end
algor_angel is offline   Reply With Quote
Old 10-10-2010, 03:06 PM   #16 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

I asked for 2 pieces of information, and you only provided 1. Accurately answering all questions will go a long way towards finding a solution.

At quick glance, your cellForRow and heightForRow are not making any decisions based on the section.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 03:17 PM   #17 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
I asked for 2 pieces of information, and you only provided 1. Accurately answering all questions will go a long way towards finding a solution.

At quick glance, your cellForRow and heightForRow are not making any decisions based on the section.
You're right: here it is what the Debugger Console says:

Quote:
[Session started at 2010-10-10 22:14:44 +0200.]
GNU gdb 6.3.50-20050815 (Apple version gdb-1472) (Wed Jul 21 10:53:12 UTC 2010)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 2587.
2010-10-10 22:14:47.788 DynamicHeights[2587:207] -[__NSCFDictionary sizeWithFont:constrainedToSize:lineBreakMode:]: unrecognized selector sent to instance 0x5f4a950
2010-10-10 22:14:47.792 DynamicHeights[2587:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFDictionary sizeWithFont:constrainedToSize:lineBreakMode:]: unrecognized selector sent to instance 0x5f4a950'
*** Call stack at first throw:
(
0 CoreFoundation 0x025d4b99 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0272440e objc_exception_throw + 47
2 CoreFoundation 0x025d66ab -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x025462b6 ___forwarding___ + 966
4 CoreFoundation 0x02545e72 _CF_forwarding_prep_0 + 50
5 DynamicHeights 0x00002df8 -[DynamicHeightsViewController tableView:heightForRowAtIndexPath:] + 214
6 UIKit 0x0046a736 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 2888
7 UIKit 0x0046c2b5 -[UITableViewRowData rectForFooterInSection:] + 108
8 UIKit 0x0046bb41 -[UITableViewRowData heightForTable] + 60
9 UIKit 0x0032c8fe -[UITableView(_UITableViewPrivate) _updateContentSize] + 333
10 UIKit 0x0031beae -[UITableView noteNumberOfRowsChanged] + 123
11 UIKit 0x0032853c -[UITableView reloadData] + 773
12 UIKit 0x00325724 -[UITableView layoutSubviews] + 42
13 QuartzCore 0x02372481 -[CALayer layoutSublayers] + 177
14 QuartzCore 0x023721b1 CALayerLayoutIfNeeded + 220
15 QuartzCore 0x0236b2e0 _ZN2CA7Context18commit_transactionEPNS_11Transacti onE + 302
16 QuartzCore 0x0236b040 _ZN2CA11Transaction6commitEv + 292
17 UIKit 0x002b404e -[UIApplication _reportAppLaunchFinished] + 39
18 UIKit 0x002b4477 -[UIApplication _runWithURLayload:launchOrientation:statusBarSty le:statusBarHidden:] + 545
19 UIKit 0x002be3ec -[UIApplication handleEvent:withNewEvent:] + 1958
20 UIKit 0x002b6b3c -[UIApplication sendEvent:] + 71
21 UIKit 0x002bb9bf _UIApplicationHandleEvent + 7672
22 GraphicsServices 0x02eb4822 PurpleEventCallback + 1550
23 CoreFoundation 0x025b5ff4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FU NCTION__ + 52
24 CoreFoundation 0x02516807 __CFRunLoopDoSource1 + 215
25 CoreFoundation 0x02513a93 __CFRunLoopRun + 979
26 CoreFoundation 0x02513350 CFRunLoopRunSpecific + 208
27 CoreFoundation 0x02513271 CFRunLoopRunInMode + 97
28 UIKit 0x002b3c6d -[UIApplication _run] + 625
29 UIKit 0x002bfaf2 UIApplicationMain + 1160
30 DynamicHeights 0x00002798 main + 102
31 DynamicHeights 0x00002729 start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
algor_angel is offline   Reply With Quote
Old 10-10-2010, 03:19 PM   #18 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Code:
-[__NSCFDictionary sizeWithFont:constrainedToSize:lineBreakMode:]: unrecognized selector sent to instance 0x5f4a950'
Yup. You aren't dealing with your data correctly. You are still trying to access it as though you have an array of strings. That is no longer the case.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 03:19 PM   #19 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

P.S. As I said in the previous reply, no error occur in the building process, that's why I just copied the debugger infos. If there's something else you need, just ask.
algor_angel is offline   Reply With Quote
Old 10-10-2010, 03:20 PM   #20 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Code:
-[__NSCFDictionary sizeWithFont:constrainedToSize:lineBreakMode:]: unrecognized selector sent to instance 0x5f4a950'
Yup. You aren't dealing with your data correctly. You are still trying to access it as though you have an array of strings. That is no longer the case.
Ok. How do I fix that?
algor_angel is offline   Reply With Quote
Old 10-10-2010, 03:23 PM   #21 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

You don't see a difference between what you are doing here:

Code:
- (NSInteger)tableView:(UITableView*)tableView numberOfRowsInSection:(NSInteger)section
{
    NSDictionary *dictionary = [items objectAtIndex:section];
    NSArray *array = [dictionary objectForKey:@"Info"];
    return [array count];
}
...and what you are doing in the other methods?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 03:27 PM   #22 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

I see it, but don't know how to deal with it :S. Yes, I know you're thinking I'm stupid… but I'm new to programming and still learning…
algor_angel is offline   Reply With Quote
Old 10-10-2010, 03:33 PM   #23 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

I see. Well, I guess you need to spend more time learning and less time copy-pasting code that you don't understand.

Spend more than 30 seconds studying what those methods actually do, and how that might relate to your error message. I've given you the answers you need. See the table view link in my signature for more guidance.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 10-10-2010, 03:40 PM   #24 (permalink)
Registered Member
 
Join Date: Sep 2010
Posts: 64
algor_angel is on a distinguished road
Default

Well, thank you. I appreciate that.
algor_angel is offline   Reply With Quote
Reply

Bookmarks

Tags
height, label, row, table cell

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 347
10 members and 337 guests
alexP, gordo26, headkaze, mistergreen2011, nobstudio, Objective Zero, rayjeong, revg, Sloshmonster, v1n2e7t
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,655
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, pungs
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 11:14 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0