[아이폰 앱 개발] Overriding NSObject Description Method

No doubt NSLog is your friend, I use it frequently to print messages to the console during development. Actually, I use a variation of the NSLog that prints messages to the console sans date, time and object information, you can read about my approach here: Yet Another Debug Output (NSLog Replacement)

Posted by 오늘마감
How to override UIWebView links request action with your own custom method

How to override UIWebView links request action with your own custom method

Ivan Kalaica

If you have a Web View in your view you can call a custom action when the user taps on a link in that UIWebView instance.

Here’s how…

Set the delegate of that UIWebView class instance on your instance of UIViewController class. Now just copy & paste the following code into your class.  This code implements the UIWebView instance and adds a call to the custom action (method).

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
if(navigationType == UIWebViewNavigationTypeLinkClicked) {
if (overrideLinksSwitch.on == TRUE) {
[self myMethodAction];
[myWebView stopLoading];
return YES;
}
else {
<>return YES;
}
}
return YES;
}

You can download an example app here.

http://surgeworksmobile.com/iphone/how-to-override-uiwebview-links-request-action-with-your-own-custom-method

Posted by 오늘마감
오브젝트C2010.10.12 04:44
[objective-c] Overriding NSObject Description Method

Overriding NSObject Description Method

Posted by 오늘마감
How to override UIWebView links request action with your own custom method

How to override UIWebView links request action with your own custom method

If you have a Web View in your view you can call a custom action when the user taps on a link in that UIWebView instance.

Here’s how…

Set the delegate of that UIWebView class instance on your instance of UIViewController class. Now just copy & paste the following code into your class.  This code implements the UIWebView instance and adds a call to the custom action (method).

- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
if(navigationType == UIWebViewNavigationTypeLinkClicked) {
if (overrideLinksSwitch.on == TRUE) {
[self myMethodAction];
[myWebView stopLoading];
return YES;
}
else {
<>return YES;
}
}
return YES;
}

You can download an example app here.

http://surgeworksmobile.com/iphone/how-to-override-uiwebview-links-request-action-with-your-own-custom-method
Posted by 오늘마감