0
알림 배열을 채우기 위해 아래 코드가 있습니다. 이 배열은 iOS 앱의 메뉴에 알림을 채우기 위해 필요합니다.NSMutableArray를 채우십시오.
// extract specific value...
NSArray *switchValues = [res objectForKey:@"data"];
NSLog(@"%@", switchValues);
for (NSDictionary *switchValue in switchValues) {
NSString *text = [switchValue objectForKey:@"text"];
NSLog(@"%@", text);
[self.notificationsArray addObject:text];
}
또한 선 아래로 나는 다음을 수행하십시오
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *cellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
NSMutableArray *titles = self.notificationsArray;
cell.textLabel.text = titles[indexPath.row];
return cell;
}
을 그러나, 나는 하늘의 배열을 점점 계속. 내가 도대체 뭘 잘못하고있는 겁니까?
notificationsArray를 초기화했으며 switchValues 개수가 0보다 큰지 확인 했습니까? – Vig
은 @Vig와 일치합니다. –