我是iphone的新手,我有一个小疑问,就是我在下面的课程中有一个方法
-(void)bookNamesWhichAreInDownloadedQueue:(NSMutableArray *)receivedBookNamesWhichAreInDownloadedQueue{
NSLog(@"receivedBookNamesWhichAreInDownloadedQueue is %@",receivedBookNamesWhichAreInDownloadedQueue);
bookNamesWhichAreInDownloadedQueue = receivedBookNamesWhichAreInDownloadedQueue;
NSLog(@"bookNamesWhichAreInDownloadedQueue is %@",bookNamesWhichAreInDownloadedQueue);
}
这里bookNamesWhichAreInDownloadedQueue是一个NSMutableArray,它包含一些数据。我想用同一个类中的另一个方法检索这个数据的方式是怎么回事。如果有人知道这个请帮帮我
答案 0 :(得分:2)
创建一个返回NSMutableArray
:
-(NSMutableArray*)bookNamesWhichAreInDownloadedQueue:(NSMutableArray *)receivedBookNamesWhichAreInDownloadedQueue{
NSLog(@"receivedBookNamesWhichAreInDownloadedQueue is %@",receivedBookNamesWhichAreInDownloadedQueue);
bookNamesWhichAreInDownloadedQueue = [[NSMutableArray alloc] initWithArray:receivedBookNamesWhichAreInDownloadedQueue];
NSLog(@"bookNamesWhichAreInDownloadedQueue is %@",bookNamesWhichAreInDownloadedQueue);
return bookNamesWhichAreInDownloadedQueue;
}
现在,您可以从要重试NSMutableArray
!!
一切顺利!!!