Arrayにカスタムオブジェクトデータを格納していました。私は関数内のカスタムオブジェクトの配列からデータを取得しています。最初に関数を呼び出すときにはうまくいきますが、何度も何度も呼び出すときにはEXC_BAD_ACCESSを取得しています。ここでカスタムオブジェクトからデータを取得中にEXC_BAD_ACCESSエラーが発生しました
は、関数の詳細です。
-(void) facebookDisplayFunction:(int)atIndex {
FacebookWallData *wall = (FacebookWallData *)[facebook_wallDataArray objectAtIndex:atIndex];
NSString *friendID= wall.actor_id;
NSString *linkFetch= wall.permalink;
NSString* postID=wall.postId;
NSNumber *countNumber;
NSString *[email protected]"";
NSString* [email protected]"";
for(int i=0; i< [facebook_LikesArray count];i++) {
FacebookLikes* countValues=[[FacebookLikes alloc]init];
countValues=[facebook_LikesArray objectAtIndex:i];
// NSLog(@" postId_wall %@ LikePostId = %@",postID,countValues.PostID);
if([postID isEqualToString:countValues.PostID]) {
countNumber=countValues.Count;
if(countNumber>0)
friendID=countValues.Friends;
[countValues release];
break;
}
[countValues release];
}
for(int i=0;i< [facebook_FreindsArray count];i++) {
FacebookFreinds* friendsRecord=[[FacebookFreinds alloc]init];
friendsRecord=[facebook_FreindsArray objectAtIndex:i];
if([friendID isEqualToString:friendsRecord.UID]) {
friendName=friendsRecord.name;
profileThumImage=friendsRecord.pic_smal;
[friendsRecord release];
break;
}
[friendsRecord release];
}
// Adding values in table //
[imageData addObject:@"facebook.png"];
[tableList addObject:wall.messages];
[profileUserName addObject:friendName];
[linksOfFacebookData addObject:linkFetch];
[RetweetAndLikeData addObject:@"5"];
[favedProfileThumb addObject:profileThumImage];
[twitterPostID addObject:@""];
[eachPostUID addObject:friendID];
[wall release];
}
そしてここで私は、関数を呼び出しています。 [self facebookDisplayFunction:0]; [self facebookDisplayFunction:0]; //ここにEXC_BAD_ACCESSエラーがあります。
はい、それは今働いているしてください。 –