IOS如何在调用success后检索xml中的一个元素,并将其放入数组中以显示在tableview上

IOS如何在调用success后检索xml中的一个元素,并将其放入数组中以显示在tableview上,ios,objective-c,uitableview,soap,nsxmlparser,Ios,Objective C,Uitableview,Soap,Nsxmlparser,.M文件,我在这里验证我的自签名证书,并使用nsurl连接检索它,并在将它们放到tableview之前解析到nsxmlparser。但我可以接收数据,但可以检索名为“Severity”的特定元素。请帮忙。!!我需要将Severity标记中的项加载到数组中,并插入到表视图中 // IncidentTableViewController.m #import "IncidentTableViewController.h" #import "InviteViewController.h" #imp

.M文件,我在这里验证我的自签名证书,并使用nsurl连接检索它,并在将它们放到tableview之前解析到nsxmlparser。但我可以接收数据,但可以检索名为“Severity”的特定元素。请帮忙。!!我需要将Severity标记中的项加载到数组中,并插入到表视图中

//  IncidentTableViewController.m

#import "IncidentTableViewController.h"

#import "InviteViewController.h"
#import "Incidents.h"
#import "FeedListMenuView.h"
#import "FeedListMenuView.h"
#import "FeedViewController.h"


@interface IncidentTableViewController ()
@property NSString *currentElement;
@property NSMutableData *webResponseData;
@property NSMutableDictionary *dictBook;
@property NSMutableArray *arrBook;
@property NSMutableString *elementValue;


@end
@interface FeedViewController ()

@end

@implementation IncidentTableViewController

//@synthesize response;
//@synthesize status;
@synthesize resultLabel;
@synthesize  webResponseData, currentElement;

- (void)viewDidLoad {
    [super viewDidLoad];
    NSLog(@"Response recieved");
    output= [[NSMutableArray alloc] init];
    feeds = [[NSMutableArray alloc] init];
//    NSString *severity = @"Informational";
    NSString *soapMessage = @"<?xml version=\"1.0\" encoding=\"utf-8\"?>"
    "<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">"
                             "<soap:Body>"
                            " <IncidentGetList xmlns=\"https://www.monitoredsecurity.com/\">"
                             "<Severity></Severity>"
                             "<SourceOrganization></SourceOrganization>"
                             "<DestinationOrganization></DestinationOrganization>"
                            "<MaxIncidents></MaxIncidents>"
                             "<SourceIP></SourceIP>"
                             "<Category></Category>"
                             "<ExcludeCategory></ExcludeCategory>"
                             "<StartTimeStampGMT></StartTimeStampGMT>"
                             "<EndTimeStampGMT></EndTimeStampGMT>"
                             "<CustomerSeverity></CustomerSeverity>"
                             "</IncidentGetList>"
                             "</soap:Body>"
                             "</soap:Envelope>";


    NSURL *url = [NSURL URLWithString:@"https://api.monitoredsecurity.com/SWS/incidents.asmx"];
    NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
    NSString *msgLength = [NSString stringWithFormat:@"%d", [soapMessage length]];

    [theRequest addValue: @"text/xml; charset=utf-8" forHTTPHeaderField:@"Content-Type"];
    [theRequest addValue: @"https://www.monitoredsecurity.com/IncidentGetList" forHTTPHeaderField:@"SOAPAction"];
    [theRequest addValue: msgLength forHTTPHeaderField:@"Content-Length"];
    [theRequest setHTTPMethod:@"POST"];
    [theRequest setHTTPBody: [soapMessage dataUsingEncoding:NSUTF8StringEncoding]];







    NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self];
    [connection start];

    if(connection)
    {
        webResponseData = [NSMutableData data] ;

    }
    else
    {
        NSLog(@"Connection is NULL");
    }

       // Menu View



    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    // Insert Navigation Bar
//    [self insertNavBarWithScreenName:SCREEN_INCIDENT];
//    
//    CGRect frm = btnDownArrow.frame;
//    frm.origin.x = 185;
//    frm.origin.y = 42;
//    [btnDownArrow setFrame:frm];
//    [self.navBarView addSubview:btnDownArrow];
//    
//   
//    
//    [self addGestureRecognizersToPiece:self.view];
}

- (void)addGestureRecognizersToPiece:(UIView *)piece
{
    UITapGestureRecognizer * tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapPiece:)];
    tapGesture.delegate = self;
    [piece addGestureRecognizer:tapGesture];
}

- (void) tapPiece:(UITapGestureRecognizer *)gestureRecognizer {
    [btnDownArrow setSelected:NO];

}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

#pragma mark - Table view data source
//
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//#warning Incomplete implementation, return the number of sections
//    return 1;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//#warning Incomplete implementation, return the number of rows
//    return [output countc];
//}


#pragma mark --
#pragma mark -- Set navigationBar --

- (void) didClickNavBarLeftButton
{
    CGRect frm = self.view.frame;
    frm.origin.x = 254;
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3f];
    [UIView setAnimationDelegate:self];

    [self.view setFrame:frm];
    //[self setEnable:NO];

    [UIView commitAnimations];

    [self tapPiece:nil];
}


- (void) didClickNavBarRightButton
{
    [self tapPiece:nil];

    if (rightController == nil) {
        rightController = [[InviteViewController alloc] viewFromStoryboard];
        [self.view.superview addSubview:rightController.view];
        [rightController.view setFrame:CGRectMake( 320, 0, gScreenSize.width, gScreenSize.height )];
    }

    [collectView setUserInteractionEnabled:!(self.view.frame.origin.x > -254)];

    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3f];
    [UIView setAnimationDelegate:self];

    if (self.view.frame.origin.x > -254) {
        self.view.transform = CGAffineTransformMakeTranslation( -254 * 2, 0 );
        rightController.view.transform = CGAffineTransformMakeTranslation( -254, 0 );
    }
    else {
        self.view.transform = CGAffineTransformMakeTranslation( -254, 0 );
        rightController.view.transform = CGAffineTransformMakeTranslation( 0, 0 );
    }

    [UIView commitAnimations];
}


#pragma mark --
#pragma mark -- UICollectionViewDataSource, UICollectionViewDelegate --

- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
    return [[arrFeeds objectAtIndex:section] count];
}

- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView
{
    return [arrFeeds count];
}





#pragma mark --
#pragma mark -- FeedListMenuViewDelegate --

- (void) didClickFeedListMenu:(FeedListMenuView *)flmv index:(int)index
{
    [btnDownArrow setSelected:NO];
}



- (void)connection:(NSURLConnection *) connection didReceiveResponse:(NSURLResponse *)response
{
    NSLog(@"Response recieved");
    [self.webResponseData  setLength:0];
}

- (void)connection:(NSURLConnection*) connection didReceiveData:(NSData *)data
{
    NSLog(@"Data recieved");

   // NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
    [self.webResponseData  appendData:data];



     // NSLog(responseString);
   // [response setText:responseString];

    //[status setText:@"Response retrieved async"];
}

-(void)connectionDidFinishLoading:(NSURLConnection *)connection {

    NSLog(@"Received %lu Bytes", (unsigned long)[webResponseData length]);
    NSString *theXML = [[NSString alloc] initWithBytes:
                        [webResponseData mutableBytes] length:[webResponseData length] encoding:NSUTF8StringEncoding];

    NSLog(@"%@",theXML);

    //now parsing the xml

    NSData *myData = [theXML dataUsingEncoding:NSUTF8StringEncoding];

    NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:myData];

    //setting delegate of XML parser to self
    xmlParser.delegate = self;
    [xmlParser parse];

    // Run the parser
    @try{
        BOOL parsingResult = [xmlParser parse];
        NSLog(@"parsing result = %hhd",parsingResult);
    }
    @catch (NSException* exception)
    {
        UIAlertView* alert = [[UIAlertView alloc]initWithTitle:@"Server Error" message:[exception reason] delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil];
        [alert show];
        return;
    }
}


//Implement the NSXmlParserDelegate methods
-(void) parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName
  namespaceURI:(NSString *)namespaceURI qualifiedName:
(NSString *)qName attributes:(NSDictionary *)attributeDict
{
  element = elementName;

    if ([element isEqualToString:@"SecurityIncidentSummary"]) {

        IncidentGetList    = [[NSMutableDictionary alloc] init];

        Severity   = [[NSMutableString alloc] init];

    }    //NSLog(@"current element: ", elementName);
}
- (void)parserDidStartDocument:(NSXMLParser *)parser{
    NSLog(@"File found and parsing started");

}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string
{
    if ([element isEqualToString:@"Severity"]) {
        [Severity appendString:string];
    }
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName
  namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName
{
    if ([elementName isEqualToString:@"SecurityIncidentSummary"]) {

        [IncidentGetList setObject:Severity forKey:@"Severity"];

        [feeds addObject:[IncidentGetList copy]];
    }

}

- (void)parserDidEndDocument:(NSXMLParser *)parser {

   NSLog(@"Final Feed : %@",feeds);
}




- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace {
    return [protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust];
}
-       (void)connection:(NSURLConnection *)connection
willSendRequestForAuthenticationChallenge:
(NSURLAuthenticationChallenge *)challenge

{
    if ([challenge previousFailureCount] == 0)
    {
        SecIdentityRef identity = [self getClientCertificate];
        CFArrayRef certs = [self getCertificate];
        NSArray *myArray = (__bridge NSArray *)certs;
        NSURLCredential *newCredential = [NSURLCredential credentialWithIdentity:identity
                                                                    certificates:myArray persistence:NSURLCredentialPersistenceNone];
        [challenge.sender useCredential:newCredential forAuthenticationChallenge:challenge];
    }
    else {
        [[challenge sender] cancelAuthenticationChallenge:challenge];
    }
}

-(CFArrayRef)getCertificate
{
    SecIdentityRef identity = [self getClientCertificate];
    SecCertificateRef certificate = nil;
    SecIdentityCopyCertificate(identity, &certificate);
    SecCertificateRef certs[1] = {certificate};
    CFArrayRef array = CFArrayCreate(NULL, (const void **) certs, 1, NULL);
    SecPolicyRef myPolicy = SecPolicyCreateBasicX509();
    SecTrustRef myTrust;

    OSStatus status = SecTrustCreateWithCertificates(array, myPolicy, &myTrust);
    if (status == noErr){
        NSLog(@"No Err creating certificate");
    }
    else{
        NSLog(@"Possible Err Creating certificate");
    }
    return array;
}
-(SecIdentityRef)getClientCertificate
{
    SecIdentityRef identityApp = nil;
    NSString *thePath = [[NSBundle mainBundle] pathForResource:@"cert" ofType:@"p12"];
    NSData *PKCS12Data = [[NSData alloc] initWithContentsOfFile:thePath];
    CFDataRef inPKCS12Data = (__bridge CFDataRef)PKCS12Data;
    CFStringRef password = CFSTR("123456");
    const void *keys[] = {kSecImportExportPassphrase}; //kSecImportExportPassphrase };
    const void *values[] = {password};
    CFDictionaryRef options = CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL);
    CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
    OSStatus securityError = SecPKCS12Import(inPKCS12Data, options, &items);
    CFRelease(options);
    CFRelease(password);
    if (securityError == errSecSuccess)
    {
        NSLog(@"Success opening p12 certificate. Items: %ld", CFArrayGetCount(items));
        CFDictionaryRef identityDict = CFArrayGetValueAtIndex(items, 0);
        identityApp = (SecIdentityRef)CFDictionaryGetValue(identityDict,
                                                           kSecImportItemIdentity);
    }
    else{
        NSLog(@"Error opening Certificate.");
    }
    return identityApp;
}

//- (void)connection:(NSURLConnection *)connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
//    NSError *error = nil;
//    NSString *path = [[NSBundle mainBundle] pathForResource:[@"SII_2350" stringByDeletingPathExtension] ofType:[@"p12" pathExtension]];
//    NSData *certData = [[NSData alloc] initWithContentsOfFile:path options:0 error:&error];
//    CFDataRef inP12data = (__bridge CFDataRef)certData;
//    SecIdentityRef identity;
//    SecTrustRef trust;
//    
//    
//    OSStatus status = extractIdentityAndTrust(inP12data, &identity, &trust);
//    NSLog(@"status %d", (int)status);
//    if(status == errSecSuccess) {
//        SecCertificateRef certificate;
//        SecIdentityCopyCertificate(identity, &certificate);
//        const void *certs[] = { certificate };
//        CFArrayRef certsArray = CFArrayCreate(NULL, certs, 1, NULL);
//        NSArray *certificatesForCredential = (__bridge NSArray *)certsArray;
//        NSURLCredential *credential = [NSURLCredential credentialWithIdentity:identity
//                                                                 certificates:certificatesForCredential
//                                                                  persistence:NSURLCredentialPersistencePermanent];
//        [challenge.sender useCredential:credential forAuthenticationChallenge:challenge];
//        CFRelease(identity);
//        CFRelease(certificate);
//        CFRelease(certsArray);
//    }
//    else {
//        [challenge.sender cancelAuthenticationChallenge:challenge];
//    }
//    
//    
//}
- (void)connection:(NSURLConnection*) connection didFailWithError:(NSError *)error
{
    NSLog([NSString stringWithFormat:@"Did recieve error: %@", [error localizedDescription]]);
    NSLog([NSString stringWithFormat:@"%@", [error userInfo]]);
}



OSStatus extractIdentityAndTrust(CFDataRef inPKCS12Data, SecIdentityRef *identity, SecTrustRef *trust){
//    OSStatus securityError = errSecSuccess;
//    
//    CFStringRef password = CFSTR("123456");
//    const void *keys[] = { kSecImportExportPassphrase };
//    const void *values[] = { password };
//    
//    CFDictionaryRef options = CFDictionaryCreate(NULL, keys, values, 1, NULL, NULL);
//    
//    CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
//    securityError = SecPKCS12Import(inP12data, options, &items);
//    
//    if (securityError == 0) {
//        CFDictionaryRef myIdentityAndTrust = CFArrayGetValueAtIndex(items, 0);
//        const void *tempIdentity = NULL;
//        tempIdentity = CFDictionaryGetValue(myIdentityAndTrust, kSecImportItemIdentity);
//        *identity = (SecIdentityRef)tempIdentity;
//        const void *tempTrust = NULL;
//        tempTrust = CFDictionaryGetValue(myIdentityAndTrust, kSecImportItemTrust);
//        *trust = (SecTrustRef)tempTrust;
//    }
//    
//    if (options) {
//        CFRelease(options);
//    }
//    
//    return securityError;
    OSStatus securityError = errSecSuccess;
    CFStringRef password = CFSTR("123456");
    const void *keys[] =   { kSecImportExportPassphrase };
    const void *values[] = { password };
    CFDictionaryRef optionsDictionary = CFDictionaryCreate(
                                                           NULL, keys,
                                                           values, 1,
                                                           NULL, NULL);
    CFArrayRef items = CFArrayCreate(NULL, 0, 0, NULL);
    securityError = SecPKCS12Import(inPKCS12Data,
                                    optionsDictionary,
                                    &items);

    if (securityError == 0) {
        CFDictionaryRef myIdentityAndTrust = CFArrayGetValueAtIndex (items, 0);
        const void *tempIdentity = NULL;
        tempIdentity = CFDictionaryGetValue (myIdentityAndTrust,
                                             kSecImportItemIdentity);
        *identity = (SecIdentityRef)tempIdentity;
        const void *tempTrust = NULL;
        tempTrust = CFDictionaryGetValue (myIdentityAndTrust, kSecImportItemTrust);
        *trust = (SecTrustRef)tempTrust;
    }

    if (optionsDictionary) {
        CFRelease(optionsDictionary);
    }

    return securityError;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

// Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
// Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)
    return [feeds count];

}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{


static NSString *cellId = @"cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"UITableViewCell"];
    if(cell == nil){
        cell= [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:cellId];


    }

   cell.textLabel.text= [[feeds objectAtIndex:indexPath.row]objectForKey:@"Severity"];
    return cell;





}

//UNTIL HERE


//
//- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
////    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
//    static NSString *cellIdentifier = @"cell";
//    
//    UITableView *cell = [tableView dequeueReusableCellWithIdentifier:[cellIdentifier ];
//                         
//                         if(cell == nill){
//                             cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]autorelease];
//                         
//                         }
//
//                         
////    
////    return cell;
//}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source
        [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
    } else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
    }   
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/


#pragma mark - Table view delegate

 //In a xib-based application, navigation from a table can be handled in -tableView:didSelectRowAtIndexPath:
//- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
//    // Navigation logic may go here, for example:
//    // Create the next view controller.
//   // <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:<#@"Nib name"#> bundle:nil];
//    
//    // Pass the selected object to the new view controller.
//    
//    // Push the view controller.
//    //[self.navigationController pushViewController:detailViewController animated:YES];
//    [self.tableView deselectRowAtIndexPath:indexPath animated:YES];
//
//}


/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
//IncidentTableViewController.m
#导入“IncidentTableViewController.h”
#导入“InviteViewController.h”
#导入“事件.h”
#导入“FeedListMenuView.h”
#导入“FeedListMenuView.h”
#导入“FeedViewController.h”
@接口IncidentTableViewController()
@属性NSString*currentElement;
@属性NSMutableData*webResponseData;
@属性NSMutableDictionary*dictBook;
@属性NSMutableArray*arrBook;
@属性NSMutableString*elementValue;
@结束
@接口FeedViewController()
@结束
@意外事件视图控制器的实现
//@综合反应;
//@综合地位;
@合成结果标签;
@合成webResponseData、currentElement;
-(无效)viewDidLoad{
[超级视图下载];
NSLog(“收到响应”);
输出=[[NSMUTABLEARRY alloc]init];
feed=[[NSMutableArray alloc]init];
//NSString*严重性=@“信息性”;
NSString*soapMessage=@“”
""
""
" "
""
""
""
""
""
""
""
""
""
""
""
""
"";
NSURL*url=[NSURL URLWithString:@”https://api.monitoredsecurity.com/SWS/incidents.asmx"];
NSMutableURLRequest*theRequest=[NSMutableUrlRequestWithURL:url];
NSString*msgLength=[NSString stringWithFormat:@“%d”,[soapMessage length]];
[theRequest addValue:@“text/xml;charset=utf-8”用于HttpHeaderField:@“Content Type”];
[请求附加值:@”https://www.monitoredsecurity.com/IncidentGetListforHTTPHeaderField:@“SOAPAction”];
[theRequest addValue:msgLength for HttpHeaderField:@“内容长度”];
[TheRequestSetHttpMethod:@“POST”];
[TheRequestSetHttpBody:[soapMessage数据使用编码:NSUTF8StringEncoding];
NSURLConnection*connection=[[NSURLConnection alloc]initWithRequest:theRequest委托:self];
[连接启动];
如果(连接)
{
webResponseData=[NSMutableData];
}
其他的
{
NSLog(@“连接为空”);
}
//菜单视图
//取消对下一行的注释以保留演示文稿之间的选择。
//self.clearselectiononviewwillappear=否;
//取消对以下行的注释,以在此视图控制器的导航栏中显示编辑按钮。
//self.navigationItem.rightBarButtonItem=self.editButtonItem;
//插入导航栏
//[带屏幕名称的自插入导航栏:屏幕事件];
//    
//CGRect frm=btnDownArrow.frame;
//frm.origin.x=185;
//frm.origin.y=42;
//[BTN向下箭头设置帧:frm];
//[self.navBarView addSubview:btnDownArrow];
//    
//   
//    
//[self addgesturecognizerstopice:self.view];
}
-(无效)AddGestureRecognitizerStopiece:(UIView*)件
{
UITapGestureRecognizer*TapSirtation=[[UITapGestureRecognizer alloc]initWithTarget:self-action:@selector(tapPiece:)];
tappostate.delegate=self;
[工件添加手势识别器:点击手势];
}
-(无效)tapPiece:(UITapGestureRecognitor*)GestureRecognitor{
[btnDownArrow setSelected:否];
}
-(无效)未收到记忆警告{
[超级记忆警告];
//处置所有可以重新创建的资源。
}
#pragma标记-表视图数据源
//
//-(NSInteger)表格视图中的节数:(UITableView*)表格视图{
//#警告未完成实现,返回节数
//返回1;
//}
//
//-(NSInteger)表视图:(UITableView*)表视图行数节:(NSInteger)节{
//#警告未完成实现,返回行数
//返回[输出计数c];
//}
#布拉格标记--
#pragma标记--设置导航栏--
-(无效)单击导航栏左侧按钮
{
CGRect frm=self.view.frame;
frm.origin.x=254;
[UIView beginAnimations:nil上下文:NULL];
[UIView设置动画持续时间:0.3f];
[UIView setAnimationDelegate:self];
[self.view setFrame:frm];
//[自设置启用:否];
[UIView委员会];
[自拍:无];
}
-(无效)单击导航栏按钮
{
[自拍:无];
if(rightController==nil){
rightController=[[InviteViewController alloc]viewFromStoryboard];
[self.view.superview addSubview:rightController.view];
[rightController.view setFrame:CGRectMake(320,0,gScreenSize.width,gScreenSize.height)];
}
[collectView setUserInteractionEnabled:!(self.view.frame.origin.x>-254)];
[UIView beginAnimations:nil上下文:NULL];
[UIView设置动画持续时间:0.3f];
[UIView setAnimationDelegate:self];
if(self.view.frame.origin.x>-254){
self.view.transform=CGAffineTransformMakeTransform(-254*2,0);
rightController.view.transform=CGAffineTransformMakeTransform(-254,0);
}
否则{
self.view.transform=CGAffineTransformMakeTransform(-254,0);
rightController.view.transform=CGAffineTransformMakeTransform(0,0);
}
[UIView委员会];
}
#布拉格标记--
#pragma标记--UICollectionViewDataSource,UICollectionViewDelegate--
-(NSInteger)collectionView:(UICollectionView*)collectionView项目编号截面:(NSInteger)截面
{
返回[[arrFeeds objectAtIndex:section]计数];
}
-(NSInteger)收集V中的节数
#import <UIKit/UIKit.h>
#import "CustomNavViewController.h"
#import "FeedListMenuView.h"
#import <UIKit/UIKit.h>
#import <Security/Security.h>
#import <CoreFoundation/CoreFoundation.h>
#import "SYSoapTool.h"

@interface IncidentTableViewController :UIViewController< UITableViewDataSource,UITableViewDelegate, UIGestureRecognizerDelegate, SOAPToolDelegate, NSXMLParserDelegate> {
    IBOutlet UIButton * btnDownArrow;

    IBOutlet UICollectionView * collectView;
      NSMutableArray * arrFeeds;

    SuperViewController * rightController;
    NSMutableArray *output;
    BOOL errorParsing;
    NSMutableString *strCaptured;
    NSMutableDictionary *item;




}
@property (weak, nonatomic) IBOutlet UITableView *datalist;


@property (weak, nonatomic) IBOutlet UILabel *resultLabel;
@property(nonatomic, retain) IBOutlet UILabel *status;
@property(nonatomic, retain) IBOutlet UITextView *response;
-(IBAction)retrieveResponseAsync:(id)sender;

- (void)connection:(NSURLConnection *) connection didReceiveResponse:(NSURLResponse *)response;
- (void)connection:(NSURLConnection *) connection didReceiveData:(NSData *)data;
- (void)connection:(NSURLConnection *) connection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge;
- (void)connection:(NSURLConnection *) connection didFailWithError:(NSError *)error;
- (BOOL)connection:(NSURLConnection *)connection canAuthenticateAgainstProtectionSpace:(NSURLProtectionSpace *)protectionSpace;

OSStatus extractIdentityAndTrust(CFDataRef inP12data, SecIdentityRef *identity, SecTrustRef *trust);



@end
@interface ViewController (){


NSMutableDictionary *IncidentGetList;
NSMutableString* Severity;
NSMutableArray *feeds;
NSString *element;
}


 /* Parser Delegate method */

- (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes:(NSDictionary *)attributeDict {

element = elementName;

if ([element isEqualToString:@"IncidentGetList"]) {

    IncidentGetList    = [[NSMutableDictionary alloc] init];

    Severity   = [[NSMutableString alloc] init];

}

}

- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName       namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName {

if ([elementName isEqualToString:@"IncidentGetList"]) {

    [IncidentGetList setObject:Severity forKey:@"Severity"];

     [feeds addObject:[IncidentGetList copy]];
}

}

- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {

  if ([element isEqualToString:@"Severity"]) {
      [Severity appendString:string];
   } 


}



- (void)parserDidEndDocument:(NSXMLParser *)parser {

NSLog(@"Final Feed : %@",feeds);




 }