Xcode Study Case Notes

Source: Internet
Author: User

XcodeThe Study Case note is the content to be introduced in this article. It mainly introducesXcode3.2.5 help solve and use problems that cannot be displayedUIWebViewTo playVideoIn the iphone projectStatic Library.

Xcode 3.2.5 helps solve problems that cannot be displayed

In this version, Document must be installed online and automatically executed in the background.

However, the installation address is incorrect. This is a bug, which causes installation failure and cannot be viewed. The solution is to manually modify it. 1. Open the Term and log on to the root user. 2. Go

 
  1. /developer4.2/Platforms/iPhoneOS.platform/Developer/Documentation/DocSets/com.apple.adc.documentation.AppleiOS4_2.iOSLibrary.docset/Contents 

Directory, modify the Info. plist file. Find/prerelease, delete it, save the disk, and restart Xcode.

Use UIWebView to play a video

MPMoviePlayerController is not inherited from UIViewController

The example in the SDK uses addSubviews to add MPMoviePlayerController. view.

InUIWebViewAnd then call [MPMoviePlayerController play.

Most convenient playbackVideoYou can use UIWebView to load an NSURL, that is, the video address. For example:

 
  1. self.webView = [[[UIWebView alloc] initWithFrame:[[UIScreen mainScreen] applicationFrame]] autorelease];     
  2. NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:string]];     
  3. [self.webView loadRequest:request];    

This effect is the standard player effect.

Static library in iphone Project

The iphone program in the AppStore cannot use dynamic link libraries.

If you need to provide some functions while hiding the code, you can use the static Link Library.

AddStatic LibraryMethod

Right-click target and choose add-> new target.

On the NewTarget page that appears, select Cocoa Touch-> Static Library to name the new library.

Add the source file to this database. You can drag the existing source file directly or right-click and choose add. Note: select the newly created database as the added target.

Set the original project to use the new library.

Right-click the target of the original project and select getInfo.

Select General Tab

Add the. a file to the newly created library in linked libraries ).

Compile the newStatic LibraryTo generate the. a file. Right-clickStatic LibraryTarget, select build)

Compile the original project. If you can call the method in the static library, it is added successfully.

How to hide static library code

You can directly Delete the source code from the static library and only submit the Linked Library file. a), so that the original project can still be compiled and executed.

Note:

The static link library file in Mac OS uses the. a extension as in linux.

Summary: The content of Xcode Study Case Notes has been introduced. I hope this article will help you!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.