CN110851126A - Method and device for configuring homemade private library on iOS platform - Google Patents
Method and device for configuring homemade private library on iOS platform Download PDFInfo
- Publication number
- CN110851126A CN110851126A CN201910980566.8A CN201910980566A CN110851126A CN 110851126 A CN110851126 A CN 110851126A CN 201910980566 A CN201910980566 A CN 201910980566A CN 110851126 A CN110851126 A CN 110851126A
- Authority
- CN
- China
- Prior art keywords
- private
- path
- file
- configuring
- header file
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides a method and a device for configuring a self-made private library on an iOS platform, wherein the method comprises the following steps: configuring the C + + related header file as a private header file through the component; and searching the C + + related header files according to the path of the configured private header files. The method and the device for configuring the self-made private library on the iOS platform provided by the invention can enable a user to normally use the use _ frame component under any condition through processing the configuration file in the component, do not limit the use mode of the user, and do not need to care about the configuration and the realization in the component.
Description
Technical Field
The invention relates to the field of computers, in particular to a method and a device for configuring a self-made private library on an iOS platform.
Background
In the process of self-making a private library (componentization) on an iOS platform, the problem that due to the fact that mixed compilation of a C + + file and an OC file exists in engineering, if the OC head file and the C + + head file are exposed to the outside in a use _ frame mode, when the OC file is used externally, the C + + file is indirectly quoted to cause compilation errors is found.
The existing method for solving the problem is a mode of forcing a user not to use a use _ frame, so that a static library cannot be generated, a file cannot be exposed to the outside, a C + + file cannot be introduced, and compiling errors cannot occur. The disadvantages of the prior art solutions are evident because it is not possible to require all ways of using no use _ frame, which is not a positive solution to the problem, and the true componentization should be such that the component can be used normally regardless of whether the user has used no use _ frame, and should not restrict the user's freedom.
There is an urgent need for a method for enabling a user to normally use a use _ frame component in any situation when a homemade private library is configured on an iOS platform, without limiting the use mode of the user.
Disclosure of Invention
In order to solve the problem that compiling errors of C + + files can be avoided only by requiring a mode that all users do not use _ frames in the prior art, the invention provides a method and a device for configuring a self-made private library on an iOS platform.
In a first aspect, the present invention provides a method for configuring a homemade private library on an iOS platform, the method comprising:
configuring the C + + related header file as a private header file through the component;
and searching the C + + related header files according to the path of the configured private header files.
Further, configuring the C + + related header file as a private header file by the component includes:
recording the path of the configuration private header file.
Further, searching for the C + + relevant header file according to the path of the configuration private header file includes:
obtaining access C + + file information;
and inquiring the path of the configured private header file according to the access information.
Further, the assembly is a podspec assembly.
In a second aspect, the present invention provides an apparatus for homemaking private library configuration on an iOS platform, the apparatus comprising:
the configuration module is used for configuring the C + + related header files into private header files through the components;
and the searching module is used for searching the C + + related header files according to the path of the configured private header files.
Further, configuring the module thereafter comprises:
and the path recording module is used for recording a path for configuring the private header file.
Further, the search module includes:
the acquisition unit is used for acquiring the information of accessing the C + + file;
and the inquiry path unit is used for inquiring the path of the private header file according to the access information.
Further, the assembly is a podspec assembly.
In a third aspect, the present invention provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the method for configuring the homemade private library on the iOS platform provided in the first aspect when executing the program.
In a fourth aspect, the present invention provides a non-transitory computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the method for homemade private library configuration on an iOS platform provided in the first aspect.
The method and the device for configuring the self-made private library on the iOS platform provided by the invention can enable a user to normally use the use _ frame component under any condition through processing the configuration file in the component, do not limit the use mode of the user, and do not need to care about the configuration and the realization in the component.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for configuring a homemade private library on an iOS platform according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a method for configuring a homemade private library on an iOS platform according to another embodiment of the present invention;
FIG. 3 is a block diagram of an apparatus for configuring a homemade private library on an iOS platform according to an embodiment of the present invention;
FIG. 4 is a block diagram of an apparatus for homemade private library configuration on an iOS platform according to another embodiment of the present invention;
fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In the prior art, the problem that when an OC file is used externally, a user is forced not to use a use _ frame component because a C + + file is indirectly referred to, which results in a compiling error, so that the user's freedom is limited, and the user experience is poor is solved. In order to solve the above problem, an embodiment of the present invention provides a method for configuring a homemade private library on an iOS platform, where as shown in fig. 1, the method includes:
s101, configuring C + + related header files as private header files through components;
and S102, searching the C + + related header file according to the path of the configured private header file.
Specifically, in the embodiment of the present invention, the C + + related header file configured by the component is set as the private header file from the component itself, so that the C + + related header file is not exposed to the outside. Components are simple packages of data and methods, and each component may have its own properties and methods.
But the C + + related header file cannot be found outside, and at the moment, the C + + related header file is searched according to the path of the configured private header file, so that the mixed compilation error condition is solved. The C + + common header files include: "# include < algorithm >// STL general algorithm", "# include < bitset >// STL bit set container", "# include < cctype >// character processing", and the like. In the embodiment of the invention, the C + + related header file is an OC header file.
The method for self-making private library configuration on the iOS platform provided by the invention can enable a user to normally use the use _ frame component under any condition through the processing of the configuration file in the component, does not limit the use mode of the user, and does not need the user to care about the configuration and implementation in the component.
Based on the content of the above embodiments, as an alternative embodiment: the configuration of the C + + related header file as the private header file by the component includes, as shown in fig. 2:
step S103, recording the path of the private header file.
Specifically, when the component configures the C + + related header file as a private header file, the server records a path for configuring the private header file.
Based on the content of the above embodiments, as an alternative embodiment: searching for the C + + related header file according to the path of the configured private header file includes:
obtaining access C + + file information;
and inquiring the path of the configured private header file according to the access information.
Specifically, the server receives information of an external access C + + file, and the server searches for a path of a configuration private header file stored in the server according to the access information.
Based on the content of the above embodiments, as an alternative embodiment: the modules are podspec modules.
Specifically, as the project is iterated continuously, the modules become more complex, the modules are dependent on each other, and each module may have a common business logic, which makes the maintenance of the whole project troublesome. And modularization can be adopted, each business logic and module are separated and managed independently, and therefore maintenance is convenient. The embodiment of the invention configures the C + + header file as the private header file through the podspec component.
According to another aspect of the present invention, an apparatus for configuring a homemade private library on an iOS platform is provided in an embodiment of the present invention, referring to fig. 3, and fig. 3 is a block diagram of the apparatus for configuring a homemade private library on an iOS platform provided in an embodiment of the present invention. The device is used for completing homemade private library configuration on the iOS platform provided by the embodiment of the present invention in the foregoing embodiments. Therefore, the description and definition in the method for homemaking private library configuration on the iOS platform provided in the foregoing embodiments of the present invention may be used for understanding the execution modules in the embodiments of the present invention.
The device includes:
a configuration module 301, configured to configure the C + + related header file as a private header file through the component;
the searching module 302 is configured to search for the C + + related header file according to the path of the configured private header file.
Specifically, in the embodiment of the present invention, the C + + related header file configured by the component is set as the private header file from the component itself, so that the C + + related header file is not exposed to the outside. Components are simple packages of data and methods, and each component may have its own properties and methods.
But the C + + related header file cannot be found outside, and at the moment, the C + + related header file is searched according to the path of the configured private header file, so that the mixed compilation error condition is solved. The C + + common header files include: "# include < algorithm >// STL general algorithm", "# include < bitset >// STL bit set container", "# include < cctype >// character processing", and the like. In the embodiment of the invention, the C + + related header file is an OC header file.
The device for self-making private library configuration on the iOS platform provided by the invention can enable a user to normally use the use _ frame component under any condition through the processing of the configuration file in the component, does not limit the use mode of the user, and does not need the user to care about the configuration and implementation in the component.
Based on the content of the above embodiments, as an alternative embodiment: as shown in fig. 4, the configuration module then includes:
a path recording module 303, configured to record a path for configuring the private header file.
Specifically, when the component configures the C + + related header file as a private header file, the server records a path for configuring the private header file.
Based on the content of the above embodiments, as an alternative embodiment: the search module comprises:
the acquisition unit is used for acquiring the information of accessing the C + + file;
and the inquiry path unit is used for inquiring the path of the private header file according to the access information.
Specifically, the server receives information of an external access C + + file, and the server searches for a path of a configuration private header file stored in the server according to the access information.
Based on the content of the above embodiments, as an alternative embodiment: the modules are podspec modules.
Specifically, as the project is iterated continuously, the modules become more complex, the modules are dependent on each other, and each module may have a common business logic, which makes the maintenance of the whole project troublesome. And modularization can be adopted, each business logic and module are separated and managed independently, and therefore maintenance is convenient. The embodiment of the invention configures the C + + header file as the private header file through the podspec component.
Fig. 5 is a block diagram of an electronic device according to an embodiment of the present invention, and as shown in fig. 5, the electronic device includes: a processor 501, a memory 502, and a bus 503;
the processor 501 and the memory 502 respectively complete communication with each other through a bus 503; the processor 501 is configured to call the program instructions in the memory 502 to execute the method for self-made private library configuration on the iOS platform provided by the foregoing embodiment, for example, including: configuring the C + + related header file as a private header file through the component; and searching the C + + related header files according to the path of the configured private header files.
Embodiments of the present invention provide a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processor, performs the steps of a method for homemade private library configuration on an iOS platform. Examples include: configuring the C + + related header file as a private header file through the component; and searching the C + + related header files according to the path of the configured private header files.
The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
Through the above description of the embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware. With this understanding in mind, the above-described technical solutions may be embodied in the form of a software product, which can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods of the various embodiments or some parts of the embodiments.
Finally, the principle and the implementation of the present invention are explained by applying the specific embodiments in the present invention, and the above description of the embodiments is only used to help understanding the method and the core idea of the present invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.
Claims (10)
1. A method for self-making private library configuration on an iOS platform is characterized by comprising the following steps:
configuring the C + + related header file as a private header file through the component;
and searching the C + + related header files according to the path of the configured private header files.
2. The method according to claim 1, wherein the configuring, by the component, the C + + related header file as a private header file comprises:
recording the path of the configuration private header file.
3. The method according to claim 1, wherein searching for C + + related header files according to the path of the configured private header files comprises:
obtaining access C + + file information;
and inquiring the path of the private header file according to the access information.
4. The method of claim 1, wherein the module is a podspec module.
5. An apparatus for homemade private library configuration on an iOS platform, the apparatus comprising:
the configuration module is used for configuring the C + + related header files into private header files through the components;
and the searching module is used for searching the C + + related header files according to the path of the configured private header files.
6. The apparatus of claim 5, wherein the configuration module thereafter comprises:
and the path recording module is used for recording a path for configuring the private header file.
7. The apparatus of claim 5, wherein the search module comprises:
the acquisition unit is used for acquiring the information of accessing the C + + file;
and the inquiry path unit is used for inquiring the path of the private header file according to the access information.
8. The device of claim 5, wherein the component is a podspec component.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor when executing the program performs the steps of the method for homemade private library configuration on an iOS platform as claimed in any of claims 1 to 4.
10. A non-transitory computer readable storage medium having stored thereon a computer program, wherein the computer program when executed by a processor implements the steps of the method for homemade private library configuration on an iOS platform as claimed in any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910980566.8A CN110851126A (en) | 2019-10-15 | 2019-10-15 | Method and device for configuring homemade private library on iOS platform |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910980566.8A CN110851126A (en) | 2019-10-15 | 2019-10-15 | Method and device for configuring homemade private library on iOS platform |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110851126A true CN110851126A (en) | 2020-02-28 |
Family
ID=69596446
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910980566.8A Pending CN110851126A (en) | 2019-10-15 | 2019-10-15 | Method and device for configuring homemade private library on iOS platform |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110851126A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114968411A (en) * | 2022-06-15 | 2022-08-30 | 康键信息技术(深圳)有限公司 | Code loading method and device, computer equipment and readable storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070094650A1 (en) * | 2005-10-20 | 2007-04-26 | Cisco Technology, Inc. | Method and system for optimizing source code |
CN107577483A (en) * | 2017-08-31 | 2018-01-12 | 武汉斗鱼网络科技有限公司 | Component engineering calls method, storage medium, equipment and the system of main works code |
-
2019
- 2019-10-15 CN CN201910980566.8A patent/CN110851126A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20070094650A1 (en) * | 2005-10-20 | 2007-04-26 | Cisco Technology, Inc. | Method and system for optimizing source code |
CN107577483A (en) * | 2017-08-31 | 2018-01-12 | 武汉斗鱼网络科技有限公司 | Component engineering calls method, storage medium, equipment and the system of main works code |
Non-Patent Citations (1)
Title |
---|
雪豹_: "iOS 组件化实战篇(私有库)", 《HTTPS://JUEJIN.CN/POST/6844903826680610829》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114968411A (en) * | 2022-06-15 | 2022-08-30 | 康键信息技术(深圳)有限公司 | Code loading method and device, computer equipment and readable storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11184241B2 (en) | Topology-aware continuous evaluation of microservice-based applications | |
CN109670951B (en) | Block chain intelligent contract debugging and publishing method and system | |
US20180232220A1 (en) | Service placement techniques for a cloud datacenter | |
CN109062563B (en) | Method and device for generating page | |
US20160019102A1 (en) | Application pattern discovery | |
CN108390773A (en) | A kind of method and apparatus of dynamic routing for scaffold | |
US10331947B2 (en) | Automatic detection on string and column delimiters in tabular data files | |
US20160171505A1 (en) | Extract, transform, and load (etl) processing | |
JP2017509048A (en) | Anti-malware type mobile content data management apparatus and method | |
CN107741935B (en) | Data importing method and data importing device | |
US9582270B2 (en) | Effective feature location in large legacy systems | |
CN107329765B (en) | Program file processing method and device | |
CN110737460A (en) | platform project management method and device | |
US9424260B2 (en) | Techniques for data assignment from an external distributed file system to a database management system | |
US10901984B2 (en) | Enhanced batch updates on records and related records system and method | |
CN108959294B (en) | Method and device for accessing search engine | |
CN117056240A (en) | Data element development and debugging method and system supporting offline Jar package | |
CN116303309A (en) | File mounting method and device and electronic equipment | |
US10956407B2 (en) | Automatic detection of problems in a large-scale multi-record update system and method | |
CN110851126A (en) | Method and device for configuring homemade private library on iOS platform | |
CN113835737A (en) | Method and system for adding authority to front-end project | |
CN111124883A (en) | Test case library introduction method, system and equipment based on tree form | |
CN115757639A (en) | Data source synchronization method and device, electronic equipment and storage medium | |
CN114489607A (en) | Cross-stack application processing and page rendering method, device, equipment and storage medium | |
CN112150091B (en) | Business rule processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200228 |