我在我的IAP实时应用中遇到此问题。我很紧张,因为它错过了收入机会。任何人都可以帮我理解这个崩溃报告吗?
Crashed: com.apple.main-thread
EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000010
raw
0
libobjc.A.dylib
objc_msgSend + 16
1
StoreKit
__34-[SKProductsRequest _handleReply:]_block_invoke + 52
2 libdispatch.dylib
_dispatch_call_block_and_release + 24
9 UIKit
UIApplicationMain + 204
10
MyApp
main.m line 14
main
11
libdispatch.dylib
(Missing)
答案 0 :(得分:0)
没有多少去那里。
using namespace std;
void minimum(int[], int);
void maximum (int[], int);
void average(int[], int);
void median(int[], int);
void mean(int[], int);
void sort(int[], int);
int ra()
{
int r = rand() % 1000;
return r;
}
int main ()
{
srand(time(NULL));
ra();
int array[20];
int num=20;
for (unsigned int i = 0; i < num; i++)
{
array[i] = ra();
cout << "Index: " << i << ", random number: " << array[i] << endl;
}
minimum();
new_array[20];
num=20;
for (unsigned int i = 0; i < num; i++)
{
new_array[i] = new_array();
cout << "Index: " << i << ", random number: " << minimum << endl;
}
return 0;
}
void minimum(int new_array[], int num)
{
for (unsigned int i = 0; i < num; i++)
if (new_array[i] minimum)
minimum = new_array[i];
cout << "Maximum value: " << minimum << endl;
}
void maximum (int new_array[], int num)
{
for (unsigned int i = 0; i < num; i++)
if (new_array[i] > maximum)
maximum = new_array[i];
cout << "Maximum value: " << maximum << endl;
return 0;
}
void median(int new_array[], int num)
{
//CALCULATE THE MEDIAN (middle number)
if(num % 2 != 0){// is the # of elements odd?
int temp = ((num+1)/2)-1;
cout << "The median is " << new_array[temp] << endl;
}
else{// then it's even! :)
cout << "The median is "<< new_array[(num/2)-1]<<new_array[num/2]< endl;
}
mean(new_array, num);
}
void sort(int new_array[], int num)
{
//ARRANGE VALUES
for(int x=0; x<num; x++){
for(int y=0; y<num-1; y++){
if(new_array[y]>new_array[y+1]){
int temp = new_array[y+1];
new_array[y+1] = new_array[y];
new_array[y] = temp;
}
}
}
cout << "List: ";
for(int i =0; i<num; i++){
cout << new_array[i] << " ";
}
cout << "\n";
median(new_array, num);
}
void average_(int new_array[], int nums)
{
float sum;
for (unsigned int i = 0; i < 20; ++i)
{
sum+=num;
}
cout << "Average value: " << average_/num << endl;
}
Please tell the necessary corrections
如果我是你,我会仔细查看您的0 libobjc.A.dylib objc_msgSend + 16
1 StoreKit __34-[SKProductsRequest _handleReply:]_block_invoke + 52
SKProductRequestDelegate
方法。虽然它没有出现在回溯中,但有时它们并非100%可靠。
要寻找的另一件事是查看该委托是否以某种方式被释放。 -productRequestDidReceiveResponse:
中的崩溃通常是由于这一点。你在使用ARC吗?
这篇文章应该出现在每个ObjC编码器的阅读清单上:
http://sealiesoftware.com/blog/archive/2008/09/22/objc_explain_So_you_crashed_in_objc_msgSend.html