对于这可能涉及的人,我已经搜索了相当多的时间,以便摆脱这个错误
"无法通过行访问已删除的行信息"
我知道,一旦从数据表中删除了一行,就无法以典型的方式访问它,这就是我收到此错误的原因.最大的问题是我不知道该怎么做才能得到我想要的结果,我将在下面概述.
基本上,当删除"dg1"中的行时,它下面的行取代已删除的行(显然),从而继承已删除的行索引.此方法的目的是替换和重置行索引(通过从数据集中的相应值中抓取它),该索引将删除的行放置并且因此索引值.
现在我只是使用标签(lblText)来尝试从进程获得响应,但是当最后一个嵌套的if语句尝试比较值时崩溃.
这是代码:
void dg1_Click(object sender, EventArgs e)
{
rowIndex = dg1.CurrentRow.Index; //gets the current rows
string value = Convert.ToString(dg1.Rows[rowIndex].Cells[0].Value);
if (ds.Tables[0].Rows[rowIndex].RowState.ToString() == "Deleted")
{
for (int i = 0; i < dg1.Rows.Count; i++)
{
if (Convert.ToString(ds.Tables[0].Rows[i][0].ToString()) == value)
// ^ **where the error is occurring**
{
lblTest.Text = "Aha!";
//when working, will place index of compared dataset value into rowState, which is displaying the current index of the row I am focussed on in 'dg1'
} …Run Code Online (Sandbox Code Playgroud) 我正在录制音频,并将其作为Blob发送到Node.js服务器。然后,nodejs服务器将其发送给当前未记录的所有已连接用户。
发送Blob:
mediaRecorder.onstop = function(e) {
var blob = new Blob(this.chunks, { 'type' : 'audio/ogg; codecs=opus' });
socket.emit('radio', blob);
};
Run Code Online (Sandbox Code Playgroud)
服务器收到Blob:
socket.on('radio', function(blob) {
socket.broadcast.emit('voice', blob);
});
Run Code Online (Sandbox Code Playgroud)
侦听器收到Blob:
socket.on('voice', function(arrayBuffer) {
var blob = new Blob([arrayBuffer], { 'type' : 'audio/ogg; codecs=opus' });
var audio = document.getElementById('audio');
audio.src = window.URL.createObjectURL(blob);
audio.play();
});
Run Code Online (Sandbox Code Playgroud)
此功能适用于Safari和所有ios设备以外的所有浏览器/设备。与野生动物园的检查员一起进行进一步研究,我发现了这一点:
野生动物园是否需要在标头中添加其他内容才能正确解释Blob对象?我研究了可接受的音频类型,尝试了aac / mp3 / ogg,但没有成功。在进一步阅读后,我听说了以下事实:尽管我不太清楚任何细节,但在野生动物园和IOS中流blob音频/视频数据存在错误。
礼仪方向的指导将非常有帮助!
编辑:看起来像这条线audio.src = window.URL.createObjectURL(blob);接收Blob中的是引起Blob错误的原因(我链接的图像)
编辑2:我试图查看是否使用blob以外的其他格式,选择base64编码的字符串。看起来这适用于除iOS和Safari之外的所有设备和浏览器。我的印象是它与IOS解释/加载数据的方式有关...
我有像这样重叠的单元格:

我cellForItemAtIndexPath是这样的:
func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
let cell = collectionView.dequeueReusableCellWithReuseIdentifier("Cell", forIndexPath: indexPath) as UICollectionViewCell
cell.backgroundColor = UIColor(red: 27.0/255.0, green: 38.0/255.0, blue: 52.0/255.0, alpha: 1.0)
let textFrame = CGRect(x: 0, y: cell.frame.height * 0.30, width: cell.frame.width, height: cell.frame.height)
var textLabel: UILabel! = UILabel(frame: textFrame)
textLabel.font = UIFont(name:"Helvetica-Light", size: 14.0)
textLabel.textAlignment = .Center
textLabel.textColor = UIColor.whiteColor()
println(categoryArray[indexPath.row].category)
textLabel.text = categoryArray[indexPath.row].category
var cellImage = UIImage(named: categoryArray[indexPath.row].catImage)//Array(Array(model.categories.values)[cellCount])[1]
let imageSize = cell.frame.height * 0.45
let imageView = UIImageView(image: …Run Code Online (Sandbox Code Playgroud) 我有一个带有imageview的视图.我希望能够做到这一点,以便imageview始终保持完美的正方形,但我不完全确定如何使用autolayout实现它.
我的屏幕目前看起来像这样:

无论宽度尺寸如何,imageview都是我想要的正方形.我知道这可以通过约束来完成,我已经尝试过,但最终还是无法弄清楚如何实现这一点.这可能是由于我对自动布局,故事板和ios开发的相对缺乏经验
ios ×2
swift ×2
autolayout ×1
blob ×1
c# ×1
datagrid ×1
dataset ×1
html5-audio ×1
ios8 ×1
node.js ×1
runtime ×1
socket.io ×1
uistoryboard ×1
xcode ×1