다음 코드에 문제가 있나요?
시뮬레이터에서 데이터를 표시할 수 없습니다. 어떻게 해야 하나요?
@interface ViewController ()
@property(nonatomic,strong)NSArray *status;
@end
@ViewController 구현
-(NSArray *)상태
{
}
(void)viewDidLoad {
으아악}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
}
-(UITableViewCell )tableView:(UITableView )tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
}
@end
@interface ZYStatus : NSObject
@property(nonatomic,copy)NSString *text;
@property(nonatomic,copy)NSString *icon;
@property(nonatomic,copy)NSString *name;
@property(nonatomic, copy)NSString *그림;
@property(비원자,할당) BOOL VIP;
-(인스턴스 유형)initWithDict:(NSDictionary *)dict;
(인스턴스 유형)statusWithDict:(NSDictionary *)dict;
(NSArray *)array;
@end
@implementation ZYStatus
-(인스턴스 유형)initWithDict:(NSDictionary *)dict
{
}
(instancetype)statusWithDict:(NSDictionary *)dict
{
}
(NSArray *)배열
{
}
@end
NSArray *array1 = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"statuses" ofType:“plist”]];
NSArray *array1 = [NSArray arrayWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"statuses" ofType:"plist"]];
파일을 구문 분석할 때 pathForResource 뒤에 파일 이름 "statuses", ofType이 옵니다. 그 뒤에는 파일 접미사 "plist"가 옵니다