English 中文(简体)
如何在不了解物体类型的情况下处理服务器的数据(aka,可以是字典或阵列)
原标题:how to handle an data from server without knowing the object type (aka, could be a dictionary or array)

因此,我需要大量服务器。 回报取决于服务器业务的结果。

说一则要求“foo”,如果成功或毛皮(或0换假,意思不执行),则将归还一个 has地图/字典。

根据我的法典,即将其归类为认为应当假定它是一种成功的行动。 i) 检查一下,看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看,一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看一看,一看一看一看一看一看一看一看一看一看一看,

NSString *mapContext = (NSString *) [call xmlrpcCall:@"load_map" withObjects:   [NSArray arrayWithObjects:dataCenter.state,nil]];   
NSLog(@"mapContext in loadStateMap: %@", mapContext);
if ([mapContext isKindOfClass:[NSDictionary class]])
{
    if ([mapContext objectForKey:@"faultCode"])
    {
        NSLog(@"mapContext: %@", mapContext);
        [self defaultAlert:mapContext titleMsg:@"load_map"];
    }
}

这里请服务器装载地图。 如果成功,它将恢复扼杀。 如果它失败,它将交还一名有过错的密码和错误信息的人。 自地图以来,正文被当成示,一度检查其字典和关键过失代码的检查,Xcode就给我发出警告,地图可能无法对“物体”作出反应。 i 完全理解为什么要发出警告,但是否有办法可以防止警告? 它从未破灭,而是渴望看到30+关于这个问题的警告。

最佳回答

Use id, this is what it is for and that is why so many abstracted foundation classes use them (NSArray anyone).

//problem solved!
id mapContext = [call xmlrpcCall:@"load_map" withObjects:   [NSArray arrayWithObjects:dataCenter.state,nil]];
问题回答

暂无回答




相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签