Skip to content
Browse files

Fixes links not being followed in DetailView.

Also adds a custom title to the nav bar.
  • Loading branch information...
1 parent c2a3c50 commit 26ed1c2cd824c576f52489f54c810cd9d7dff1ba @oalders committed
View
14 xcode/iCPAN/DetailViewController.m
@@ -103,6 +103,7 @@ - (void)viewDidLoad {
podViewer.scalesPageToFit = YES;
// Override point for customization after application launch
+ podViewer.delegate = self;
[super viewDidLoad];
}
@@ -145,10 +146,18 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
Module *module = [results objectAtIndex:0];
NSLog(@"results for single module search %@", module.name );
- self.title = module.name;
NSString *fileName = [self module2url:module];
NSString *podPath = [[del podDir] stringByAppendingPathComponent:fileName];
+ UILabel *label = [[UILabel alloc] init];
+ label.font = [UIFont fontWithName:@"Helvetica-Bold" size: 12.0];
+ // Optional - label.text = @"NavLabel";
+ [label setBackgroundColor:[UIColor clearColor]];
+ [label setTextColor:[UIColor whiteColor]];
+ [label setText:module.name];
+ [label sizeToFit];
+ [self.navigationController.navigationBar.topItem setTitleView:label];
+
if ( ![[NSFileManager defaultManager] fileExistsAtPath:podPath] ) {
NSLog(@"creating file at %@", podPath);
@@ -186,7 +195,6 @@ - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)
NSLog(@"shouldStartLoadWithRequest ends");
-
return TRUE;
}
@@ -196,6 +204,8 @@ - (void)webViewDidStartLoad:(UIWebView *)webView {
}
-(NSString*)url2module:(NSString *)pageName {
+ // remove after regenerating db
+ pageName = [pageName stringByReplacingOccurrencesOfString:@"-" withString:@"::"];
pageName = [pageName stringByReplacingOccurrencesOfString:@"__" withString:@"::"];
pageName = [pageName stringByReplacingOccurrencesOfString:@".html" withString:@""];
return pageName;
View
1 xcode/iCPAN/SearchViewController.m
@@ -109,6 +109,7 @@ - (void)performSearch {
predicate = [NSCompoundPredicate andPredicateWithSubpredicates:predicateArgs];
if([predicateArgs count] ==1) {
predicate = [NSPredicate predicateWithFormat:@"%K BEGINSWITH[cd] %@", attributeName, searchText];
+ NSLog(@"-------------------------------------> starts with search");
}
else {
// this search will bypass the db index and be very slow
View
1 xcode/iCPAN/iPhone/DetailViewController_iPhone.m
@@ -34,6 +34,7 @@ - (void) addBookmark {
NSLog(@"adding bookmark");
[ModuleBookmark addBookmark:[self.detailItem valueForKey:@"name"]];
[self activateTrashButton];
+ NSLog(@"items %@", self.toolbarItems);
}
View
12 xcode/iCPAN/iPhone/en.lproj/MainWindow_iPhone.xib
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="7.10">
<data>
- <int key="IBDocument.SystemTarget">1280</int>
+ <int key="IBDocument.SystemTarget">1296</int>
<string key="IBDocument.SystemVersion">11D50b</string>
- <string key="IBDocument.InterfaceBuilderVersion">1938</string>
+ <string key="IBDocument.InterfaceBuilderVersion">2182</string>
<string key="IBDocument.AppKitVersion">1138.32</string>
<string key="IBDocument.HIToolboxVersion">568.00</string>
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
- <string key="NS.object.0">933</string>
+ <string key="NS.object.0">1181</string>
</object>
<object class="NSArray" key="IBDocument.IntegratedClassDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
@@ -345,7 +345,7 @@
<string>4.IBPluginDependency</string>
<string>9.IBPluginDependency</string>
</object>
- <object class="NSMutableArray" key="dict.values">
+ <object class="NSArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>SearchViewController_iPhone</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
@@ -394,7 +394,7 @@
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
- <real value="1280" key="NS.object.0"/>
+ <real value="1296" key="NS.object.0"/>
</object>
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
@@ -402,6 +402,6 @@
</object>
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
<int key="IBDocument.defaultPropertyAccessControl">3</int>
- <string key="IBCocoaTouchPluginVersion">933</string>
+ <string key="IBCocoaTouchPluginVersion">1181</string>
</data>
</archive>

0 comments on commit 26ed1c2

Please sign in to comment.
Something went wrong with that request. Please try again.