开发者

Cannot addObject into a NSMutableArray?

I have a question about the objective-C. I use the following code to add a contains from an array to another array. However, the second array is null. Can anyone help me? Thank you.

titleArray = [[csvDataArrayString objectAtIndex:0] componentsSeparatedByString:@","];

NSString *title;

dataTitleArray = [[NSMutableArray alloc] init];  // after add this statement it's ok

for(int i=0; i<[tTitleArray count]; i++)
{
    tit开发者_C百科le = [csvPersonalTitleArray objectAtIndex:i];
    [dataTitleArray addObject:title];  // the dataTitleArray is null
}


You haven't shown that you're actually allocating dataTitleArray anywhere. Are you? It's not clear what you're trying to do.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜