I've a little problem: I've created two mutable arrays and added an object of "actProject" to "allProject". Everything works fine but I do not know how to display one single object of allProject (e.g. "Date").
    NSMutableArray *allProject= [[NSMutableArray alloc]initWithObjects: nil];
 NSMutableArray *actProject = [[NSMutableArray alloc]initWithObjects: nil];
 [actProject addObject:(NSString*)@"Name"];
 [actProject addObject:(NSString*)@"Description"];
 [actProject addObject:(NSString*)@"Date"];
 [allProject addObject:actProject];
 NSLog(@"test: %@",[allProject objectAtIndex:0]);
How to get "Date" only开发者_高级运维 by accessing "allProject"?
Any ideas?
[[allProject objectAtIndex:0]objectAtIndex:2]
It's basically an array within an array, so you treat it as such.
Are you expecting that [allProject objectAtIndex:0] is an NSString* "Name"? Actually, it is an NSMutableArray, actProject. You're just storing an array inside of an array. This is generally not a good idea.
If you want to add the individual items of actProject to allProject, use -addObjectsFromArray.
 NSMutableArray *allProject= [NSMutableArray array];
 NSMutableArray *actProject = [NSMutableArray array];
 [actProject addObject:@"Name"];
 [actProject addObject:@"Description"];
 [actProject addObject:@"Date"];
 [allProject addObjectsFromArray:actProject];
 NSLog(@"test: %@",[allProject objectAtIndex:0]); //should be @"Name" now.
If I understod right you are looking for:
[[allProject objectAtIndex:0] objectAtIndex:2]
In that way in objective-C you can nest messages to objects.
Btw you do not need to cast those object to (NSString *)
NSLog(@"test: %@",[[allProject objectAtIndex:0] objectAtIndex:2]);
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论