Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/42.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
NSMutableArray在iphone应用程序中登录时不显示实际值_Iphone_Nsarray - Fatal编程技术网

NSMutableArray在iphone应用程序中登录时不显示实际值

NSMutableArray在iphone应用程序中登录时不显示实际值,iphone,nsarray,Iphone,Nsarray,我正在做一个数组的NSLog,但它显示的不是数据,而是以下值。我不知道如何修复此问题并从数组中获取值 if(!surveyQuestions){ surveyQuestions=[[NSMutableArray alloc]init]; } Total Survey Questions 3 2012-07-31 08:54:53.555 SQL[442:9203] SurveyQuestions ( "<QuestionData: 0x4da10f0>

我正在做一个数组的NSLog,但它显示的不是数据,而是以下值。我不知道如何修复此问题并从数组中获取值

    if(!surveyQuestions){


    surveyQuestions=[[NSMutableArray alloc]init];


  }



Total Survey Questions 3
2012-07-31 08:54:53.555 SQL[442:9203] SurveyQuestions (
"<QuestionData: 0x4da10f0>",
"<QuestionData: 0x4b9f120>",
"<QuestionData: 0x4ba42e0>"
 )
if(!调查问题){
surveyQuestions=[[NSMutableArray alloc]init];
}
总调查问题3
2012-07-31 08:54:53.555 SQL[442:9203]调查问题(
"",
"",
""
)

您需要执行以下操作:

NSArray *theArray = [[NSArray alloc] initWith...];
NSLog(@"array contents: %@", theArray);

您需要这样做:

NSArray *theArray = [[NSArray alloc] initWith...];
NSLog(@"array contents: %@", theArray);

我不确定您想做什么,但是:可以肯定的是,可怜的数组对象不知道您自己的自定义类做什么以及如何做,打印类实例的最佳可能性是调用其描述方法,您可以看到,这并没有真正的帮助。你可能想做两件事:

I.如果您只想像这样打印对象,请重写类的description方法并使用一些格式字符串(假设您没有编写一行代码,我不得不回过头来猜测):

二,。如果要在其他地方使用类的数据,可能需要手动循环其属性:

for (QuestionData *d in surveyQuestions)
{
    NSLog(@"%@", d.name);
    // etc.
}

我不确定您想做什么,但是:可以肯定的是,可怜的数组对象不知道您自己的自定义类做什么以及如何做,打印类实例的最佳可能性是调用其描述方法,您可以看到,这并没有真正的帮助。你可能想做两件事:

I.如果您只想像这样打印对象,请重写类的description方法并使用一些格式字符串(假设您没有编写一行代码,我不得不回过头来猜测):

二,。如果要在其他地方使用类的数据,可能需要手动循环其属性:

for (QuestionData *d in surveyQuestions)
{
    NSLog(@"%@", d.name);
    // etc.
}

我从josni获取arrya内容我从josnwhat'array values'获取arrya内容?请具体一点,用恰当的英语说,你几乎无法理解…我是说数组中有像Ali一样的值,同样,Brook数组中有值,我想说明什么是“数组值”?请具体一点,用恰当的英语,你几乎无法理解…我是说数组中有像Ali一样的值,同样的,Brook数组中有值,我想展示一下