Permalink
Browse files

Fixed the crash on second load of the ticket web view

  • Loading branch information...
1 parent e50fd8e commit 2f4dd943000796e5dc02501252f78d041ed984c7 @cpetersen committed Mar 1, 2009
@@ -44,6 +44,7 @@ -(void)loadTicket {
NSString *apiKey = [appDelegate getApiKey];
NSString *urlString = [[NSString alloc] initWithFormat:@"http://%@.lighthouseapp.com/projects/%i/tickets/%i.xml?_token=%@", project.accountName, project.projectID, ticket.ticketNumber, apiKey ];
+ NSLog(@"Loading ticket [%@]", urlString);
NSURL *url = [[NSURL alloc] initWithString:urlString];
[urlString release];
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithContentsOfURL:url];
@@ -194,11 +195,22 @@ - (UITableViewCell *)tableView:(UITableView *)tableView2 cellForRowAtIndexPath:(
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
+ NSLog(@"click 1");
if(indexPath.row == 6) {
+ NSLog(@"click 2");
WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebView" bundle:nil];
+ NSLog(@"click 2a");
+ if(ticket) {
+ NSLog(@"click 3 [%@]", ticket.url);
+ } else {
+ NSLog(@"click 3 [NULL TICKET]");
+ }
webViewController.url = ticket.url;
+ NSLog(@"click 4");
[[self navigationController] pushViewController:webViewController animated:YES];
+ NSLog(@"click 5");
[webViewController release];
+ NSLog(@"click 6");
// } else if(indexPath.row == 7) {
// WebViewController *webViewController = [[WebViewController alloc] initWithNibName:@"WebView" bundle:nil];
// webViewController.body = ticket.body;
@@ -257,7 +269,7 @@ - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)
- (void)dealloc {
- [ticket dealloc];
+// [ticket dealloc];
// DELETING THE PROJECT CAUSES CRASHES
// [project dealloc];
[ticketDescription dealloc];
@@ -13,7 +13,6 @@
@interface TicketsViewController : UIViewController<UITableViewDelegate> {
IBOutlet UISearchBar *searchBar;
IBOutlet UITableView *tableView;
- IBOutlet UIActivityIndicatorView *activityIndicator;
IBOutlet UITableViewCell *moreCell;
IBOutlet UIActivityIndicatorView *moreActivityIndicator;
@@ -33,7 +33,7 @@ - (void)loadView {
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
- [activityIndicator setHidesWhenStopped:YES];
+// [activityIndicator setHidesWhenStopped:YES];
[super viewDidLoad];
[NSThread detachNewThreadSelector:@selector(loadTickets) toTarget:self withObject:nil];
@@ -51,7 +51,7 @@ - (void)viewDidLoad {
-(void)loadTickets {
// moreActivityIndicator.hidden = NO;
[moreActivityIndicator startAnimating];
- [activityIndicator startAnimating];
+// [activityIndicator startAnimating];
// [tableView reloadData];
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
@@ -104,7 +104,7 @@ -(void)loadTickets {
[tableView reloadData];
[pool release];
- [activityIndicator stopAnimating];
+// [activityIndicator stopAnimating];
[moreActivityIndicator stopAnimating];
}
@@ -64,7 +64,7 @@ - (void)didReceiveMemoryWarning {
- (void)dealloc {
- [url dealloc];
+// [url dealloc];
// [body dealloc];
[super dealloc];
}
View
@@ -1,15 +1,15 @@
# TODO
-* webkit view for html ticket bodies
# BUGS
* activity indicator doesn't appear on second and third page view
* load ticket body-html instead of body
-* UiWebView Race Condition
* ERRORS
* remove "more tickets" row when there are no more tickets
* when you reach the last page of tickets, it keeps reloading
# FUTURE
+* load all ticket versions
+* thread loading ticket descriptions
* get changesets
* get messages
* create tickets
@@ -53,3 +53,6 @@
* project doesn't exist
* CUSTOM TABLE CELLS
* customize "more tickets" cell
+* webkit view for html ticket bodies
+* UiWebView Race Condition
+* crashes on second load of ticket web view
View
@@ -57,17 +57,6 @@
<float key="IBUISectionHeaderHeight">2.200000e+01</float>
<float key="IBUISectionFooterHeight">2.200000e+01</float>
</object>
- <object class="IBUIActivityIndicatorView" id="67289864">
- <reference key="NSNextResponder" ref="90335479"/>
- <int key="NSvFlags">292</int>
- <string key="NSFrame">{{150, 205}, {20, 20}}</string>
- <reference key="NSSuperview" ref="90335479"/>
- <bool key="IBUIOpaque">NO</bool>
- <bool key="IBUIClearsContextBeforeDrawing">NO</bool>
- <bool key="IBUIUserInteractionEnabled">NO</bool>
- <bool key="IBUIHidesWhenStopped">NO</bool>
- <int key="IBUIStyle">2</int>
- </object>
</object>
<string key="NSFrameSize">{320, 431}</string>
<reference key="NSSuperview"/>
@@ -209,14 +198,6 @@
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
- <string key="label">activityIndicator</string>
- <reference key="source" ref="372490531"/>
- <reference key="destination" ref="67289864"/>
- </object>
- <int key="connectionID">60</int>
- </object>
- <object class="IBConnectionRecord">
- <object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">moreCell</string>
<reference key="source" ref="372490531"/>
<reference key="destination" ref="466323486"/>
@@ -260,7 +241,6 @@
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="156035563"/>
- <reference ref="67289864"/>
</object>
<reference key="parent" ref="360949347"/>
</object>
@@ -275,11 +255,6 @@
<reference key="parent" ref="360949347"/>
</object>
<object class="IBObjectRecord">
- <int key="objectID">59</int>
- <reference key="object" ref="67289864"/>
- <reference key="parent" ref="90335479"/>
- </object>
- <object class="IBObjectRecord">
<int key="objectID">61</int>
<reference key="object" ref="466323486"/>
<object class="NSMutableArray" key="children">
@@ -312,7 +287,6 @@
<string>49.IBEditorWindowLastContentRect</string>
<string>49.IBPluginDependency</string>
<string>55.IBPluginDependency</string>
- <string>59.IBPluginDependency</string>
<string>61.IBEditorWindowLastContentRect</string>
<string>61.IBPluginDependency</string>
<string>62.IBPluginDependency</string>
@@ -327,7 +301,6 @@
<string>{{342, 171}, {320, 480}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{279, 533}, {320, 44}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -228,8 +228,6 @@
<key>Layout</key>
<array>
<dict>
- <key>BecomeActive</key>
- <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXBottomSmartGroupGIDs</key>
@@ -278,13 +276,12 @@
<key>PBXSmartGroupTreeModuleOutlineStateSelectionKey</key>
<array>
<array>
- <integer>27</integer>
- <integer>13</integer>
+ <integer>51</integer>
<integer>0</integer>
</array>
</array>
<key>PBXSmartGroupTreeModuleOutlineStateVisibleRectKey</key>
- <string>{{0, 354}, {240, 660}}</string>
+ <string>{{0, 342}, {240, 660}}</string>
</dict>
<key>PBXTopSmartGroupGIDs</key>
<array/>
@@ -314,24 +311,26 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20306471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>TicketDetailViewController.h</string>
+ <string>README.markdown</string>
<key>PBXSplitModuleInNavigatorKey</key>
<dict>
<key>Split0</key>
<dict>
<key>PBXProjectModuleGUID</key>
<string>1CE0B20406471E060097A5F4</string>
<key>PBXProjectModuleLabel</key>
- <string>TicketDetailViewController.h</string>
+ <string>README.markdown</string>
<key>_historyCapacity</key>
<integer>0</integer>
<key>bookmark</key>
- <string>B13D95920F59FD3600FC240C</string>
+ <string>B13D95C90F5A26A800FC240C</string>
<key>history</key>
<array>
<string>B1CE82DC0F2C105A00AD82E1</string>
@@ -366,17 +365,17 @@
<string>B16DE49C0F55282F00E773AC</string>
<string>B16DE4D70F55349C00E773AC</string>
<string>B1E89A740F573DF900FC4027</string>
- <string>B14C15640F59D5E00019C178</string>
- <string>B14C15650F59D5E00019C178</string>
- <string>B14C15660F59D5E00019C178</string>
<string>B14C15670F59D5E00019C178</string>
- <string>B13D95740F59FC8700FC240C</string>
<string>B13D95750F59FC8700FC240C</string>
<string>B13D95760F59FC8700FC240C</string>
<string>B13D95770F59FC8700FC240C</string>
<string>B13D95780F59FC8700FC240C</string>
- <string>B13D958D0F59FD3600FC240C</string>
- <string>B13D958E0F59FD3600FC240C</string>
+ <string>B13D95970F59FDA900FC240C</string>
+ <string>B13D95A60F5A22BC00FC240C</string>
+ <string>B13D95A70F5A22BC00FC240C</string>
+ <string>B13D95C40F5A26A800FC240C</string>
+ <string>B13D95C50F5A26A800FC240C</string>
+ <string>B13D95C60F5A26A800FC240C</string>
</array>
<key>prevStack</key>
<array>
@@ -440,6 +439,14 @@
<string>B13D958F0F59FD3600FC240C</string>
<string>B13D95900F59FD3600FC240C</string>
<string>B13D95910F59FD3600FC240C</string>
+ <string>B13D95990F59FDA900FC240C</string>
+ <string>B13D95A00F59FF7300FC240C</string>
+ <string>B13D95AA0F5A22BC00FC240C</string>
+ <string>B13D95AB0F5A22BC00FC240C</string>
+ <string>B13D95AC0F5A22BC00FC240C</string>
+ <string>B13D95AD0F5A22BC00FC240C</string>
+ <string>B13D95C70F5A26A800FC240C</string>
+ <string>B13D95C80F5A26A800FC240C</string>
</array>
</dict>
<key>SplitCount</key>
@@ -633,12 +640,12 @@
<integer>5</integer>
<key>WindowOrderList</key>
<array>
+ <string>1C530D57069F1CE1000CFCEE</string>
<string>B13D95670F59ED1300FC240C</string>
<string>B13D95680F59ED1300FC240C</string>
- <string>1C78EAAD065D492600B07095</string>
<string>1CD10A99069EF8BA00B06720</string>
<string>B19F69860F270C2D0001541B</string>
- <string>1C530D57069F1CE1000CFCEE</string>
+ <string>1C78EAAD065D492600B07095</string>
<string>/Users/cpetersen/Code/iphone/Lighthouse/lighthouse.xcodeproj</string>
</array>
<key>WindowString</key>
@@ -945,7 +952,7 @@
<key>WindowToolGUID</key>
<string>1C530D57069F1CE1000CFCEE</string>
<key>WindowToolIsVisible</key>
- <true/>
+ <false/>
</dict>
<dict>
<key>Identifier</key>
@@ -964,6 +971,8 @@
<key>Dock</key>
<array>
<dict>
+ <key>BecomeActive</key>
+ <true/>
<key>ContentConfiguration</key>
<dict>
<key>PBXProjectModuleGUID</key>
@@ -1009,7 +1018,7 @@
<key>WindowToolGUID</key>
<string>1C78EAAD065D492600B07095</string>
<key>WindowToolIsVisible</key>
- <false/>
+ <true/>
</dict>
<dict>
<key>FirstTimeWindowDisplayed</key>
Oops, something went wrong.

0 comments on commit 2f4dd94

Please sign in to comment.