Results 1 to 2 of 2
  1. #1


    Member Since
    Jun 03, 2011
    Posts
    54
    Problem while doing integration
    Dear All

    Being a newbie, I divided my application into small separate application and they all worked fine. now when I am trying to integrate, problem arises.

    I am trying to post some part of the project's code where I am facing the real problem. May be my fundamentals are wrong. But plz help, I am ready to work on it.

    SimpleTableViewAppDelegate.h
    Code:
    @class RootViewController;
    @class DetailViewController;
    
    @interface SimpleTableViewAppDelegate: NSObject <UIApplicationDelegate> {
     
        UIWindow *window;
        UISplitViewController *splitViewController;
        RootViewController *rootViewController;
        DetailViewController *detailViewController;
        UINavigationController *rootNav;
    }
    
    @property (nonatomic, retain) IBOutlet UIWindow *window;
    @property (nonatomic, retain) IBOutlet UISplitViewController *splitViewController;
    @property (nonatomic, retain) IBOutlet RootViewController *rootViewController;
    @property (nonatomic, retain) IBOutlet DetailViewController *detailViewController;
    @property (nonatomic, retain) IBOutlet UINavigationController *rootNav;
    
    @end

    SimpleTableViewAppDelegate.m
    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    
    rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain];
    rootNav=[[UINavigationController alloc]initWithRootViewController:rootViewController];
    splitViewController.viewControllers=[NSArray arrayWithObjects:rootNav,detailViewController,nil];
    splitViewController.delegate=detailViewController;
    [window addSubview:splitViewController.view];
     XML_Parser *xmlp =[[XML_Parser alloc] init];
    [xmlp xmlparse];
    [window makeKeyAndVisible];
    	
    }
    RootViewCOntroller.m

    Code:
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *MyIdentifier = @"MyIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    	if (cell == nil) {
    		cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:MyIdentifier] autorelease];
    	}
    	
    	// Set up the cell.
    	NSString *timeZoneName = [timeZoneNames     objectAtIndex:indexPath.row]; // timeZoneNames is defined in this class.
    	cell.textLabel.text = timeZoneName;
    	cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton; 	
    	return cell;
    }
    
    
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    SubTable *r1 = [[SubTable alloc] initWithStyle:UITableViewStylePlain];
    r1.timevalue = timeZoneNames; // timevalue is an array in SuBTable class
    [self.navigationController pushViewController:r1 animated:YES];
    [r1 release];
    
    }

    XML_Parse.m
    Code:
    @interface XML_Parse ()
    - (void) xmlparse;
    - (void) traverseElement:(TBXMLElement *)element;
    - (void) list_of_sub_projects:(NSMutableArray *)list_array;
    @end
    
    @implementation XML_Parse
    @synthesize data_array,sub_project_name,dict_storage;
    @synthesize file_array,sub_project_array;
    
    - (void) xmlparse {
    	
    	NSString *xml_name = @"dv_prescribed_format.xml";
    	TBXML *tbxml = [[TBXML alloc] initWithXMLFile:xml_name];
    	TBXMLElement *root = tbxml.rootXMLElement;
    	data_array = [NSMutableArray array];
    	[data_array retain];
    	if (tbxml.rootXMLElement) {
    		data_array=[self traverseElement:root];
    		[tbxml release];
    	}
    	[self list_of_sub_projects:data_array];  //getting warning here //XML_Parse may not respond to list_of_sub_projects
    	
    	
    }
    
    
    - (void) traverseElement:(TBXMLElement *) element{
    	do {
    		
    	if ([[TBXML elementName:element] isEqualToString:@"subproject"]){
    	NSString *break_point=@"break";
    	[data_array addObject:break_point];
            TBXMLElement *sub_project_name_xml = [TBXML childElementNamed:@"subprojectname" parentElement:element];
    	NSString *detail1= [TBXML textForElement:sub_project_name_xml];
    			[data_array addObject:detail1] ;
    		}
    		
    	if (element->firstChild) 
    			[self traverseElement:element->firstChild];
    		
    	if ([[TBXML elementName:element] isEqualToString:@"docid"]) {
    	TBXMLElement *filename = [TBXML childElementNamed:@"Fname" parentElement:element];
    	NSString *detail = [TBXML textForElement:filename];
    	[data_array addObject:detail];
    			}
    	} while ((element = element->nextSibling));	
    	
    	
    }
    
    
    - (void) list_of_sub_projects:(NSMutableArray *) list_array {
    	dict_storage = [[NSMutableDictionary alloc] initWithCapacity:10];
    	file_array = [[NSMutableArray alloc] init];
    	sub_project_array = [[NSMutableArray alloc] init];
    	int j=0,temp=0,temp1,i=1;
    	while (i< [list_array count]) {
    		
    	if ([[list_array objectAtIndex:i] isEqualToString:@"break"]) 
    		{
    			temp1=temp;
    			temp=i;
    			for (j=temp1+2; j<temp; j++) {
    				[file_array addObject:[list_array objectAtIndex:j]];
    			}
    			sub_project_name = [list_array objectAtIndex:temp1+1];
    			[sub_project_array addObject:sub_project_name];
    			[dict_storage setObject:file_array forKey:sub_project_name];
    			[dict_storage allKeys];
    			[file_array removeAllObjects];
    			
    		}
    		i++;
    		
    	}	
    		
    }

    Queries:

    1. In split view, navigation controller is not visible. Only root view and detail view are visible (and so even after pushing object of SubTable class, its not visible.).

    2. I am trying to call 'xmlparse' method (which again invokes 2 nested methods) defined in XML_Parse class but Its not getting accessed from inside SimpleTableViewAppDelegate.m
    (Getting warning as:"warning: 'XML_Parse' may not respond to '-xmlparse' ")


    XMLparsing code is correct as it is working good when tested separately.

  2. #2


    Member Since
    Jun 03, 2011
    Posts
    54
    I am able to solve the second query..still no idea how to implement uinavigatiocontroller in root view controller of split view pane.

    SimpleTableViewAppDelegate.m is :

    Code:
    - (void)applicationDidFinishLaunching:(UIApplication *)application {
    
    rootViewController = [[RootViewController alloc] initWithStyle:UITableViewStylePlain];
    rootNav=[[UINavigationController alloc]initWithRootViewController:rootViewController];
    splitViewController.viewControllers=[NSArray arrayWithObjects:rootNav,detailViewController,nil];
    splitViewController.delegate=detailViewController;
    [window addSubview:splitViewController.view];
    [window makeKeyAndVisible];
    	
    }

    On tapping the disclosure button in root view, next view is not visible. (next view is uitableview)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. PS CS4 Integration with iPhoto - Thumbnail Problem
    By chrismac in forum Images, Graphic Design, and Digital Photography
    Replies: 1
    Last Post: 07-09-2009, 03:21 PM
  2. Tomcat integration
    By nwimac in forum OS X - Operating System
    Replies: 0
    Last Post: 07-12-2008, 01:29 PM
  3. 1Password integration with Quicksilver
    By m021478 in forum OS X - Apps and Games
    Replies: 0
    Last Post: 02-28-2008, 05:11 AM
  4. Integration with Google?
    By walmartconnect in forum OS X - Operating System
    Replies: 2
    Last Post: 03-19-2007, 09:55 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •