Skip to content

Commit

Permalink
webview no longer detects for phone data. working
Browse files Browse the repository at this point in the history
on edit functionality.
  • Loading branch information
swannodette committed Apr 16, 2010
1 parent c0da15a commit 4c5fb3b
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 28 deletions.
3 changes: 2 additions & 1 deletion Classes/DetailViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#import <UIKit/UIKit.h>

@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate> {
@interface DetailViewController : UIViewController <UIPopoverControllerDelegate, UISplitViewControllerDelegate, UIWebViewDelegate> {

UIPopoverController *popoverController;
UIToolbar *toolbar;
Expand All @@ -26,5 +26,6 @@
@property (nonatomic, retain) IBOutlet UIWebView *webView;

- (void)showGist:(NSNumber *)gistId;
- (IBAction)edit;

@end
36 changes: 34 additions & 2 deletions Classes/DetailViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ @implementation DetailViewController
/*
When setting the detail item, update the view and dismiss the popover controller if it's showing.
*/
- (void)setDetailItem:(id)newDetailItem {
- (void)setDetailItem:(id)newDetailItem
{
NSLog(@"set detail item %@", newDetailItem);
if (detailItem != newDetailItem) {
[detailItem release];
Expand All @@ -47,11 +48,22 @@ - (void)setDetailItem:(id)newDetailItem {
}


- (void)configureView {
- (void)configureView
{
[self showGist:self.detailItem];
}


- (IBAction)edit
{
NSLog(@"edit");
// get the path to the latest revision of the gist
NSString *script = @"document.querySelectorAll";
NSString *result = [self.webView stringByEvaluatingJavaScriptFromString:(NSString *)script];
NSLog(@"result: %@", result);
}


#pragma mark -
#pragma mark Split view support

Expand Down Expand Up @@ -129,6 +141,26 @@ - (void)viewDidUnload {
self.popoverController = nil;
}

#pragma mark -
#pragma mark UIWebViewDelegate methods

- (void)webView:(UIWebView *)aWebView didFailLoadWithError:(NSError *)error
{
}

- (BOOL)webView:(UIWebView *)aWebView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
return YES;
}

- (void)webViewDidFinishLoad:(UIWebView *)aWebView
{
NSLog(@"webViewDidFinishLoad:%@", aWebView);
}

- (void)webViewDidStartLoad:(UIWebView *)aWebView
{
}

#pragma mark -
#pragma mark Memory management
Expand Down
65 changes: 60 additions & 5 deletions DetailView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="8"/>
<integer value="67"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
Expand Down Expand Up @@ -52,6 +52,12 @@
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<object class="NSMutableArray" key="IBUIItems">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBUIBarButtonItem" id="408838273">
<string key="IBUITitle">Edit</string>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIStyle">1</int>
<reference key="IBUIToolbar" ref="410698538"/>
</object>
</object>
</object>
<object class="IBUIWebView" id="466056949">
Expand All @@ -64,8 +70,6 @@
<bytes key="NSRGB">MSAxIDEAA</bytes>
</object>
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
<int key="IBUIDataDetectorTypes">1</int>
<bool key="IBUIDetectsPhoneNumbers">YES</bool>
</object>
</object>
<string key="NSFrameSize">{768, 1004}</string>
Expand Down Expand Up @@ -108,6 +112,22 @@
</object>
<int key="connectionID">68</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchOutletConnection" key="connection">
<string key="label">delegate</string>
<reference key="source" ref="466056949"/>
<reference key="destination" ref="841351856"/>
</object>
<int key="connectionID">70</int>
</object>
<object class="IBConnectionRecord">
<object class="IBCocoaTouchEventConnection" key="connection">
<string key="label">edit</string>
<reference key="source" ref="408838273"/>
<reference key="destination" ref="841351856"/>
</object>
<int key="connectionID">72</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -144,6 +164,7 @@
<reference key="object" ref="410698538"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="408838273"/>
</object>
<reference key="parent" ref="647120888"/>
</object>
Expand All @@ -152,6 +173,11 @@
<reference key="object" ref="466056949"/>
<reference key="parent" ref="647120888"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">71</int>
<reference key="object" ref="408838273"/>
<reference key="parent" ref="410698538"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand All @@ -162,6 +188,7 @@
<string>-2.CustomClassName</string>
<string>63.IBPluginDependency</string>
<string>67.IBPluginDependency</string>
<string>71.IBPluginDependency</string>
<string>8.IBEditorWindowLastContentRect</string>
<string>8.IBPluginDependency</string>
</object>
Expand All @@ -171,7 +198,8 @@
<string>UIResponder</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{75, 4}, {783, 852}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
<string>{{569, 4}, {783, 852}}</string>
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
</object>
</object>
Expand All @@ -191,14 +219,25 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">68</int>
<int key="maxID">72</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="IBPartialClassDescription">
<string key="className">DetailViewController</string>
<string key="superclassName">UIViewController</string>
<object class="NSMutableDictionary" key="actions">
<string key="NS.key.0">edit</string>
<string key="NS.object.0">id</string>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
<string key="NS.key.0">edit</string>
<object class="IBActionInfo" key="NS.object.0">
<string key="name">edit</string>
<string key="candidateClassName">id</string>
</object>
</object>
<object class="NSMutableDictionary" key="outlets">
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
Expand Down Expand Up @@ -386,6 +425,22 @@
<string key="minorKey">UIKit.framework/Headers/UIResponder.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarButtonItem</string>
<string key="superclassName">UIBarItem</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarButtonItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UIBarItem</string>
<string key="superclassName">NSObject</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">UIKit.framework/Headers/UIBarItem.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">UILabel</string>
<string key="superclassName">UIView</string>
Expand Down
Loading

0 comments on commit 4c5fb3b

Please sign in to comment.