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

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I used Ray Wenderlich's tutorial to build a simple RSS reader iPhone located here. I would like to make this a universal App so that it could work with the iPad. When I upgrade target to universal, the webview that shows the articles fills up the entire screen, but the tableview seems off. There are only 10 articles on the RSS feed, so it ends up only taking up half the iPad screen. Is there a way I can update this so that on the iPad, the tableview rows are bigger? Here is what it looks like now.
ipadimage.png
 
Last edited:

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
In order to make a table view fill the screen you need to set the springs and struts correctly. You should have flexible width and height turned on.

What do you really mean by bigger?

BTW, I object to you posting this same question on two forums at the same time.
 
Last edited:

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
In order to make a table view fill the screen you need to set the springs and struts correctly. You should have flexible width and height turned on.

What do you really mean by bigger?

BTW, I object to you posting this same question on two forums at the same time.

I want the tableview to only have those 10 rows, so that the real estate screen of the ipad isn't wasted by several blank rows.

Is there some rule to posting question on 2 completely different forums? I'm trying to get a quicker response.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
You can set the rowHeight property of the table view to whatever you like. But your table view cells will also have to adjust to their new height or it won't look right.

Many consider it rude to post the same question to multiple forums at the same time. Those who answer questions make some effort and take some time to do so. It's not much fun to spend time answering someone's question only to find that the question has already been answered on another forum. IMO, it's reasonable to ask a question a second time on another forum if 24 hrs passes and there is no answer.
 

Shawnpk

macrumors 6502
Jan 13, 2011
350
0
Los Angeles, CA
It might look better to have the tableView in a popover and then show the full feed full screen in the detail view after a row is selected.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
It might look better to have the tableView in a popover and then show the full feed full screen in the detail view after a row is selected.

I have limited experience doing popovercontrollers. Considering the complexity of the TableView parsing the RSS Feed, is this something that the popover could do?
 

Shawnpk

macrumors 6502
Jan 13, 2011
350
0
Los Angeles, CA
I have limited experience doing popovercontrollers. Considering the complexity of the TableView parsing the RSS Feed, is this something that the popover could do?

Usually, a tableview on an iPhone uses the entire screen, but since the iPad screen is larger, tableviews are placed in a popover so as not to take up the entire screen. You would have a rootViewController (for the tableview) and a detailviewcontroller (that would take up the full screen when a cell in the popover is chosen). So the code you wrote for the iPhone tableview would be written in the rootViewController of the iPad app. There are plenty of books on iPad programming that can explain this much better then me.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
Since I already had the TableView set up I looked up a tutorial on popovercontrollers and had the popovercontroller show the same as the TableView I already set up. I run this in the simulator and when I click the popover button, the tableview shows up, with all of the articles, but when I select one, it highlights it but doesn't do anything. The app doesn't freeze, it just doesn't do anything.
RootViewController.h
Code:
//
//  RootViewController.h
//  RSSFun
//
//  Created by Ray Wenderlich on 1/24/11.
//  Copyright 2011 Ray Wenderlich. All rights reserved.
//

#import <UIKit/UIKit.h>
@protocol RootViewControllerDelegate <NSObject>

-(void)didTap:(NSString *)string;

@end
id delegate;
@class WebViewController;
@class WebViewController2;

@interface RootViewController : UITableViewController {
    NSOperationQueue *_queue;
    NSArray *_feeds;
    NSMutableArray *_allEntries;
    WebViewController *_webViewController;
	UIActivityIndicatorView *activity;
	WebViewController2 *_webViewController2;
	
}
@property (nonatomic, assign) id<RootViewControllerDelegate> delegate;
@property (retain) NSOperationQueue *queue;
@property (retain) NSArray *feeds;
@property (retain) NSMutableArray *allEntries;
@property (retain) WebViewController *webViewController;
@property (retain) UIActivityIndicatorView *activity;
@property (retain) WebViewController2 *webViewController2;
@end
RootViewController.m
Code:
//
//  RootViewController.m
//  RSSFun
//
//  Created by Ray Wenderlich on 1/24/11.
//  Copyright 2011 Ray Wenderlich. All rights reserved.
//

#import "RootViewController.h"
#import "RSSEntry.h"
#import "ASIHTTPRequest.h"
#import "GDataXMLNode.h"
#import "GDataXMLElement-Extras.h"
#import "NSDate+InternetDateTime.h"
#import "NSArray+Extras.h"
#import "WebViewController.h"
#import "WebViewController2.h"

@implementation RootViewController
@synthesize allEntries = _allEntries;
@synthesize feeds = _feeds;
@synthesize queue = _queue;
@synthesize webViewController = _webViewController;
@synthesize activity;
@synthesize webViewController2 = _webViewController2;
@synthesize delegate;

#pragma mark -
#pragma mark View lifecycle

- (void)refresh {
    
    for (NSString *feed in _feeds) {
        NSURL *url = [NSURL URLWithString:feed];
        ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url];
        [request setDelegate:self];
        [_queue addOperation:request];
    }
    
}

- (void)addRows {
    
    RSSEntry *entry1 = [[[RSSEntry alloc] initWithBlogTitle:@"1" 
                                               articleTitle:@"1" 
                                                 articleUrl:@"1" 
                                                articleDate:[NSDate date]] autorelease];
    RSSEntry *entry2 = [[[RSSEntry alloc] initWithBlogTitle:@"2" 
                                               articleTitle:@"2" 
                                                 articleUrl:@"2" 
                                                articleDate:[NSDate date]] autorelease];
    RSSEntry *entry3 = [[[RSSEntry alloc] initWithBlogTitle:@"3" 
                                               articleTitle:@"3" 
                                                 articleUrl:@"3" 
                                                articleDate:[NSDate date]] autorelease];
    
    
    [_allEntries insertObject:entry1 atIndex:0];
    [_allEntries insertObject:entry2 atIndex:0];
    [_allEntries insertObject:entry3 atIndex:0];
        
}

- (void)viewDidLoad {
    [super viewDidLoad];    
	[activity startAnimating];
    self.title = @"Thoughts From The Mound";
    self.allEntries = [NSMutableArray array];
    self.queue = [[[NSOperationQueue alloc] init] autorelease];
    self.feeds = [NSArray arrayWithObjects:@"http://thejenkinsinstitute.com/category/thoughts-from-the-mound/feed/",
                  nil];    
    [self refresh];
}

- (void)parseRss:(GDataXMLElement *)rootElement entries:(NSMutableArray *)entries {
    
    NSArray *channels = [rootElement elementsForName:@"channel"];
    for (GDataXMLElement *channel in channels) {            
        
        NSString *blogTitle = [channel valueForChild:@"title"];                    
        
        NSArray *items = [channel elementsForName:@"item"];
        for (GDataXMLElement *item in items) {
            
            NSString *articleTitle = [item valueForChild:@"title"];
            NSString *articleUrl = [item valueForChild:@"link"];            
            NSString *articleDateString = [item valueForChild:@"pubDate"];        
            NSDate *articleDate = [NSDate dateFromInternetDateTimeString:articleDateString formatHint:DateFormatHintRFC822];
            
            RSSEntry *entry = [[[RSSEntry alloc] initWithBlogTitle:blogTitle 
                                                      articleTitle:articleTitle 
                                                        articleUrl:articleUrl 
                                                       articleDate:articleDate] autorelease];
            [entries addObject:entry];
            
        }      
    }
    
}

- (void)parseAtom:(GDataXMLElement *)rootElement entries:(NSMutableArray *)entries {
    
    NSString *blogTitle = [rootElement valueForChild:@"title"];                    
    
    NSArray *items = [rootElement elementsForName:@"entry"];
    for (GDataXMLElement *item in items) {
        
        NSString *articleTitle = [item valueForChild:@"title"];
        NSString *articleUrl = nil;
        NSArray *links = [item elementsForName:@"link"];        
        for(GDataXMLElement *link in links) {
            NSString *rel = [[link attributeForName:@"rel"] stringValue];
            NSString *type = [[link attributeForName:@"type"] stringValue]; 
            if ([rel compare:@"alternate"] == NSOrderedSame && 
                [type compare:@"text/html"] == NSOrderedSame) {
                articleUrl = [[link attributeForName:@"href"] stringValue];
            }
        }
        
        NSString *articleDateString = [item valueForChild:@"updated"];        
        NSDate *articleDate = [NSDate dateFromInternetDateTimeString:articleDateString formatHint:DateFormatHintRFC3339];
        
        RSSEntry *entry = [[[RSSEntry alloc] initWithBlogTitle:blogTitle 
                                                  articleTitle:articleTitle 
                                                    articleUrl:articleUrl 
                                                   articleDate:articleDate] autorelease];
        [entries addObject:entry];
        
    }      
    
}

- (void)parseFeed:(GDataXMLElement *)rootElement entries:(NSMutableArray *)entries {
    
    if ([rootElement.name compare:@"rss"] == NSOrderedSame) {
        [self parseRss:rootElement entries:entries];
    } else if ([rootElement.name compare:@"feed"] == NSOrderedSame) {                       
        [self parseAtom:rootElement entries:entries];
    } else {
        NSLog(@"Unsupported root element: %@", rootElement.name);
    }    
}

- (void)requestFinished:(ASIHTTPRequest *)request {
	
    [_queue addOperationWithBlock:^{
        
        NSError *error;
        GDataXMLDocument *doc = [[GDataXMLDocument alloc] initWithData:[request responseData] 
                                                               options:0 error:&error];
        if (doc == nil) { 
            NSLog(@"Failed to parse %@", request.url);
        } else {
            
            NSMutableArray *entries = [NSMutableArray array];
            [self parseFeed:doc.rootElement entries:entries];                
            
            [[NSOperationQueue mainQueue] addOperationWithBlock:^{
                
                for (RSSEntry *entry in entries) {
                    
                    int insertIdx = [_allEntries indexForInsertingObject:entry sortedUsingBlock:^(id a, id b) {
                        RSSEntry *entry1 = (RSSEntry *) a;
                        RSSEntry *entry2 = (RSSEntry *) b;
                        return [entry1.articleDate compare:entry2.articleDate];
                    }];

                    [_allEntries insertObject:entry atIndex:insertIdx];
                    [self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:[NSIndexPath indexPathForRow:insertIdx inSection:0]]
                                          withRowAnimation:UITableViewRowAnimationRight];
                    
                }                            
                
            }];
            
        }        
    }];
                                                             
}

- (void)requestFailed:(ASIHTTPRequest *)request {
    NSError *error = [request error];
    NSLog(@"Error: %@", error);
}


/*
- (void)viewWillAppear:(BOOL)animated {
    [super viewWillAppear:animated];
}
*/
/*
- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
}
*/
/*
- (void)viewWillDisappear:(BOOL)animated {
	[super viewWillDisappear:animated];
}
*/
/*
- (void)viewDidDisappear:(BOOL)animated {
	[super viewDidDisappear:animated];
}
*/

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
	
	if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
	{
		// The device is an iPad running iPhone 3.2 or later.
		return YES;
	}
	else
	{
		// The device is an iPhone or iPod touch.
		return YES;
	}
	
#else
	
	// iPhone simulator
	return NO;
	
#endif
}



#pragma mark -
#pragma mark Table view data source

// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}


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


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *CellIdentifier = @"Cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    }
    
    RSSEntry *entry = [_allEntries objectAtIndex:indexPath.row];

    NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelease];
    [dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
    [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
    NSString *articleDateString = [dateFormatter stringFromDate:entry.articleDate];

    cell.textLabel.text = entry.articleTitle;        
    cell.detailTextLabel.text = [NSString stringWithFormat:@"%@ - %@", articleDateString, entry.blogTitle];
	
    return cell;
}


/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the specified item to be editable.
    return YES;
}
*/


/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (editingStyle == UITableViewCellEditingStyleDelete) {
        // Delete the row from the data source.
        [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
    }   
    else if (editingStyle == UITableViewCellEditingStyleInsert) {
        // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view.
    }   
}
*/


/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/


/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
    // Return NO if you do not want the item to be re-orderable.
    return YES;
}
*/


#pragma mark -
#pragma mark Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= 30200
	
	if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad )
	{
		if (_webViewController2 == nil) {
			self.webViewController2 = [[[WebViewController2 alloc] initWithNibName:@"WebViewController2" bundle:[NSBundle mainBundle]] autorelease];
		}
		RSSEntry *entry = [_allEntries objectAtIndex:indexPath.row];
		_webViewController2.entry = entry;
		[self.navigationController pushViewController:_webViewController2 animated:YES];
	}
		
		
		else {	
	if (_webViewController == nil) {
        self.webViewController = [[[WebViewController alloc] initWithNibName:@"WebViewController" bundle:[NSBundle mainBundle]] autorelease];
    }
    RSSEntry *entry = [_allEntries objectAtIndex:indexPath.row];
    _webViewController.entry = entry;
    [self.navigationController pushViewController:_webViewController animated:YES];
		}
#endif
    
}

#pragma mark -
#pragma mark Memory management

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Relinquish ownership any cached data, images, etc that aren't in use.
    self.webViewController = nil;
}

- (void)viewDidUnload {
    // Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.
    // For example: self.myOutlet = nil;
}


- (void)dealloc {
	
	[_webViewController2 release];
	_webViewController2 = nil;
	[activity release];
    [_allEntries release];
    _allEntries = nil;
    [_queue release];
    _queue = nil;
    [_feeds release];
    _feeds = nil;
    [_webViewController release];
    _webViewController = nil;
    [super dealloc];
}


@end
PopOverController.h
Code:
//
//  PopController.h
//  JeffJenkins
//
//  Created by Candace Brassfield on 5/17/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "RootViewController.h"

@interface PopController : UIViewController <RootViewControllerDelegate>{
	IBOutlet UIBarButtonItem *bbiOpenPopOver;
	
	UIPopoverController *popOverController;
	RootViewController *rootViewController;
	WebViewController *_webViewController;
	UIActivityIndicatorView *activity;
	WebViewController2 *_webViewController2;
	NSOperationQueue *_queue;
    NSArray *_feeds;
    NSMutableArray *_allEntries;
}
@property (nonatomic, retain) UIBarButtonItem *bbiOpenPopOver;
@property (retain) NSOperationQueue *queue;
@property (retain) NSArray *feeds;
@property (retain) NSMutableArray *allEntries;
@property (nonatomic, retain) UIPopoverController *popOverController;
@property (nonatomic, retain) RootViewController *rootViewController;
@property (retain) WebViewController *webViewController;
@property (retain) UIActivityIndicatorView *activity;
@property (retain) WebViewController2 *webViewController2;
-(IBAction)togglePopOverController;
@end
PopOverController.m
Code:
    //
//  PopController.m
//  JeffJenkins
//
//  Created by Candace Brassfield on 5/17/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//
#import "RootViewController.h"
#import "PopController.h"
#import "RSSEntry.h"
#import "ASIHTTPRequest.h"
#import "GDataXMLNode.h"
#import "GDataXMLElement-Extras.h"
#import "NSDate+InternetDateTime.h"
#import "NSArray+Extras.h"
#import "WebViewController.h"
#import "WebViewController2.h"

@implementation PopController
@synthesize popOverController;
@synthesize bbiOpenPopOver;
@synthesize rootViewController;
@synthesize webViewController = _webViewController;
@synthesize activity;
@synthesize webViewController2 = _webViewController2;
@synthesize allEntries = _allEntries;
@synthesize feeds = _feeds;
@synthesize queue = _queue;

 // The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	rootViewController = [[RootViewController alloc] init];
	
	rootViewController.delegate = self;
	
	popOverController = [[UIPopoverController alloc] initWithContentViewController:rootViewController];
	
	popOverController.popoverContentSize = CGSizeMake(247, 320);
    [super viewDidLoad];
}

-(IBAction)togglePopOverController {
	
	if ([popOverController isPopoverVisible]) {
		
		[popOverController dismissPopoverAnimated:YES];
		
	} else {
		
		[popOverController presentPopoverFromBarButtonItem:bbiOpenPopOver permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
		
	}
	
}



- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Overriden to allow any orientation.
    return YES;
}


- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];
    
    // Release any cached data, images, etc. that aren't in use.
}


- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
	[_allEntries release];
    _allEntries = nil;
    [_queue release];
    _queue = nil;
    [_feeds release];
    _feeds = nil;
	
	[_webViewController release];
    _webViewController = nil;
	[_webViewController2 release];
	_webViewController2 = nil;
	[activity release];
	[bbiOpenPopOver release];
	[popOverController release];
	[rootViewController release];
    [super dealloc];
}


@end
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
Is there some rule to posting question on 2 completely different forums? I'm trying to get a quicker response.

It's explicitly against the rules:

The_Rules said:
One thread. Do not post a thread more than once. Post a new thread in the proper forum. If the topic is relevant to more than one forum, pick the best fit or most specific forum and post it only once.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
It's explicitly against the rules:

Thank you for the rules post, but I have not done any of that. The "double post" being referred to is on two completely different web sites.

Any ideas on my code why the webviewcontroller is not being pushed when I select the entry in the table view being displayed in the popover controller?
 

robbieduncan

Moderator emeritus
Jul 24, 2002
25,611
893
Harrogate
self.navigationController refers to the navigation controller that contains the current view controller instance if any. It is very unlikely this is what you want if you are presenting the view controller in a popover: that would push the next view into the navigation controller within the popover. Of course I doubt you actually have a navigation controller within your popover: most likely self.navigationController is nil (check this to be sure). What you really want is a reference to the navigation controller within the detail view. Or perhaps simply to replace the detail view with the content you are trying to push into the navigation controller.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
Thanks, that makes sense. I have made some changes. In the PopOverController classes, I added an IBOutlet UIWebView named trythis. I added the webview in interface builder. The view where the tableview is at that parses the RSS Feed is called RootViewController. In the .h for that I added:
Code:
@protocol RootViewControllerDelegate <NSObject>

-(void)didTap:(NSString *)string;

@end
id delegate;
@class WebViewController;
@class WebViewController2;
just above the implementation.
Then in the PopOverController.h I set it as <RootViewControllerDelegate>
In the .m of PopOverController I add this method:
Code:
-(void)didTap:(NSString *)string {
	
	NSURL *url = [NSURL URLWithString:_entry.articleUrl];    
    [trythis loadRequest:[NSURLRequest requestWithURL:url]];
	timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(tick) userInfo:nil repeats:YES];
	
	[popOverController dismissPopoverAnimated:YES];
	
}
It was my hopes that this would dismiss the PopOver and tell the webview *trythis to load whatever URL that particular entry had. When I debug it opens and the popovercontroller works but when I select an entry it crashes. The error given is:
Code:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[PopController tick]: unrecognized selector sent to instance 0x6022450'
*** Call stack at first throw:
Any ideas as to what this issue may be?

I figured out the crash was due to me being stupid and not adding the 'tick' method for the class. It now will not crash, but still nothing loads in the webview.
 
Last edited:

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I dont have a detail view

I have a RootViewController that parses the RSS into a TableView. On the iPhone, it pushes a new view through navigation controller to WebViewController that has a UIWebView which gets its URL from the selected RSS Entry.

On the iPad Version The MainWindow-iPad.xib has Tab 1 called PopController or something like that. It is simply a view with a UIButton that displays the PopOverController. It reads the RootViewController for the PopOver. It currently works to display the PopOver with the TableView inside it, but does not do anything yet other than dismiss the PopOver when I click on a row. I would like it to get the URL for that entry and display it on a WebView that is in the PopOver Class but so far I am not having any luck. I put this code in the PopController
Code:
-(void)didTap:(NSString *)string {
	NSLog(@"_entry.articleUrl:%@",_entry.articleUrl);
	NSURL *url = [NSURL URLWithString:_entry.articleUrl];    
    [trythis loadRequest:[NSURLRequest requestWithURL:url]];
	timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(tick) userInfo:nil repeats:YES];
	
	[popOverController dismissPopoverAnimated:YES];
	
}
The NSLog is showing null for it though right now.
 
Last edited:

Shawnpk

macrumors 6502
Jan 13, 2011
350
0
Los Angeles, CA
I dont have a detail view

I could be mistaken, but the detail view is the full screen view where the URL you're trying to show is shown. If you don't have a DetailView, that may be your problem. Maybe start a new project, choose the Slit View project and see how it is setup. It may help. Also, if your a paid developer, you can log in and search for Multiple Detail Views sample code.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I could be mistaken, but the detail view is the full screen view where the URL you're trying to show is shown. If you don't have a DetailView, that may be your problem. Maybe start a new project, choose the Slit View project and see how it is setup. It may help. Also, if your a paid developer, you can log in and search for Multiple Detail Views sample code.
I'm not setting it up as a split view app, just a view with popover.

If I change the loadrequest to a standard URL on the didtap method, it will dismiss the popover and load the specified site into the webview just fine, so I guess I need to figure out how to get the URL for the selected row.

When I compiled I noticed the following warnings. I'm not sure exactly how I can fix this, or really how it happened.
Code:
/Users/candace.brassfield (Deleted)/Desktop/JeffJenkins/Resources-iPad/MainWindow-iPad.xib:235:0 The 'view' outlet of 'Pop Controller' is connected to 'View' but 'Pop Controller' already has a 'View' child fulfilling this role.

/Users/candace.brassfield (Deleted)/Desktop/JeffJenkins/Resources-iPad/MainWindow-iPad.xib:235:0 'Pop Controller' has both its 'NIB Name' property set and its 'view' outlet connected. This configuration is not supported.

/Users/candace.brassfield (Deleted)/Desktop/JeffJenkins/Resources-iPad/MainWindow-iPad.xib:235:0 'Pop Controller' has both its 'View' and 'NIB Name' properties set. This configuration is not supported.
 
Last edited:

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
Fixed all the warnings, but still return null on NSLog for getting URL from selectedRow in popover. I am out of ideas.
 

newtoiphonesdk

macrumors 6502a
Original poster
Jul 30, 2010
567
2
I know that the reason nothing is getting pushed into the webview is because my _entry.articleURL is not being set anywhere in the PopController code. I am just not sure how I can do this. I tried putting in my methods for parsing the feed, but it still always returns null on it.
 

Shawnpk

macrumors 6502
Jan 13, 2011
350
0
Los Angeles, CA
I know that the reason nothing is getting pushed into the webview is because my _entry.articleURL is not being set anywhere in the PopController code. I am just not sure how I can do this. I tried putting in my methods for parsing the feed, but it still always returns null on it.

Here is a quote from the book "Beginning iPhone 4 Development" from Apress books. It has to do with the DetailView I was telling you about:

" the view controller we want to show is already in place; it&#146;’s the instance of DetailViewController contained in the xib file. So all we need to do here is tell that DetailViewController instance what to display."

You don't "push" a new view in an iPad app as you would do in an iPhone app.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.