Permalink
Browse files

The url in the ticket detail now loads a UIWebView with the lighthous…

…e page for the ticket
  • Loading branch information...
1 parent 7850132 commit 2569ea5afd35bedb8da36792c33b378f1bfcddf8 @cpetersen committed Feb 25, 2009
@@ -131,7 +131,8 @@ - (UITableViewCell *)tableView:(UITableView *)tableView2 cellForRowAtIndexPath:(
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
-
+
+ cell.accessoryType = UITableViewCellAccessoryNone;
if(indexPath.section == 0) {
if(indexPath.row == 0) {
NSString *tp = [[NSString alloc] initWithFormat:@"Assigned To: %@", ticket.assignedUserName];
@@ -159,9 +160,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView2 cellForRowAtIndexPath:(
[tp release];
} else if (indexPath.row == 6) {
NSString *tp = [[NSString alloc] initWithFormat:@"URL: %@", ticket.url];
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.text = tp;
[tp release];
} else if (indexPath.row == 7) {
+ cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.text = ticket.body;
}
}
@@ -172,13 +175,25 @@ - (UITableViewCell *)tableView:(UITableView *)tableView2 cellForRowAtIndexPath:(
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
- if(indexPath.row == 7) {
- NSLog(@"PUSHING THE WEBVIEW");
+ NSLog(@"didSelectRowAtIndexPath 1");
+ if(indexPath.row == 6) {
+ NSLog(@"didSelectRowAtIndexPath 2");
+ WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebView" bundle:nil];
+ NSLog(@"didSelectRowAtIndexPath 3");
+ webViewController.url = ticket.url;
+
+ NSLog(@"didSelectRowAtIndexPath 4");
+ [[self navigationController] pushViewController:webViewController animated:YES];
+
+ NSLog(@"didSelectRowAtIndexPath 5");
+ [webViewController release];
+ NSLog(@"didSelectRowAtIndexPath 6");
+ } else if(indexPath.row == 7) {
WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebView" bundle:nil];
- //[[self navigationController] pushViewController:webViewController];
- [self pushViewController:webViewController];
+ [[self navigationController] pushViewController:webViewController animated:YES];
[webViewController release];
}
+ NSLog(@"didSelectRowAtIndexPath 7");
}
@@ -9,8 +9,14 @@
#import <UIKit/UIKit.h>
-@interface WebViewController : UIViewController {
+@interface WebViewController : UIViewController<UIWebViewDelegate> {
IBOutlet UIWebView *webView;
+
+ NSString *url;
+ NSString *body;
}
+@property (nonatomic, retain) NSString *url;
+@property (nonatomic, retain) NSString *body;
+
@end
@@ -11,6 +11,8 @@
@implementation WebViewController
+@synthesize url, body;
+
/*
// The designated initializer. Override to perform setup that is required before the view is loaded.
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
@@ -27,12 +29,22 @@ - (void)loadView {
}
*/
-/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
+
- (void)viewDidLoad {
[super viewDidLoad];
+ NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
+
+ if([self url]) {
+ NSURL *ns_url = [NSURL URLWithString:[self url]];
+ NSURLRequest *request = [NSURLRequest requestWithURL:ns_url];
+ [webView loadRequest:request];
+ } else if([self body]) {
+ NSLog(@"viewDidLoad 8");
+ }
+
+ [pool release];
}
-*/
/*
// Override to allow orientations other than the default portrait orientation.
@@ -49,6 +61,8 @@ - (void)didReceiveMemoryWarning {
- (void)dealloc {
+ [url dealloc];
+ [body dealloc];
[super dealloc];
}
View
@@ -8,7 +8,7 @@
<string key="IBDocument.HIToolboxVersion">353.00</string>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
- <integer value="3"/>
+ <integer value="15"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -31,16 +31,16 @@
<object class="IBProxyObject" id="975951072">
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
</object>
- <object class="IBUIView" id="191373211">
+ <object class="IBUIView" id="791747437">
<reference key="NSNextResponder"/>
<int key="NSvFlags">292</int>
<object class="NSMutableArray" key="NSSubviews">
<bool key="EncodedWithXMLCoder">YES</bool>
- <object class="IBUIWebView" id="390643275">
- <reference key="NSNextResponder" ref="191373211"/>
+ <object class="IBUIWebView" id="729360984">
+ <reference key="NSNextResponder" ref="791747437"/>
<int key="NSvFlags">274</int>
- <string key="NSFrameSize">{320, 480}</string>
- <reference key="NSSuperview" ref="191373211"/>
+ <string key="NSFrameSize">{320, 460}</string>
+ <reference key="NSSuperview" ref="791747437"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">1</int>
<bytes key="NSRGB">MSAxIDEAA</bytes>
@@ -50,7 +50,7 @@
<bool key="IBUIScalesPageToFit">YES</bool>
</object>
</object>
- <string key="NSFrameSize">{320, 480}</string>
+ <string key="NSFrameSize">{320, 460}</string>
<reference key="NSSuperview"/>
<object class="NSColor" key="IBUIBackgroundColor">
<int key="NSColorSpace">3</int>
@@ -59,6 +59,7 @@
<int key="NSID">2</int>
</object>
</object>
+ <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
</object>
</object>
<object class="IBObjectContainer" key="IBDocument.Objects">
@@ -68,17 +69,17 @@
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">view</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="191373211"/>
+ <reference key="destination" ref="791747437"/>
</object>
- <int key="connectionID">4</int>
+ <int key="connectionID">16</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">webView</string>
<reference key="source" ref="372490531"/>
- <reference key="destination" ref="390643275"/>
+ <reference key="destination" ref="729360984"/>
</object>
- <int key="connectionID">5</int>
+ <int key="connectionID">18</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
@@ -93,15 +94,6 @@
<nil key="parent"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">1</int>
- <reference key="object" ref="191373211"/>
- <object class="NSMutableArray" key="children">
- <bool key="EncodedWithXMLCoder">YES</bool>
- <reference ref="390643275"/>
- </object>
- <reference key="parent" ref="360949347"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">-1</int>
<reference key="object" ref="372490531"/>
<reference key="parent" ref="360949347"/>
@@ -113,9 +105,18 @@
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">3</int>
- <reference key="object" ref="390643275"/>
- <reference key="parent" ref="191373211"/>
+ <int key="objectID">15</int>
+ <reference key="object" ref="791747437"/>
+ <object class="NSMutableArray" key="children">
+ <bool key="EncodedWithXMLCoder">YES</bool>
+ <reference ref="729360984"/>
+ </object>
+ <reference key="parent" ref="360949347"/>
+ </object>
+ <object class="IBObjectRecord">
+ <int key="objectID">17</int>
+ <reference key="object" ref="729360984"/>
+ <reference key="parent" ref="791747437"/>
</object>
</object>
</object>
@@ -125,15 +126,15 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<string>-1.CustomClassName</string>
<string>-2.CustomClassName</string>
- <string>1.IBEditorWindowLastContentRect</string>
- <string>1.IBPluginDependency</string>
- <string>3.IBPluginDependency</string>
+ <string>15.IBEditorWindowLastContentRect</string>
+ <string>15.IBPluginDependency</string>
+ <string>17.IBPluginDependency</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>WebViewController</string>
<string>UIResponder</string>
- <string>{{354, 276}, {320, 480}}</string>
+ <string>{{342, 202}, {320, 460}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
@@ -158,7 +159,7 @@
</object>
</object>
<nil key="sourceID"/>
- <int key="maxID">5</int>
+ <int key="maxID">18</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
@@ -172,7 +173,7 @@
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBProjectSource</string>
- <string key="minorKey">WebViewController.h</string>
+ <string key="minorKey">Classes/WebViewController.h</string>
</object>
</object>
</object>
Oops, something went wrong.

0 comments on commit 2569ea5

Please sign in to comment.