당신이jQuery과 문제는
#import "ViewController.h"
#import "DataService.h"
@interface ViewController()
@property (weak, nonatomic) IBOutlet UITableView *TableView;
@property (strong, nonatomic) DataService *Service;
@property (nonatomic, strong) MSTable *table;
//@property (nonatomic, strong) MSClient *client;
@property (nonatomic, strong) NSMutableArray *items;
@end
@implementation ViewController
@synthesize Service;
@synthesize rowitems;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
self.client = [MSClient clientWithApplicationURLString:@"https://outnight-mobile.azure-mobile.net/"
applicationKey:@"okYeRGfBagYrsbkaqWIRObeDtktjkF10"];
self.table = [self.client tableWithName:@"notifications"];
self.rowitems = [[NSMutableArray alloc] init];
MSQuery *query = [self.table query];
query.fetchLimit = 5;
[query readWithCompletion:^(NSArray *items, NSInteger totalCount, NSError *error)
{
//add the items to our local cop
self.rowitems = [items mutableCopy];
}];
[self.TableView reloadData];
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView
numberOfRowsInSection:(NSInteger)section {
//return 5;
NSLog(@"%d",[self.rowitems count]);
return 5;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"Cell"];
cell.textLabel.text = @"fool";
return cell;
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
이 UTTableView
데이터베이스에 가야 해주십시오 코드를 살펴 가질 수 계산 (인 미세 수행)하고 처음 5 개 행을 다시 검색해야하고한다. 하지만 내가
numberofrowsinsection
내가 배열 개수를 할 때 5의 금액을 볼 수 없습니다 ?? 이것은 나를 미치게하고있다, 내가 뭘 잘못하고 있니? 행 다음에
감사
셀에 표시되는 내용은 무엇입니까? – ahmedalkaff