Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 08-10-2010, 01:10 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 3
kforkarim is on a distinguished road
Default Accessing TableView

I am developing an application and my application is based upon viewcontroller from rootcontroller, however one step ahead at viewcontroller, I have a button that I need to click that can take me to a tableview to access xml parsing.

I have initialized a tableview content through a new file and created a xib file in which i have inserted the table view controller.

Now my concern is how do I call that tableview exactly by button press?

My button press code looks like this,

-(IBOutlet)buttonPressedid)sender {

}

I did tried printing some text, therefore the button press works fine, since I am a newbie in this, I am still searching for this content to see if anyone would know this?

The block diagram is like this

Main window -> View controller (got 6 buttons) -> 1st button click (New table view)

I have reached till second stage, since my main window is directing to view controller, but I am having difficulties of connecting a new table view via the button press.

Thanks
kforkarim is offline   Reply With Quote
Old 08-10-2010, 01:54 PM   #2 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 3
kforkarim is on a distinguished road
Default

Anyways I got the answer, I knew I had to declare the tablecontroller, but didnt know how, but anyways now I got it right, below is the declaration within the buttonpressed,


tblevent = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped];

[[self view] addSubview:tblevent];

Incase someone might need this for later use.
kforkarim is offline   Reply With Quote
Old 08-10-2010, 02:30 PM   #3 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 3
kforkarim is on a distinguished road
Default

I have another issue going on right now though, I do happen to get the UITableView, but now the one I have made the file for. I get this error when I call the function from such as

expected identifier or '(' before '=' token

My code is as follows:



@interface try3ViewController : UIViewController {

IBOutlet UIButton *button1;
IBOutlet UIButton *button2;
IBOutlet UIButton *button3;
IBOutlet UIButton *button4;
IBOutlet UIButton *button5;
IBOutlet UIButton *button6;
// tblevent *events1;
IBOutlet UITableView *tblevent;
}

@property (nonatomic, retain) UIButton *button1;
@property (nonatomic, retain) UIButton *button2;
@property (nonatomic, retain) UIButton *button3;
@property (nonatomic, retain) UIButton *button4;
@property (nonatomic, retain) UIButton *button5;
@property (nonatomic, retain) UIButton *button6;
@property (nonatomic, retain) UITableView *tblevent;

-(IBAction)buttonPressedid)sender;


//----------------------------------------


@implementation try3ViewController

@synthesize button1;
@synthesize button2;
@synthesize button3;
@synthesize button4;
@synthesize button5;
@synthesize button6;
@synthesize tblevent;


-(IBOutlet)buttonPressedid)sender {

tblevent = [[UITableView alloc] initWithFrame:[[self view] bounds] style:UITableViewStyleGrouped];

[[self view] addSubview:tblevent];
}

Any recommendation here will be helpful.

Thanks
kforkarim is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On



» Advertisements
» Online Users: 349
9 members and 340 guests
bignoggins, Chickenrig, firecall, iNet, linkmx, michaelhansen, Objective Zero, PlutoPrime, stanny
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,118
Posts: 402,894
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:39 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0