IPhone Development notes

Source: Internet
Author: User

IPhone DevelopmentNote is the content to be introduced in this article.Iphone DevelopmentThe implementation of several cases in the above section.

1. About KMapView custom calloutM in IOS development

When I was doing a map application on ios, I sometimes needed to customize callout. After searching for a long time, I found an article on a foreign website about custom callout: bytes.

In fact, the custom callout is actually implemented through two annotations. If we place A on the map, We can insert a B after selecting, the offset of B is just above A, which forms the callout effect.

It mainly involves two proxy methods for MAP implementation:

 
 
  1. mapView:didSelectAnnotationView:   
  2. mapView:didDeselectAnnotationView:  

Insert B in the first proxy method and remove B in the second method. Generally, the custom callout is implemented in this way. If you have time, write one by yourself ~~

2. iphone development uses macros to determine whether it is running in a simulator or a real machine

 
 
  1. #if TARGETIPHONE_SIMULATOR  
  2.  
  3. #endif  
  4. #if !(TARGET_IPHONE_SIMULATOR)  
  5. #endif 

The code in 1 is compiled in the simulator. The code in 2 will be compiled in the real machine.

3. Summary of Nib files in iphone application development

ProfilingNibFile.

LoadNib file, We only get a copy of this nib file. Nib load Code will instantiate objects, configure them, and establish the connection you have established in IB.

Interface object: including visible and invisible. Generally, Some view windows are visible. Some view controllers are invisible.

The most important object of a nib file is the Files owner object. Unlike others, the Files owner object is a proxy object, which is not created when nib file is loaded. On the contrary, this object is created in code, and pass it to the nib load Code. This object is important because it connects the application code to the content of nib file.

Frist Responder is a proxy object that represents the first object of the application's dynamic corresponding link. Because the corresponding link of an application cannot be determined during design. When loading from a nib file to the memory, I can't do anything for First Responder. AppKit and UIKit frameworks automatically sets and manages the first responder according to the current configuration of the application.

4. iphone development-obtain image resources of other ipa programs and extract png resources from ipa)

In our development process, sometimes we may feel that some of the image resources written by others are relatively good and we want to use them. However, when we extract ipa, we cannot view png resources, because apple will store the png resources in a special format before packaging ipa, if you want to view the png Image of ipa, You need to convert it, for more information, see iPhone PNG Images Normalizer Python. This article only describes the method and uses a python conversion script.

Use ipin. copy the py script to the decompressed ipa Program directory, and switch to the decompressed ipa Program directory from the command line to run python ipin. py, so that the png will be converted to the normal png format, you can see.

Python script: http://u.115.com/file/aq2hi65i

Summary:IPhone DevelopmentThe content of the memo learning notes has been introduced. I hope this article will help you!

Related Article

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.