iphone - iOS UITableView not displayed -


i have inherited old ios code , have attempted integrate new ios 6 application. have implemented of code , far has worked. i'm working on last bit of old code. i'm implementing set of views show rss news section of app. i've implemented categories view, upon selecting item display individual items within category. nothing gets displayed. i've made modifications i'm aware of needed do, i'm no expert @ ios development , in need of guidance. below snapshot of simulator it's attempting display view, , below copy of .h , .m files. don't know preventing in table showing up. , preemptive help!

here's snapshot of simulator

snapshot

here snapshot of storyboard showing linking table view

snapshot2

here's .h file

#import <uikit/uikit.h> #import "blogrssparser.h"  @class blogrssparser; @class blogrssparserdelegate; @class blogrss; @class xmlcategory;  @interface newsviewcontroller : uiviewcontroller <uitableviewdatasource,uitableviewdelegate, blogrssparserdelegate> {     blogrssparser * _rssparser;     xmlcategory * _curritem; }  @property (nonatomic, retain) blogrssparser * rssparser; @property (readwrite, retain) xmlcategory * curritem;  @property (nonatomic, retain) iboutlet uitableview *itemtableview;  @end 

here .m file

#import "newsviewcontroller.h" #import "newsdetailsviewcontroller.h" #import "blogrssparser.h" #import "blogrss.h" #import "xmlcategory.h"  #define klabeltag 1;  @interface newsviewcontroller ()  @end  @implementation newsviewcontroller  @synthesize rssparser = _rssparser; @synthesize curritem = _curritem;  - (void)navbarinit {     uibarbuttonitem *refreshbarbutton = [[uibarbuttonitem alloc]                                          initwithbarbuttonsystemitem:uibarbuttonsystemitemrefresh                                          target:self action:@selector(reloadrss)];      [self.navigationitem setrightbarbuttonitem:refreshbarbutton animated:yes]; }  - (id)initwithnibname:(nsstring *)nibnameornil bundle:(nsbundle *)nibbundleornil {     self = [super initwithnibname:nibnameornil bundle:nibbundleornil];     if (self) {         // custom initialization     }     return self; }  - (void)viewdidload {     [super viewdidload];     // additional setup after loading view.     self.itemtableview.delegate = self;     self.itemtableview.datasource = self;  - (void) viewwillappear:(bool)animated{     [super viewwillappear:animated];     [self navbarinit];     [self.itemtableview reloaddata];     self.itemtableview.userinteractionenabled = no;     }  - (void)viewdidappear:(bool)animated{     [super viewdidappear:animated];     _rssparser = [[blogrssparser alloc]init];     _rssparser.delegate = self;      [[self rssparser]startprocess:[_curritem categoryid]]; }  - (void)didreceivememorywarning {     [super didreceivememorywarning];     // dispose of resources can recreated. }  -(void)reloadrss{     [[self rssparser]startprocess:[_curritem categoryid]];     [[self itemtableview]reloaddata]; }  - (void)processcompleted{     [[self itemtableview]reloaddata]; //  _tableview.userinteractionenabled = yes;     [[self itemtableview]setuserinteractionenabled:yes]; }  -(void)processhaserrors{     uialertview *alert = [[uialertview alloc] initwithtitle:@"my title" message:@"unable retrieve news. please check if connected internet."                                                    delegate:nil cancelbuttontitle:@"ok" otherbuttontitles: nil];     [alert show]; }  - (nsinteger)numberofsectionsintableview:(uitableview *)tableview {     return 1; }  - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section{     return [[[self rssparser]rssitems]count]; }  - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath{      const cgfloat label_title_height = 70.0;     const cgfloat label_width = 210.0;      nsstring * mediaurl = [[[[self rssparser]rssitems]objectatindex:indexpath.row]mediaurl];     nsdata * imagedata = [[nsdata alloc]initwithcontentsofurl:[nsurl urlwithstring:mediaurl]];     uiimage * imagefromimagedata;     if (imagedata == nil) {         imagedata = [[nsdata alloc]initwithcontentsofurl:[nsurl urlwithstring:@"http://www.urlforimage.image.png"]];     }     imagefromimagedata = [[uiimage alloc] initwithdata:imagedata];       uitableviewcell * cell = [tableview dequeuereusablecellwithidentifier:@"rssitemcell"];     if(nil == cell){         cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstylesubtitle reuseidentifier:@"rssitemcell"];          cell.accessorytype = uitableviewcellaccessorydisclosureindicator;          uilabel * _toplabel =         [[uilabel alloc]          initwithframe:          cgrectmake(                     imagefromimagedata.size.width + 10.0,                     0.0,                     label_width,                     label_title_height)];           _toplabel.tag = klabeltag;         _toplabel.opaque = no;         _toplabel.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexiblerightmargin;         _toplabel.backgroundcolor = [uicolor clearcolor];         _toplabel.textcolor = [uicolor colorwithred:0.25 green:0.0 blue:0.0 alpha:1.0];         _toplabel.highlightedtextcolor = [uicolor colorwithred:1.0 green:1.0 blue:0.9 alpha:1.0];         _toplabel.font = [uifont systemfontofsize:[uifont labelfontsize]];         _toplabel.numberoflines = 0;         [cell.contentview addsubview:_toplabel];     }      cell.imageview.image = imagefromimagedata;      uilabel * toplabel = (uilabel *)[cell.contentview viewwithtag:1];     toplabel.text = [[[[self rssparser]rssitems]objectatindex:indexpath.row]title];     return cell; }  - (void)tableview:(uitableview *)tableview didselectrowatindexpath:(nsindexpath *)indexpath {      newsdetailsviewcontroller *tlc = [[detailsviewcontroller alloc]init];     tlc.currentitem = [[[self rssparser]rssitems]objectatindex:indexpath.row];     tlc.modaltransitionstyle = uimodaltransitionstylefliphorizontal;      [self presentviewcontroller:tlc animated:yes completion:nil]; }  @end 

i not conclusion problem facing.

but here few things should check.

because cannot see empty table view in screenshot

  1. do have tableview on nib file ?
  2. it mapped nib file iboutlet itemtableview ?

Comments

Popular posts from this blog

java - Run a .jar on Heroku -

java - Jtable duplicate Rows -

validation - How to pass paramaters like unix into windows batch file -