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 01-24-2012, 04:47 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 6
pratikchandak is on a distinguished road
Unhappy Table View (not getting called)

hi i am new to iPhone App Development..In my app, i store video to documents folder and then retrieve them in another view..The view where videos are retrieved is not getting load..and i think my "viewdidload" or "cellforrowatindexpath" is not getting called...So somebody please tell me if there is something missing in code mentioned below....

- (void)viewDidLoad
{
tblView.delegate = self;
NSFileManager *filemgr = [NSFileManager defaultManager];
NSString *docDirPath = NSHomeDirectory();
docDirPath = [docDirPath stringByAppendingPathComponent:@"Documents"];
NSArray *filelist = [filemgr contentsOfDirectoryAtPath:docDirPath error:NULL];
NSLog(@"filelist = %@",filelist);
int count = [filelist count];
NSString *currentFileName;
videoListNames = [NSMutableArray array];
for (int j = 0; j<count; j++)
{
currentFileName = (NSString *)[filelist objectAtIndex:j];
if ([[currentFileName pathExtension] isEqualToString:@"avi"])
{
NSLog(@"currentFileName = %@",currentFileName);
[videoListNames addObject:currentFileName];

}
}

[tblView reloadData];
[super viewDidLoad];

}

---------------------------------------------------------------------------------------

- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}
//TRY TO REMOVE ALL CONTENT
for(UIView *view in cell.contentView.subviews){
if ([view isKindOfClass:[UIView class]]) {
[view removeFromSuperview];
}
}
// Configure the cell...
if (indexPath.row % 2 == 0)
{
cell.backgroundView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Stript1.png"]];
}
else
cell.backgroundView =[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"Stript2.png"]];

cell.textLabel.backgroundColor = [UIColor clearColor];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text=[videoListNames objectAtIndex:indexPath.row];
NSLog(@"cell text = %@",cell.textLabel.text);
cell.textLabel.text = (NSString *)[assets objectAtIndex:indexPath.row];
return cell;

}

---------------------------------------------------------------------------------------
pratikchandak is offline   Reply With Quote
Old 01-24-2012, 11:12 PM   #2 (permalink)
Registered Member
 
Join Date: Dec 2011
Location: Colorado, USA
Posts: 7
ShawnArney is on a distinguished road
Default

Firstly, on the viewDidLoad{} method, move [super viewDidLoad]; to the start of that method... super's setup should be done first before inheritor class' setup.

Secondly, are any of your NSLog()... statement results showing up in your console?

Thirdly, are you overriding the row count for the table? What is the NSLog() count for that?

i.e.
- (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section {
return [videoListNames count];
}

Cheers,

Shawn Arney
iOS Professional Developer & Trainer

Learn iPhone Apps at: http://Www.LearnApps.Org
ShawnArney is offline   Reply With Quote
Old 02-07-2012, 04:39 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2012
Posts: 6
pratikchandak is on a distinguished road
Default

Quote:
Originally Posted by ShawnArney View Post
Firstly, on the viewDidLoad{} method, move [super viewDidLoad]; to the start of that method... super's setup should be done first before inheritor class' setup.

Secondly, are any of your NSLog()... statement results showing up in your console?

Thirdly, are you overriding the row count for the table? What is the NSLog() count for that?

i.e.
- (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section {
return [videoListNames count];
}

Cheers,

Shawn Arney
iOS Professional Developer & Trainer

Learn iPhone Apps at: LearnApps.Org - Keeping it Simple: iPhone Training and Tutorials
I did the changes but still doesn't work...and NSLog() statement result is not shown in console...Any suggestions?
pratikchandak is offline   Reply With Quote
Reply

Bookmarks

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: 397
12 members and 385 guests
7twenty7, Atatator, condor304, FrankWeller, glenn_sayers, iphonedevshani, MAMN84, mraalex, PowerGoofy, QuantumDoja, tim0504, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,674
Threads: 94,122
Posts: 402,907
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Atatator
Powered by vBadvanced CMPS v3.1.0

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