我有一个UITableView从XIB文件加载自定义UITableViewCell.一切都工作正常,但我的布局要求单元格(都在一个单独的部分内)之间有间距.有没有机会这样做而不必提高行高?
现在怎么样
这是怎么回事
编辑:
这就是今天的代码
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [[self.cards valueForKeyPath:@"cards"] count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
[ccTableView setBackgroundColor:[UIColor clearColor]];
cardsCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cardsCell"];
if(cell == nil){
NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"cardsCell" owner:self options:nil];
cell = [topLevelObjects objectAtIndex:0];
}
NSString *nmCard = [[self.cards valueForKeyPath:@"cards.name"] objectAtIndex:indexPath.row];
cell.descCardLabel.text = nmCard;
return cell;
}
Run Code Online (Sandbox Code Playgroud) 我有以下数据结构:
- Cards
-- Item 0
--- Name: Card Name
--- Number: Card Number
--- Type: Card Type
-- Item 1
--- Name: Card Name
--- Number: Card Number
--- Type: Card Type
...
Run Code Online (Sandbox Code Playgroud)
用户可以根据需要添加任意数量的卡,因此名称,数量和类型是用户定义的.
第一个问题是,如何将此数据写入NSUserDefauls(嵌套如下)
第二个问题是,如何检索此数据并在表格视图中显示每张卡的名称.(我已经设置了tableview并且正在工作,所以这是从NSUserDefaults获取数据的问题).
任何代码示例都很受欢迎.
谢谢
我的机器上的git有问题,我不小心从我的系统中删除了/ usr/bin/git.
我的git是通过XCode命令行工具安装的,我找不到重新安装它的方法.
git没有被卸载,git文件被删除了.
有没有办法从XCode或其他地方重新安装命令行工具?或者在哪里我可以将原始git文件再次添加到/ usr/bin?
谢谢
objective-c ×2
arrays ×1
cocoa-touch ×1
git ×1
ios ×1
iphone ×1
macos ×1
uitableview ×1
xcode ×1