New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
iOS Development Discussion on developing apps for the iOS platform.

Problem while doing integration


Post Reply New Thread Subscribe

 
Thread Tools
sagarshivam

 
Member Since: Jun 03, 2011
Posts: 54
sagarshivam is on a distinguished road

sagarshivam is offline
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.
QUOTE Thanks
sagarshivam

 
Member Since: Jun 03, 2011
Posts: 54
sagarshivam is on a distinguished road

sagarshivam is offline
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)
QUOTE Thanks

Post Reply New Thread Subscribe


« Button Looping and me! | Deploy iPhone app without developer account »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Problem with copy and paste that does not paste the more recent copy? pcortez Switcher Hangout 22 08-01-2012 01:28 PM
diagnosing kernel task/CPU problem on Macbook Air nick_harambee Apple Notebooks 9 08-20-2011 07:20 AM
could this be an OS problem? Anyuta OS X - Operating System 0 11-22-2010 04:50 PM
Strange iweb problem Anyuta Web Design and Hosting 0 09-27-2010 12:46 PM
2009 MBP - Possible Trackpad Problem tricky10 Apple Notebooks 6 09-09-2010 07:01 AM

All times are GMT -4. The time now is 03:26 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?