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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.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 07-20-2009, 09:34 AM   #251 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by bigbad View Post
Now this is a stupid question no-doubt, but what is the advantage of having the IBOutlet (with the @property instead)?
Not stupid at all!

Apple now recommends placing the IBOutlet tag on the property declaration vs. the instance variable (ivar).

The Objective-C 2.0 Programming Language: Declared Properties

As I understand it, once we get to 64-bit land, variable storage is created at run-time vs. being set up at compile-time. That means those ivars can eventually go bye-bye! Apple may be advocating IBOutlet on property declarations now in anticipation of that. (Intrepid readers: Please confirm if I'm on the right track here!)
jdandrea is offline   Reply With Quote
Old 07-20-2009, 10:47 AM   #252 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

Quote:
Originally Posted by jdandrea View Post
As I understand it, once we get to 64-bit land, variable storage is created at run-time vs. being set up at compile-time. That means those ivars can eventually go bye-bye! Apple may be advocating IBOutlet on property declarations now in anticipation of that.
if I nod wisely can I convince you that I understand that (please don't spend any more time elaborating on that - I will come back to you on that in a year or so...)

one final (i promise) question - and this is really quick:

Code:
 cell.text = [[NSString alloc] initWithFormat:@"Description %i", indexPath.row];
returns Description 0, Description 1, Description 2 etc...

how do I make the first item start from 1 instead of 0?

Thanks again
bigbad is offline   Reply With Quote
Old 07-20-2009, 12:07 PM   #253 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by bigbad View Post
if I nod wisely can I convince you that I understand that
Well, when you put it that way ...

Quote:
Code:
cell.text = [[NSString alloc] initWithFormat:@"Description %i", indexPath.row];
returns Description 0, Description 1, Description 2 etc...

how do I make the first item start from 1 instead of 0?
Since your integer is coming from indexPath.row, just add one to it:

Code:
cell.text = [[NSString alloc] initWithFormat:@"Description %i", indexPath.row+1];
jdandrea is offline   Reply With Quote
Old 07-20-2009, 12:30 PM   #254 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

thanks... I feel very foolish...
bigbad is offline   Reply With Quote
Old 07-23-2009, 07:01 AM   #255 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default WebView not showing HTML

Hi guys...

alright so it is not over... this is slowly migrating away from the topic i suppose, but it is still the same project and I suspect it is related to not using IB... so I guess it is part of the overall theme of this thread... anyway...

I have tried to implement an UIWebView to display instructions.html. The code loads without warnings or errors but the webview remains blank... I am sure it is something simple. If you could help me out I would be grateful.

.h

Code:
#import <UIKit/UIKit.h>


@interface Case33ans  : UIViewController <UIWebViewDelegate> {
	UIWebView * webView;
	NSURL * instructionsURL;
	
}

@property (nonatomic,retain) UIWebView *webView;
@property (nonatomic,retain) NSURL * instructionsURL;

@end
.m

Code:
#import "Case33ans.h"


@implementation Case33ans
@synthesize webView;
@synthesize instructionsURL;

- (void)dealloc
{
	[webView release];
	[super dealloc];
}

- (void)viewDidLoad {
	webView.delegate = self;
	
	NSString *path;
	NSBundle *thisBundle = [NSBundle mainBundle];
	
	webView.backgroundColor = [UIColor colorWithRed:148.0/256.0 green:148.0/256.0 blue:148.0/256.0 alpha:0.0];
	webView.opaque = YES;
	path = [thisBundle pathForResource:@"instructions" ofType:@"html"];
	
	instructionsURL = [[NSURL alloc] initFileURLWithPath:path];
	[webView loadRequest:[NSURLRequest requestWithURL:instructionsURL]];
	
	[super viewDidLoad];
	
}

- (void)viewDidUnload
{
	
}

@end

instructions.html (in resources)

Code:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Instructions</title>
</head>

<body>
<p>Musculoskeletal    </p>
<p> sclerotic bone lesions: 40-66% [6]  </p>
<p> hyperostosis of inner table of calvaria  </p>
<p> periosteal new bone</p>
<p> scoliosis</p>
<p> bone cysts [5] </p>
</body>
</html>
Thanks again

- Frank
bigbad is offline   Reply With Quote
Old 07-23-2009, 08:52 AM   #256 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

ok so I fixed it... (or more to the point used the app documentation code to do so) - for anyone else wanting to do these same code is below

Everything works except that now I am getting

Code:
warning:'UIViewController' may not respond to '-viewDidUnload'
in the -(void)viewDidUnload

I have read around and either the fixes posted don't apply or (and this is probably more likely) I just don't get it...

the app seems to work though...


h.
Code:
#import <UIKit/UIKit.h>

@interface Case33ans : UIViewController <UITextFieldDelegate, UIWebViewDelegate>
{
	UIWebView *myWebView;
}

@property (nonatomic, retain) UIWebView	*myWebView;

@end

m.
Code:
#import "Case33ans.h"


@implementation Case33ans
@synthesize myWebView;

- (void)dealloc
{
	myWebView.delegate = nil;
	[myWebView release];
	
	[super dealloc];
}

- (void)viewDidLoad
{
	[super viewDidLoad];
	
	NSString *path;
	NSBundle *thisBundle = [NSBundle mainBundle];
	NSURL *instructionsURL;
	
	self.title = NSLocalizedString(@" ", @"");
	
	CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
	self.myWebView = [[[UIWebView alloc] initWithFrame:webFrame] autorelease];
	self.myWebView.backgroundColor = [UIColor whiteColor];
	self.myWebView.scalesPageToFit = YES;
	self.myWebView.autoresizingMask = (UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight);
	self.myWebView.delegate = self;
	[self.view addSubview: self.myWebView];
	
	path = [thisBundle pathForResource:@"Case33ans" ofType:@"html"];
	
	instructionsURL = [[NSURL alloc] initFileURLWithPath:path];
    [myWebView loadRequest:[NSURLRequest requestWithURL:instructionsURL]];
	
	

}


- (void)viewDidUnload
{
	[super viewDidUnload];
	
	// release and set to nil
	self.myWebView = nil;
}


#pragma mark -
#pragma mark UIViewController delegate methods

- (void)viewWillAppear:(BOOL)animated
{
	self.myWebView.delegate = self;	// setup the delegate as the web view is shown
}

- (void)viewWillDisappear:(BOOL)animated
{
    [self.myWebView stopLoading];	// in case the web view is still loading its content
	self.myWebView.delegate = nil;	// disconnect the delegate as the webview is hidden
	[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
	// we support rotation in this view controller
	return YES;
}

// this helps dismiss the keyboard when the "Done" button is clicked
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
	[textField resignFirstResponder];
	[self.myWebView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[textField text]]]];
	
	return YES;
}


#pragma mark -
#pragma mark UIWebViewDelegate

- (void)webViewDidStartLoad:(UIWebView *)webView
{
	// starting the load, show the activity indicator in the status bar
	[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)webView
{
	// finished loading, hide the activity indicator in the status bar
	[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
}

- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
{
	// load error, hide the activity indicator in the status bar
	[UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
	
	// report the error inside the webview
	NSString* errorString = [NSString stringWithFormat:
							 @"<html><center><font size=+5 color='red'>An error occurred:<br>%@</font></center></html>",
							 error.localizedDescription];
	[self.myWebView loadHTMLString:errorString baseURL:nil];
}

@end
thanks, - frank.
bigbad is offline   Reply With Quote
Old 07-26-2009, 07:16 PM   #257 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

-bump-

sorry guys... have been reading up, but still no luck.. still same warning... any ideas?

cheers, Frank.
bigbad is offline   Reply With Quote
Old 07-27-2009, 02:12 PM   #258 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Greetings!

Quote:
Originally Posted by bigbad View Post
-bump-

sorry guys... have been reading up, but still no luck.. still same warning... any ideas?

cheers, Frank.
viewDidUnload is available in iPhone OS 3.0b and later. I believe you might have been compiling this under 2.x though (?).
jdandrea is offline   Reply With Quote
Old 07-27-2009, 03:50 PM   #259 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

Hi jdandrea

Quote:
Originally Posted by jdandrea View Post
viewDidUnload is available in iPhone OS 3.0b and later. I believe you might have been compiling this under 2.x though (?).
yep that was the one... doh ! don't remember changing it back from3.0...

Of course now I am plagued by dozens of new warnings!

Code:
cell.text = [[NSString alloc] initWithFormat:@"Case %i", indexPath.row+1];

Code:
if ([[[myTableView cellForRowAtIndexPath:indexPath] text] isEqualToString:@"Case 1"])
I can get the warnings to vanish by replacing (in the first line)

cell.text with cell.textLabel.text


and in the second line by replacing line with:

Code:
if ([[[myTableView cellForRowAtIndexPath:indexPath] textLabel] isEqual:@"Case 1"])
The problem is that it stops working

So my question is: is them much/any harm in leaving the depreciated 'text' in there?

Thanks again...F

Last edited by bigbad; 07-27-2009 at 03:56 PM.
bigbad is offline   Reply With Quote
Old 07-27-2009, 04:42 PM   #260 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by bigbad View Post
Code:
if ([[[myTableView cellForRowAtIndexPath:indexPath] textLabel] isEqual:@"Case 1"])
Use [myTableView cellForRowAtIndexPath:indexPath].textLabel.text

That gives you the equivalent of cell.textLabel.text from earlier.

(What happened: Apple tidied these bits up in 3.0, so textLabel is now available as an honest-to-goodness UILabel object. That means you now get to ascribe whatever changes you want to it, vs. just setting the text.)
jdandrea is offline   Reply With Quote
Old 07-27-2009, 07:01 PM   #261 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 29
Default

thanks jdandrea... i get it... you are (as always) a champ...
bigbad is offline   Reply With Quote
Old 07-28-2009, 05:43 AM   #262 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 181
Smile A default view other than the tab views??

Is it possible to create a tab-bar based application which will be like this,ie,
When the application loads it will be showing a view with some general details, and then when we click on each tab(3tabs), a different view is shown.

OR

A normal view based application with a tab-bar, which will be like i said earlier, having 3 different views for the 3 tabs other than the normal view??

I have been trying to develop one like this 4m ydy,but facing a lot of problems. Can you help me out,please?

Like the first video in this page, http://www.fyimobileware.com/
wolverine is offline   Reply With Quote
Old 07-28-2009, 06:56 AM   #263 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Greetings!

Quote:
Originally Posted by wolverine View Post
Is it possible to create a tab-bar based application which will be like this,ie,
When the application loads it will be showing a view with some general details, and then when we click on each tab(3tabs), a different view is shown.

OR

A normal view based application with a tab-bar, which will be like i said earlier, having 3 different views for the 3 tabs other than the normal view??

I have been trying to develop one like this 4m ydy,but facing a lot of problems. Can you help me out,please?

Like the first video in this page, http://www.fyimobileware.com/
It sounds like you want to make a tab bar application, but with a different initial view than you would normally see by picking any of the tabs, like a splash view that only gets shown one time. Is that the idea?

The first video shows a few different apps, so I'm not sure which one you're referring to. Is there a specific app you've seen that does what you're looking for? That will help clarify with a concrete example.
jdandrea is offline   Reply With Quote
Old 07-28-2009, 07:06 AM   #264 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 181
Smile

Quote:
Originally Posted by jdandrea View Post
Greetings!



It sounds like you want to make a tab bar application, but with a different initial view than you would normally see by picking any of the tabs, like a splash view that only gets shown one time. Is that the idea?

The first video shows a few different apps, so I'm not sure which one you're referring to. Is there a specific app you've seen that does what you're looking for? That will help clarify with a concrete example.
Actually the application that i meant is iExpenselt. In that app, when it loads it shows a main view. And a tab-bar. When we click on any tab of the tab-bar it navigates(yes, not like normal tab-views) to a different view, with the name of the main view on the left top. When we click on it, we gets the main view. And 4 each tab, this provision is available.

If you just look at any video of iExpenselt app, u can see that.
I want to know how they did it. Plz help,thanks for ur reply.
wolverine is offline   Reply With Quote
Old 07-28-2009, 08:00 AM   #265 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by wolverine View Post
In (iExpenselt), when it loads it shows a main view. And a tab-bar. When we click on any tab of the tab-bar it navigates(yes, not like normal tab-views) to a different view, with the name of the main view on the left top.
Ahh, I see.

Disclaimer: Not owning iExpenseIt, I'm not sure what the actual, complete animation effect and user experience is. (Sometimes they edit things in the ads.) Still, let's see if I can draw a bead on this.

So, two things I notice. First, there's no tab selection - no telltale blue highlight. The initial view is some kind of "home view" per se. Now, we know how they get back to it when picking "New" (or at least we know that they provide a way back), but does this happen with every tab bar item selection? I admit, that's a use of the tab bar I have not seen before! (I could also just be leading a sheltered iPhone life, who knows. <grin>)

Also, when you pick "New" the tab bar goes away. That almost looks like a modal view controller to me, but perhaps it isn't. Normally, when I want to drill down to a lower view and hide the tab bar, I set the new UIViewController's hidesBottomBarWhenPushed property to YES. In this case they're not drilling down at all - they're arriving straight from the tab bar selection.

If we accept that they're using the tab bar in an unexpected way, perhaps their view controller sets hidesBottomBarWhenPushed to YES - for instance, in viewDidLoad if being initialized from a nib. This sends you down a one-way path into the view. No more tab bar! To complete the effect, they may set a left button (with the arrowhead) that heads back to that "home" view and deselects any tab bar selection.

I wonder if the home view is actually a tab bar item selection that is hidden from view? (If that's even possible. You never know. That could explain the unselected tab bar item appearance.)
jdandrea is offline   Reply With Quote
Old 07-28-2009, 08:16 AM   #266 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 181
Smile

Quote:
Originally Posted by jdandrea View Post
Ahh, I see.
I wonder if the home view is actually a tab bar item selection that is hidden from view? (If that's even possible. You never know. That could explain the unselected tab bar item appearance.)
Ya, i too tgt like that. Maybe the 1st tab bar item responsible for the home view is being hidden, dont know. Was trying to check that out. wonder in which way it wil go. , havent done anything of that sort.

And if u want to check that out, there is a free lite version of that app in iTunes
wolverine is offline   Reply With Quote
Old 07-28-2009, 08:31 AM   #267 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by wolverine View Post
Ya, i too tgt like that. Maybe the 1st tab bar item responsible for the home view is being hidden, dont know. Was trying to check that out. wonder in which way it wil go. , havent done anything of that sort.

And if u want to check that out, there is a free lite version of that app in iTunes
Thanks! I'll go tire-kick it a bit.

UITabBar does have a selectedItem property, which it appears can be set to nil without any ill effects. Perhaps ALL of the tab bar items use this same default view controller (defined as a singleton? possibly) in conjunction with deselecting items.
jdandrea is offline   Reply With Quote
Old 07-28-2009, 08:33 AM   #268 (permalink)
iOS Developer
 
chaseacton's Avatar
 
Join Date: Feb 2009
Location: United States
Posts: 532
Send a message via AIM to chaseacton Send a message via Skype™ to chaseacton
Default

Quote:
Originally Posted by jdandrea View Post
Thanks! I'll go tire-kick it a bit.

UITabBar does have a selectedItem property, which it appears can be set to nil without any ill effects. Perhaps ALL of the tab bar items use this same default view controller (defined as a singleton? possibly) in conjunction with deselecting items.
Could you please post the xcode project of what you have so far
chaseacton is offline   Reply With Quote
Old 07-28-2009, 08:44 AM   #269 (permalink)
Registered Member
 
Join Date: May 2009
Posts: 78
Default

Quote:
Originally Posted by chaseacton View Post
Could you please post the xcode project of what you have so far
I don't have an Xcode project for this. (This may have been intended for wolverine to respond to.)
jdandrea is offline   Reply With Quote
Old 07-29-2009, 12:16 AM   #270 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 2
Question movieplayer not playing from tableview

I'm a newbie with iPhone dev and I've been developing a simple application on TV Schedule Guide that could play short video trailers. I applied what OneTeamDev's code on implimenting tab bar controller programatically and it works like a charm. so my application has a tab bar controller that displays a list of tv show scheds in a tableview. each show should play a trailer when tap but apparently it ain't. i'm using a streamlined code from Apple's movieplayer sample code and it's already been taking me ages to make it work. Perhaps, you guys could throw me some help.

here's my AppDelegate code:

TVSchedAppDelegate.h

Code:
#import <UIKit/UIKit.h>
#import "AllShowsViewController.h"

@class MovieViewController;

@interface TVSchedAppDelegate : NSObject <UIApplicationDelegate> {
    IBOutlet UIWindow *window;
    UITabBarController *tabBarController;
    AllShowsButtonController *allShowsViewController;
    UITableViewController *mySecondTableViewController;
	MovieViewController *mViewController;
	
		
}

-(void)applicationDidFinishLaunching:(UIApplication *)application;
-(void)dealloc;

@property (nonatomic, retain) MovieViewController *mViewController;
@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) UITabBarController *tabBarController;
@property (nonatomic, retain) UITableViewController *allShowsViewController;
@property (nonatomic, retain) UITableViewController *mySecondTableViewController;

@end
TVSchedAppDelegate.m

Code:
#import "TVSchedAppDelegate.h"
#import "MovieViewController.h"


@implementation TVSchedAppDelegate

@synthesize window, allShowsViewController, mySecondTableViewController, tabBarController;
@synthesize mViewController;


- (void)applicationDidFinishLaunching:(UIApplication *)application {    
	
    tabBarController = [[UITabBarController alloc] init];          // creates your tab bar so you can add everything else to it
	
	allShowsViewController = [[AllShowsButtonController alloc] init];               // creates your table view - this should be a UIViewController with a table view in it, or UITableViewController
	UINavigationController *tableNavController = [[[UINavigationController alloc] initWithRootViewController:allShowsViewController] autorelease];
	allShowsViewController.title=@"TV Shows";
	tableNavController.tabBarItem.image = [UIImage imageNamed:@"home_20.png"];
	[allShowsViewController release];     
	
	// creates your table view's navigation controller, then adds the view controller you made. Note I then let go of the view controller as the navigation controller now holds onto it for me. This saves memory.
	
	mySecondTableViewController = [[UITableViewController alloc] init];   
	UINavigationController *table2NavController = [[[UINavigationController alloc] initWithRootViewController:mySecondTableViewController] autorelease];
	[mySecondTableViewController release];                                                    // does exactly the same as the first round, but for your second tab at the bottom of the bar.
	
	tabBarController.viewControllers = [NSArray arrayWithObjects:tableNavController, table2NavController, nil]; //add both of your navigation controllers to the tab bar. You can put as many controllers on as you like, but they will turn into the more button like in the iPod program.
	
	[window addSubview:tabBarController.view];                                              // adds the tab bar's view property to the window
	[window addSubview:mViewController.view];
	[window makeKeyAndVisible]; 
}

- (void)dealloc {
    [tabBarController release];
	[mViewController release];
	[window release];
	[super dealloc];
}


@end
AllShowsViewController.h
Code:
#import <UIKit/UIKit.h>
#import "MovieViewController.h"
#define kShowValueTag 1
#define kScheduleValueTag 2
#define kRatingTag 3


@interface AllShowsButtonController : UITableViewController  <UITableViewDelegate, UITableViewDataSource>
{
	NSArray *shows;
	UIImage *rowImage;
	
	MovieViewController *mViewController;
	
}

@property (nonatomic, retain) NSArray *shows;
@property (nonatomic, retain) UIImage *rowImage;
@property (nonatomic, retain) MovieViewController *mViewController;
@end
AllShowsViewController.m
Code:
#import "AllShowsViewController.h"
#import "TVSchedAppDelegate.h"

@implementation AllShowsButtonController
@synthesize shows, mViewController, rowImage;


- (void)viewDidLoad {
	
	NSArray *array = [[NSArray alloc] initWithObjects:@"TV Show 1",
					  @"TV Show 2", @"TV Show 3", @"TV Show 4", @"TV Show 5", @"TV Show 6", @"TV Show 6", nil];
	
	AllShowsButtonController *allShowsButtonController = [[AllShowsButtonController alloc] initWithStyle:UITableViewStylePlain];
	[allShowsButtonController release];
	
	self.shows = array;
	
	[array release];
	
    [super viewDidLoad];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}

#pragma mark Table view methods

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


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [self.shows count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *AllShowsButtonCellIdentifer = @"AllShowsButtonCellIdentifer";
	
	UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:AllShowsButtonCellIdentifer];
	if (cell == nil) {
		cell = [[[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:AllShowsButtonCellIdentifer] autorelease];
		
		// Line row for Show's Name
		UILabel *showValue = [[UILabel alloc] initWithFrame:showValueRect];
		showValue.tag = kShowValueTag;
		[cell.contentView addSubview:showValue];
		[showValue release];
	}
	
	//Configure cell
	NSUInteger row = [indexPath row];
	
	//Configure line row for Show
	NSString *rowString = [shows objectAtIndex:row];
	UILabel *show = (UILabel *)[cell.contentView viewWithTag:kShowValueTag];
	show.text = rowString;
	[rowString release];

    return cell;
}

#pragma mark -
#pragma mark Table View Delegate Methods

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
	[mViewController playMovie:self];
}

- (void)dealloc {
    [super dealloc];
}


@end
wizowsky is offline   Reply With Quote
Old 07-29-2009, 12:06 PM   #271 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 7
Thumbs up

Quote:
Originally Posted by indiekiduk View Post
You probably haven't set the class name of the table controller in IB. Click the table controller, click the 4th tab in the inspector and type in MyTableViewController or what ever you called it (If it doesn't autocomplete its wrong, it looks up the .h file).
Note:
Table data is usually declared in the table controller. You can create it in the viewDidLoad method.
Great Thread! Healthy debate over pure code vs. IDE tools.
I am more interested in using the IDE tools; therefore I have a conceptual question for clarification:
Is it required/recommended for MainWindow.xib to be the root of all UI Controllers/Views?
e.g. I have been working on an app where the TabBarController is in the MainWindow.xib, but one of the tabs is to be a Navigation based table view and it's nib contains the NavigationController, Table View etc... and an exception is thrown when I try to load that view.
I am hoping that by restructing the MainWindow.xib to govern all UI in a hierarchical fashion will resolve these matters and I can get on with the more complex aspects of the app.
I would just like to know that doing this restructure is the correct path to follow. I have been piecing together a larger app from smaller samples...

btw indiekiduk, is your demo video posted elsewhere? I tried to download from your original link, but the file was invalid...

Thanks in advance,
EB
echobravo is offline   Reply With Quote
Old 07-30-2009, 05:53 AM   #272 (permalink)
Registered Member
 
Join Date: Jul 2009
Posts: 30
Default

Quote:
Originally Posted by javid.alimohideen View Post
Hey there,
Your should have ViewController for every tab that you need. So if you want five tab bar items you need 5 view controllers and 5 nib files. Say, ViewOne.xib, ViewTwo.xib and so on..
All the nib files need to have their file owner as the ViewControllers. So ViewOne will have ViewOneController as its file owner. Add a tab bar and a tab item to each one of the view in IB.
And in your AppDelegate, you would initialize your view controller from the nib and add it to the tab bar controllers in the MainWindow.xib nib file

Code:
ViewOneController *viewOneController = [[[ViewOneController] alloc] initWithNibName:@"ViewOne" bundle nil];
//Repeat the above for all the other four views

tabBarController.viewControllers = [NSArray arrayWithObjects: viewOneController, ViewTwoController,......, nil];
If you still have problems, can you zip your folder and post it online, So I can take a look at it. You can strip all the other code that you would like to keep it confidential..

I can take a look at it later tonite and get back to you.

Javid
Hi
I read your answer and follow the same process and got able to load 5 view with 5 tab bar item in applicationDidFinishLaunching. On each tab item click it loads related view.There are some button control in my first view ,table in 2nd view and etc.
I want to load a new view on button control click action in side first view and new loaded view add new tab bar with 4 tab bar item. I mean replace or hide previous 5 item tab bar control. also want to add nav bar.
I am trying but not able to do it.
I am creating tab bar programmatically.

I would appriceate your help
thanks
subodh kumar is offline   Reply With Quote
Old 07-30-2009, 06:21 AM   #273 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 181
Smile

Quote:
Originally Posted by jdandrea View Post
I don't have an Xcode project for this. (This may have been intended for wolverine to respond to.)
I havent done any code into it. Was doing all that from the user interface itself.
wolverine is offline   Reply With Quote
Old 07-30-2009, 07:35 AM   #274 (permalink)
Registered Member
 
Join Date: Jun 2009
Posts: 181
Smile How to refresh a page?

In the application that i am doing now,
1. In the main page it lists all the persons in database.
2. I have given a + button on the right top of that page.
3. When i click on that button, It goes into a page from where i can add a new record.
4. When i press cancel it goes to previous page but since the page isn't refreshed i cant see the record that i added recently.
5 But if i restart the application i can see that record.

I wanted to know how to make that main page refreshed so that i will be able to see the new record?
wolverine is offline   Reply With Quote
Old 08-07-2009, 04:08 PM   #275 (permalink)
iPhone Developer
 
Join Date: Jan 2009
Location: India , Pune
Posts: 44
Send a message via Skype™ to ameya
Thumbs up

Hi,

I got the UIWebView in UITableViewCell view problem solved by using the three20 UI framework(joehewitt's three20 at master - GitHub). You can use the web content hyperlinek as click able text in labels also , you can estimate the total hight of label ,calculating the text that will fit in. UI looks like Twitter iPhone application UI. Only got to create some more delegate. For any help plz be free to contact me.
__________________
Sr Software Programmer

Solutions to problems
ameya 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: 251
19 members and 232 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, Dani77, DarkAn, HemiMG, iDifferent, IphoneSdk, jakerocheleau, JasonR, MACralik, NSeven, prchn4christ, Rudy
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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