Friday, January 10, 2014

IOS How to return a generic data ah

As I have. NET to return a list of videos
Method
public static List GetVideoList (string name);

That wording is now IOS how to write it?

I can only write
+ (Id) GetVideoListWithName: (NSString *) name;

But this just returns an indicator of how it is also a generic return it?

Thank you
Reply:
In the collection of objective-c using NSMutableArray, NSArray


Reply:

Generic data you need to want to change the data format for the OC.

If you have to use this form of the generic List data, then use the C + + code inside the OC generic data Well, OC is supported in C + +.
Reply:
NSMutableArray, NSArray
-------------------
But here is just an array ah?
There's no
like C #NSMutableArray

Otherwise the array had to be in another place not cast
class(Video *) item

Thank you
Reply:
reference to the third floor javamy031 reply:
NSMutableArray, NSArray
-------------------
But here is just an array ah?
There's no
like C #NSMutableArray

Otherwise the array had to be in another place not cast
class(Video *) item

Thank you



objective-c is not strongly typed, you can add all objects inherit from NSObject to NSArray in.
NSArray use is not you write NSMutableArray this, NSArray is a collection

NSMutableArray * array = [[NSMutableArray alloc] init];
[Array addObject: ...];

No way, you can only be used when the type of conversion.

Reply:
list is a collection of MutableArray also a collection I'm not sure how you need to convert these data is a list object does not correspond to the entity-relationship data collection yet? MutableArray which is also associated with an entity object to do the operation can not understand why the will ask this question ......

No comments:

Post a Comment