2 3 4 Page 1 of 4 1 2 3 4

setAnimationDidStopSelector: various applications and advanced

Monday, March 8, 2010

In most cases, either because we are used or because we have seen in tutorials and in some text to setAnimationDidStopSelector like this: PLAIN TEXT Objective-C: [UIView beginAnimations: nil context: NULL], [UIView setAnimationDuration: 1.5 ] [UIView setAnimationCurve: UIViewAnimationCurveEaseInOut] [UIView setAnimationDelegate: self], [UIView setAnimationDidStopSelector: @ selector (removeView)]; myView.alpha = 0; [UIView commitAnimations] / / - (void) (removeView [MyView removeFromSuperview] ;) The code above sets the setAnimationDelegate self as delegate and through [...]

iPhone: removing the shadow effect during the scroll in a UIWebView

Thursday, February 25, 2010

In this last period I worked on three applications for Apple iPhone, almost simultaneously. Two have already been approved and are on Apple App Store: TheFirst and iMakeLove. Both applications have adopted the use of an object UIWebView to view the instructions. The object is UIWebView ELEVANCE really comfortable here. [...]

How to locate images and views in Interface Builder

Tuesday, February 23, 2010

After explaining how to locate our strings in Xcode, as we see now is simple - using the same technique - locate images / views / interfaces built with Interface Builder. Locate graphics resources process, as mentioned, is the same, if we have a ' image already included in our resources, or places a new, and we want to "locate" - that is [...]

How to create your own protocol with delegation

Wednesday, February 10, 2010

Create your own protocol may be useful in a host of cases

Very short snippet: get the output of a URL in Objective-C

Friday, February 5, 2010

Perhaps I should have written "Very very very, short snippets," but it is an excellent and convenient "trick" that I am about to show. Doing the "two" lines of code shown below, you can get the output of any URL and manipulate it. PLAIN TEXT Objective-C: NSString * url = [NSString stringWithFormat: @ "http://www.appleside.it/ "]; NSString * result = [NSString stringWithContentsOfURL: [NSURL URLWithString: url] [...]

10 Useful snippet for Apple iPhone

Friday, January 8, 2010

Execute a method in n seconds performSelector The whole family is really interesting and may be useful in a multitude of cases. Its application simplest and most common is this: PLAIN TEXT Objective-C: [self performSelector: @ selector (myMethod) withObject: nil afterDelay: 3] / / - (void) (myMethod NSLog (@ "Hello World!" );) however, that the "timer" is not precise. This procedure, therefore, must be used when there is [...]

Objective-C: Expose properties in a class

Monday, December 14, 2009

I would like to show and discuss some examples on how to add and manipulate properties in a Class Objective-C. A classic example, precisely, is as follows: in the definition of our interface class defines two properties name: PLAIN TEXT Objective-C: / / MyClass.h <Foundation/Foundation.h> # import @ interface MyClass : NSObject (NSString * name; NSString * name;) @ property (retain) NSString * name; @ property (retain) NSString [...]

Apple iPhone: Create a custom toggle button

Friday, December 4, 2009

States UIControlStateSelected or UIControlStateHighlighted not work when a UIButton is set to work UIButtonTypeCustom! Or rather, do not work (because reserved for other types of buttons), for example to create a button in two states: toggle note. If we have created two images (stato1.png and stato2.png) for our button, we can proceed in this [...]

Very short snippet: streaming mp3 files on Apple iPhone

Tuesday, December 1, 2009

An alternative that easy to run a stream a mp3 file on the Apple iPhone could be: PLAIN TEXT Objective-C: / / Use AVFoundation Framework and the header file (. H) are added / / # import <AVFoundation / AVFoundation.h > / / In our implementation / / insert the url of the mp3 file NSString * soundFilePath = @ "http://www.server.com/test.mp3" NSURL * fileURL = [NSURL URLWithString: soundFilePath]; NSURLRequest * request = [NSURLRequest requestWithURL: fileURL]; NSData * DataRaw = [NSURLConnection sendSynchronousRequest: request returningResponse: nil error: nil]; AVAudioPlayer [...]

Very short snippet: Apple iPhone file system

Saturday, November 21, 2009

Both Mac OS X and iPhone OS, we can have easy and direct to the directories - more important - the system which are: PLAIN TEXT CODE: NSHomeDirectory Returns the path to the current user's home directory. NSHomeDirectoryForUser Returns the path to a given user's home directory. NSTemporaryDirectory Returns the [...]

2 3 4 Page 1 of 4 1 2 3 4