hi i am new iphone programmer i want to know that can we create array of integer,array of strings....etc seperatly like c++ if yes then how.... i have read about the example g开发者_如何学JAVAiven on this site but that is c style of array.... please reply
NSArray is the standard array class in Cocoa/Cocoa Touch. It can contain objects, but not primitives.
You can store integers in an array by wrapping them with an NSNumber object like so:
NSNumber *myInt = [NSNumber numberWithInt:1];
Then you can store it in an array like so:
NSArray *myArray = [NSArray arrayWithObject:myInt];
NSArray *arr = [NSArray arrayWithObjects:@"a", @"b", @"c", nil];
NSArray *arr = [NSArray arrayWithObjects:[NSNumber numberWithInteger:1]
                                       , [NSNumber numberWithInteger:2]
                                       , [NSNumber numberWithInteger:3]
                                       , nil];
Here's a reference.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论