-1
我對Objective C非常陌生,現在我正在開發一個項目。View Controller中的每個單元格的視圖控制器
I've created a Slide-Out-Menu, which is based on my own Database
現在我想從每個Cell到ViewController中獲取一鍵組合舞蹈,但我還沒有真正的想法是如何工作的。
這裏是我的代碼
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1; }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
NSArray *numarray = [self getServerConnection];
for (NSDictionary *diction in numarray) {
NSDictionary *menuID = [diction objectForKey:@"id"];
NSString *num = [NSString stringWithFormat:@"%@",menuID];
intnum = [num intValue];
}
return intnum; }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
NSArray *namearray = [self getServerConnection];
for (NSDictionary *diction in namearray) {
name = [result valueForKey:@"name"];
identifier = [menuArray valueForKey:@"identifier"];
cell.textLabel.text = name [indexPath.row];
}
return cell; }
嗨,您應該向我們提供您的問題描述,一些您不明白的代碼或除視頻鏈接外的其他代碼。 – DominicanCoder