Ad hoc版本(Xcode 4.2,Lion)不会安装在4.2.1设备上(Ad hoc builds (Xcode 4.2, Lion) won't install on 4.2.1 devices)
随着Lion的到来,我最近安装了GM,并尝试使用Xcode 4.2构建我的一些项目,其中包括iOS 5 beta 2 SDK。
Ad hoc版本在运行iOS 4.2,4.3和5.0的几个iPhone 4上安装得很好。 在运行4.2.1的2台3GS设备上安装失败。 这是由于设备还是操作系统版本?
澄清一下:Lion没有Xcode 4.0或4.1(截至目前),所以一旦Lion登陆App Store,我就会“陷入”4.2。 4.2包括5.0 SDK可能是导致此问题的原因。
任何提示?
With Lion around the corner I recently installed the GM and tried to build some of my projects using Xcode 4.2, which includes the iOS 5 beta 2 SDK.
Ad hoc builds installed just fine on several iPhone 4s running iOS 4.2, 4.3 and 5.0. The installation failed on 2 3GS devices running 4.2.1. Is this due to the devices or the OS versions?
To clarify: There is no Xcode 4.0 or 4.1 for Lion (as of now), so I'll be "stuck" with 4.2 once Lion hits the App Store. 4.2 includes the 5.0 SDK which may be the cause of this issue.
Any hints?
原文:https://stackoverflow.com/questions/6601763
最满意答案
重要的是要注意
$("div[id^='highc']")
返回一个包含DOM元素集合的jQuery对象 (如果选择了任何内容)。 由于jQuery对象类似于数组,$("div[id^='highc']")[0]
将返回jQuery对象中的第一个DOM元素。您可能遇到的问题是您不能在本机DOM元素上使用jQuery方法(如
.append()
)。 换句话说,如果你在jQuery对象的第一个DOM元素上链接.append()
方法(即$("div[id^='highc']")[0].append(...)
),您将收到一条错误,指出.append()
不是函数:未捕获的TypeError:
$(...)[0].append
不是函数由于
.append()
方法在jQuery对象上运行,因此可以使用.eq()
方法来检索包含基于其索引的元素的jQuery对象。$("div[id^='highc']").eq(0).append('Text');
或者,更丑陋的方法是使用
$()
包装DOM元素以返回jQuery对象:$($("div[id^='highc']")[0]).append('Text');
边注:
在你的问题中你使用
$("div[id^='highc'][0]")
和$("div[id^='highc']")[0]
。 我假设这是一个错字,你的意思是后者,因为$("div[id^='highc'][0]")
不会返回任何元素,因为元素可能没有[0]
属性。 您可能尝试在选择器外部使用带有[0]
的.append()
方法。It's important to note that
$("div[id^='highc']")
returns a jQuery object that contains a collection of DOM elements (if anything is selected). Since jQuery objects are similar to arrays,$("div[id^='highc']")[0]
will return the first DOM element in the jQuery object.The issue that you're likely experiencing is that you can't use jQuery methods (like
.append()
) on native DOM elements. In other words, if you are chaining the.append()
method on the first DOM element in the jQuery object (i.e.,$("div[id^='highc']")[0].append(...)
), you will receive an error stating that.append()
is not a function:Uncaught TypeError:
$(...)[0].append
is not a functionSince the
.append()
methods operates on a jQuery object, you could use the.eq()
method in order to retrieve a jQuery object containing the element based on its index.$("div[id^='highc']").eq(0).append('Text');
Alternatively, an uglier approach would be to wrap the DOM element with
$()
in order to return a jQuery object:$($("div[id^='highc']")[0]).append('Text');
Side note:
In your question you used both
$("div[id^='highc'][0]")
and$("div[id^='highc']")[0]
. I'm assuming it was a typo and you meant the latter since$("div[id^='highc'][0]")
wouldn't return any elements due to the fact that the elements probably don't have a[0]
attribute. You probably attempted to use the.append()
method with[0]
outside of the selector.
相关问答
更多-
jQuery("li:not([style])").hide(); jQuery("li:not([style])").hide();
-
为什么jQuery的选择器属性undefined在每个()?(why is jQuery selector property undefined within each()?)[2022-06-13]
this在.each()循环的上下文中不是jQuery对象,所以selector属性是未定义的。 您需要先将其设置为jQuery对象: $(this).selector 但是,应该注意的是, selector属性将在.each()循环内返回一个空字符串。 编辑 如果你绝对需要.each()的selector属性,一个选项就是缓存你的选择器: var cached = $('.tst'); cached.each(function() { console.log(cached.selector); ... -
是。 jQuery 1.3.2发行说明说: 文件顺序返回的元素 这是对jQuery选择器引擎的更改,它将返回的结果重新排序为文档顺序,而不是选择器传入的顺序。此更改是为了符合Selectors API规范(其中jQuery在内部使用支持它的浏览器。 jQuery 1.3不是这样: “a,b,c”样式选择器的顺序可能会改变。 支持querySelectorAll(Safari,Firefox 3.5+,Opera 10+,IE 8+)的浏览器将以文档顺序返回元素,其他浏览器将(按照指定的顺序)返回它们。 在1 ...
-
jQuery选择返回一个jQuery选择集(“jQuery对象”)。 该对象也是一个“数组类似”对象,这意味着您可以通过索引器表示法访问选择,就像在您的示例中一样。 选择集中的元素是dom元素,而不是jQuery选择集本身。 如果要将DOM元素转换为jQuery选择集,则需要将其包装在$(yourElement) 。 var jQ = $("div"); // get all divs jQ[0]; // the first div, a DOMElement $(jQ[0]); // a selectio ...
-
如果要将变量用作属性名称,则可以使用括号表示法,因此data[select] var data = { 'one': {'value': '50,60,70,80'}, 'two': {'value': '10,20,30,40'} } var select = 'two'; var eachValue = data[select].value.split(','); console.log(eachValue) You can use bracket notation if you ...
-
您可以使用add()或merge()方法: 加: el1.add(el2).change(function (e) { //.... }); 合并: $.merge(el1, el2).change(function (e) { //.... }); You can use add() or merge() method: Add: el1.add(el2).change(function (e) { //.... }); Merge: $.merge(el1, el2).ch ...
-
.get(i)返回DOM元素。 你想要的是其中之一: $('#nav .menu').first() $('#nav .menu').eq(0) 有关可能的过滤器功能列表,请参阅http://api.jquery.com/category/traversing/filtering/ 。 .get(i) returns the DOM element. What you want is one of these: $('#nav .menu').first() $('#nav .menu').eq(0) ...
-
如果您希望将元素鼠标悬停在不冒泡的位置,请使用stopPropagation() 。 $('img').hover(function(event) { event.stopPropagation(); }, ...); 更好的方法是将事件处理程序附加到文档,并使用event.which来确定启动事件的内容。 $(document).hover(function(event) { var element = event.which; }, ...); I managed to fix this ...
-
.find (以及$(selector, parent)表单)查找后代 ,即它会在 .group_delivery元素中查找.group_delivery元素。 但是,您希望找到包含这两个类的元素: $('.group_delivery.checkbox_checked') 或者你可以使用.filter : $('.group_delivery').filter('.checkbox_checked') 但是,如果我使用.each遍历$('.group_delivery')对象,我可以找到所需的范围: ...
-
重要的是要注意$("div[id^='highc']")返回一个包含DOM元素集合的jQuery对象 (如果选择了任何内容)。 由于jQuery对象类似于数组, $("div[id^='highc']")[0]将返回jQuery对象中的第一个DOM元素。 您可能遇到的问题是您不能在本机DOM元素上使用jQuery方法(如.append() )。 换句话说,如果你在jQuery对象的第一个DOM元素上链接.append()方法(即$("div[id^='highc']")[0].append(...) ),您 ...