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 > iPhone SDK Development - Advanced Discussion

Reply
 
LinkBack Thread Tools Display Modes
Old 07-26-2010, 05:30 PM   #1 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 4
tyler25 is on a distinguished road
Default tableView frame size on async data reload

Hi,

I am inserting a UITableView as a subview. The data is loaded asynchronously using ASIHTTPRequest. I want to resize the tableView frame size when the data finishes downloading, so that the tableview is scrollable. Please find the code below, I am stuck on this and would really appreciate any help.

Code:
// RootView which contains the CustomTableView and other views
@interface RootViewController{

	CustomTableView *customTableView;
}

@property (nonatomic, retain) customTableView *customTableView;

@implementation RootViewController

@synthesize customTableView;


-(void)loadView{

	self.customTableView = [[CustomTableView alloc] init];	

	//This is done so that the table occupies the bottom half of the view
    self.customTableView.tableView.frame = CGRectMake(0, 250, 325, 400);
	self.customTableView.tableView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth;
	[self.view addSubview:self.customTableView.tableView];
}



// CustomTable - subclass of UITableView
@interface CustomTableView : UITableViewController <UITableViewDelegate, UITableViewDataSource>{

NSMutableArray *data;
}

@property (nonatomic, retain) NSMutableArray *data;

@implementation CustomTableView

@synthesize data;

- (void)requestFinished:(ASIHTTPRequest *)request{
	
	// The data reloads but the tableView is not scrollable. How to resize the frame which has been set above. 
	[self.tableView reloadData];



}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
 
    return [self.data count];
}
tyler25 is offline   Reply With Quote
Old 07-27-2010, 11:34 AM   #2 (permalink)
Registered Member
 
Join Date: Jul 2010
Posts: 4
tyler25 is on a distinguished road
Default

Can someone please help me out here?
tyler25 is offline   Reply With Quote
Reply

Bookmarks

Tags
asynchronous, frame, iphone, size, uitableview

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: 384
14 members and 370 guests
AragornSG, ChrisYates, coolman, davejas69, givensur, guusleijsten, hussain1982, jbro, Kryckter, locombiano89, Mah6447, Meoz, stanny, WeaselPig
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,646
Threads: 94,111
Posts: 402,862
Top Poster: BrianSlick (7,990)
Welcome to our newest member, locombiano89
Powered by vBadvanced CMPS v3.1.0

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