1
我想獲得帶有配方ID的所有圖像的數組,並希望將此圖像數組傳遞給下一個viewController,但我的問題是我只獲取一個圖像,我使用recipeDC作爲實體類,對我應該使用其他實體類或者它也可以通過使用相同的類來完成所有圖像,我應該怎麼辦的陣列,IM卡請幫幫我,如何從IOS中的NSDictionary中獲取圖像數組
-(NSMutableArray *)getAllRecipiesByUserId:(RecipeDC *)recipeid
{
NSMutableArray *dataArray = [[NSMutableArray alloc] init];
NSString *url = [NSString stringWithFormat:@"%@get_all_recipies_by_user_id&user_id=%d",kWSURL,recipeid.user_id];
NSDictionary * returnDict = (NSDictionary *) [self callWebService:url];
if([returnDict objectForKey:@"response"])
{
NSDictionary * returnDictSuccess = (NSDictionary *) [returnDict objectForKey:@"response"];
NSArray *returnedDealArray = [returnDictSuccess objectForKey:@"recipies"];
RecipeDC *recpie = [[RecipeDC alloc] init];
for(NSDictionary *dealDict in returnedDealArray)
{
recpie.recipe_id=[[dealDict objectForKey:@"recipe_id"]intValue ];
recpie.category_id=[[dealDict objectForKey:@"category_id"]intValue ];
recpie.user_id=[[dealDict objectForKey:@"user_id"]intValue ];
recpie.recipe_name = [dealDict objectForKey:@"recipe_name" ];
recpie.recipe_detail = [dealDict objectForKey:@"recipe_detail"];
NSArray *img = [dealDict objectForKey:@"images"];
for(NSDictionary *dealDict in img)
{
recpie.recipie_img_id=[[dealDict objectForKey:@"recipe_images_id"]intValue];
recpie.recipe_id=[[dealDict objectForKey:@"recipe_id"]intValue];
recpie.recipie_img_url=[dealDict objectForKey:@"image_url"];
}
[dataArray addObject:recpie];
NSLog(@"arr count is %u",[dataArray count]);
}
}
return dataArray;
}
我沒有..你可以告訴我在圖像陣列中獲得完整的圖像? – NullData 2013-02-15 06:01:07
更新了答案.. – iphonic 2013-02-15 06:12:01
還未解決:(.. – NullData 2013-02-15 07:34:15