相关疑难解决方法(0)

可可:为什么我的表视图空白?

为什么我的表格视图空白?在我添加"initWithStyle"之前没事

这是它的样子:

替代文字

以下是我的代码:

这是我的.h:

#import <UIKit/UIKit.h>


@interface TableViewController : UITableViewController {

NSMutableArray *jokes;
IBOutlet UITableView *jokeTableView; 


 }

@property (nonatomic, retain) NSMutableArray *jokes;
@property (retain) UITableView *jokeTableView;

@end
Run Code Online (Sandbox Code Playgroud)

这是我的实现文件:

#import "TableViewController.h"
#import "Joke.h"

@implementation TableViewController
@synthesize jokes;
@synthesize jokeTableView;

- (void)awakeFromNib {
[jokeTableView init];
}




- (id)initWithStyle:(UITableViewStyle)style {
if (self = [super initWithStyle:style]) {
    self.jokes = [NSMutableArray arrayWithObjects:
                  [Joke jokeWithValue:@"If you have five dollars     and Chuck Norris has five dollars, Chuck Norris has more money than you"],
                  [Joke jokeWithValue:@"There is no …
Run Code Online (Sandbox Code Playgroud)

iphone cocoa-touch objective-c uitableview ios

3
推荐指数
1
解决办法
2766
查看次数

标签 统计

cocoa-touch ×1

ios ×1

iphone ×1

objective-c ×1

uitableview ×1