以下是ios-charts库集成的构建设置。 我的应用目标和图表目标的构建设置如下。
但是当我在Xcode7中运行应用程序时,它会让我发出警告
xcode7以后是否已停止支持较旧的设备
注意:我正在使用iPhone5进行测试,运行ios 8.4.1
答案 0 :(得分:1)
Xcode
,Xcode 7
版本为7(iOS 9
)。我希望在设备连接时运行应用程序,但经过一天的搜索后,我发现iOS SDK 9
包含SDK版本9(def partition(a, p, r, pivot):
"""
Permutes the elements of a[p..r] (inclusive) in-place:
first elements <= a[r], then a[r], then those > a[r].
Returns the new location (index) of pivot value a[r] in the array.
"""
i = p - 1
for j in range(p, r + 1):
if a[j] < pivot:
i = i + 1
a[i], a[j] = a[j], a[i]
return i
def mom(a, left, right):
"""
Returns the median of medians for array a.
"""
length = right - left + 1
if length <= 0:
return
if length <= 5:
return sorted(a[left : right + 1])[length/2]
num_of_medians = length/5
medians = [mom(a, left + 5*i, left + 5 * (i + 1) - 1) for i in range(num_of_medians)]
return mom(medians, 0, len(medians) - 1)
def kth(a, left, right, k):
"""
~~~~~
NOTE: k here means k-th smallest element. So in an array of length 10, the
k-th smallest element is the (len(array) - k)-th largest element.
~~~~~
Partitions the array a around the median of medians pivot. Keeps finding new
pivots until the pivot == k. Then the partition is around k.
then a[(len(a) - k)...(len(a)-1)] will output the largest k elements (not sorted)
"""
pivotIndex = mom(a, left, right)
pivotIndex = partition(a, left, right, pivotIndex)
while k != pivotIndex + 1:
if k > pivotIndex + 1:
pivotIndex = kth(a, pivotIndex + 1, right, k)
elif k < pivotIndex + 1:
pivotIndex = kth(a, left, pivotIndex, k)
return pivotIndex + 1 #this is index of the kth largest element
),它不允许在设备上连接或直接运行应用程序其os版本低于iOS 9。
要运行应用,我已将设备更新为iOS 9&amp;它像魅力一样工作。!