Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

mraheel

macrumors regular
Original poster
Apr 18, 2009
136
0
Hi guys, What I'm trying to accomplish might seem a little wierd, But, it serves the purpose of my app which is TabBarApplication
Heres what I want in Logic sequence..

USER Tabs TableCell in ViewA in TabItem1 -->
[Invokes a method in ViewB] --> [Gets information from SQL] --> View Shifts to TabItem2--> ViewB is in TabItem2 --> NavBar of ViewB is Pushed to a DetailView in TabBar2.

In other Words,
User taps TableCell in TabItem1's VIewA --> DetailView of ViewB of TabItem2 is visible!

So, i'm dealing with 2 controllers.

I made a method "initialiseDetailWithId: " in ViewBController that I access from ViewA. However, Invoking this method from ViewBController itself (where it resides) does the operation fine... which is just pushing the View.

When i try to invoke it from another ViewControllerA, theres no Push, although the Data is retrieved from SQL.


The Following is the code i'm using in ViewControllerA.h (where I'm calling a method)

Code:
@class ViewControllerB;
@interface SmartDDxViewController : UIViewController {

    IBOutlet UITableView *tableView;
    ViewControllerB *xViewController;


}
@property (nonatomic, retain) UITableView *tableView;
@property (nonatomic, retain) ViewControllerB *xViewController;

And this is what I use to invoke it..ViewControllerA.m
Code:
ViewControllerB *ddViewController = [[ViewControllerB alloc] init];
self.xViewController = ddViewController;        
[xViewController InitialiseDetailWithId:2 title:@"HEYA"];

Heres the InitialiseDetailWithId code: in ViewControllerB.m

Code:
-(void)InitialiseDetailWithId:(NSInteger)pkey title:(NSString *)tt{

    NSLog(@"InitialiseDetailC=========================================");
    AppDelegate *appDelegate = (Smart_DifferentialsAppDelegate *)[[UIApplication sharedApplication] delegate];
    [appDelegate GetConditionDetailsWithId:pkey];
    DDisViewController *viewController= [[DDisViewController alloc] initWithNibName:@"DetailView" bundle:nil];
    viewController.title = tt;
    [self.NavBar pushViewController:viewController animated:YES];
    //[tt release];
    [viewController release];
    viewController = nil;               
    [self say:@"HEYA"]; //this is ALERTVIEW box that displays HEYA
}

Where have I gone wrong here??
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.