CN106951227B - Method and device for updating navigation bar - Google Patents

Method and device for updating navigation bar Download PDF

Info

Publication number
CN106951227B
CN106951227B CN201710090700.8A CN201710090700A CN106951227B CN 106951227 B CN106951227 B CN 106951227B CN 201710090700 A CN201710090700 A CN 201710090700A CN 106951227 B CN106951227 B CN 106951227B
Authority
CN
China
Prior art keywords
navigation bar
array
information
updated
bar data
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.)
Active
Application number
CN201710090700.8A
Other languages
Chinese (zh)
Other versions
CN106951227A (en
Inventor
汪刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710090700.8A priority Critical patent/CN106951227B/en
Publication of CN106951227A publication Critical patent/CN106951227A/en
Application granted granted Critical
Publication of CN106951227B publication Critical patent/CN106951227B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Human Computer Interaction (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Information Transfer Between Computers (AREA)
  • Navigation (AREA)

Abstract

The invention provides a method and a device for updating a navigation bar, wherein the method comprises the following steps: when the label bar controller is started, sending a request for updating the navigation bar to a server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated; when the type of the navigation bar data is an array, sequencing all the information to be updated, deleting the local navigation bar data and storing the sequenced navigation bar data; and sequentially updating the information of the local navigation bar data based on the sequence of all the information to be updated in the local navigation bar data. The method avoids the condition of low fault tolerance rate caused by loading first and then updating, is convenient for the background to investigate, can load the navigation bar data no matter whether the network connection is successful or not, has good adaptability, and does not need to re-submit the version to the apptore or android application market.

Description

Method and device for updating navigation bar
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method and an apparatus for updating a navigation bar.
Background
With the development of the internet, mobile apps become an important entrance of the mobile internet, and now each mobile phone is installed with dozens to hundreds of apps, and the content architecture of apps is relatively fixed, unlike the content architecture of web, which can be changed at any time, and can be seen by users at any time.
Because the main framework of the app is generally fixed, when large framework adjustment is needed, the version needs to be resubmitted to the apptore or the android application market, and the resubmitted version is reviewed by the apptore or the android application market, which inevitably delays the update popularization of the app.
The navigation bar is a navigation button located in a header or footer area, and plays a role in linking each interface or page of the app, and is very important for the use experience of the app, so that adjusting the navigation bar is also an adjustment belonging to a large structure.
Disclosure of Invention
The present invention provides a method and apparatus for updating a navigation bar that overcomes, or at least partially solves, the above-mentioned problems.
According to an aspect of the present invention, there is provided a method of updating a navigation bar, including:
s1, when the tab bar controller is started, sending a request for updating the navigation bar to the server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
s2, when the type of the navigation bar data is an array, sorting all the information to be updated, deleting the local navigation bar data and storing the sorted navigation bar data; and
and S3, sequentially updating the information to be updated in the navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
According to another aspect of the present invention, there is also provided an apparatus for updating a navigation bar, including:
the receiving module is used for sending a request for updating the navigation bar to a server when the label bar controller is started, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
the sorting module is used for sorting all the information to be updated when the type of the navigation bar data is an array, and the navigation bar data contains the information to be displayed and updated; and
and the updating module is used for sequentially updating the information to be updated in the navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
The application provides a method and a device for updating a navigation bar, an update request is sent to a server when a tag bar controller is started, the update request is sent at the best time, the condition of low fault tolerance rate caused by loading before updating is avoided, and the navigation bar can be ensured to exist in an app no matter whether the app encounters a network problem or a data problem by judging replied data; through the type conversion of the information to be updated into the model, the background is convenient for investigation, and no matter whether the network connection is successful or not, the navigation bar data can be loaded, so that the method has good adaptability, the display sequence of the navigation bar can be flexibly determined through the background by taking the unique code of the information to be updated as the ranking suggestion, the navigation content architecture can be changed at any time, and a user can also see the navigation bar at any time without re-submitting the version to the apptore or the android application market.
Drawings
FIG. 1 is a flow chart of a method of updating a navigation bar according to an embodiment of the present invention;
FIG. 2 is a diagram of a navigation bar of an application in the prior art.
Detailed Description
The following detailed description of embodiments of the present invention is provided in connection with the accompanying drawings and examples. The following examples are intended to illustrate the invention but are not intended to limit the scope of the invention.
In order to overcome the problem that the update version of the app needs to be resubmitted to the application market when the navigation bar is updated in the prior art, so that the update of the app is delayed and popularized, the invention provides a method for updating the navigation bar.
Fig. 1 is a flowchart illustrating a method for updating a navigation bar according to an embodiment of the present invention, including:
s1, when the tab bar controller is started, sending a request for updating the navigation bar to the server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
s2, when the type of the navigation bar data is an array, sorting all the information to be updated, deleting the local navigation bar data and storing the sorted navigation bar data; and
and S3, sequentially updating the information of the local navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
The tab bar controller, i.e. the uitabbar controller, is a UI control for managing the view controller, and a tab bar is encapsulated in the tab bar controller, and the management of the tab bar is horizontal, and the tab bar controller is changed by switching the tab bar.
The navigation bar data includes icons, names and ranks of navigation bars of the application programs, fig. 2 shows a schematic view of a navigation bar of an application program, as can be seen from fig. 2, "WeChat", "Address", "find" and "I" located below the drawing are names in the navigation bar, the drawing immediately above the names is the icons, and the left-to-right sequence of the icons is the ranks of the navigation bar, which is fixed.
By sending the update request to the server when the tab bar controller is started, the update request is the best time for sending the update request, the condition of low fault tolerance rate caused by loading first and then updating is avoided, and the condition that the app can have a navigation bar no matter whether the app encounters a network problem or a data problem is ensured by judging the replied data; through the type conversion of the information to be updated into the model, the background is convenient for investigation, and no matter whether the network connection is successful or not, the navigation bar data can be loaded, so that the method has good adaptability, the display sequence of the navigation bar can be flexibly determined through the background by taking the unique code of the information to be updated as the ranking suggestion, the navigation content architecture can be changed at any time, and a user can also see the navigation bar at any time without re-submitting the version to the apptore or the android application market.
In one embodiment, step S2 further includes:
and when the input type of the navigation bar is not an array, retaining the local navigation bar data. When the type is not an array, sequentially updating the information to be updated in the navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
In the step, the returned data is judged, so that the navigation bar can be provided for the app no matter the app encounters a network problem or a data problem.
In one embodiment, the step S2 includes:
s2.1, judging whether the type of the navigation bar data is an array or not, wherein the navigation bar data contains a certain amount of information to be updated, and any one of the information to be updated contains a unique code.
The array is a set sorted according to a certain sequence, values are stored through subscripts, and when the data are expected to be sorted according to a certain sequence, the array is selected to be used. The unique code is ID, and in the invention, the ID of the information to be updated is used as the basis for sorting.
S2.2, when the type of the navigation bar data is an array, converting the navigation bar data into a second array and storing the second array locally, wherein the type of each piece of information to be updated in the second array is a model.
And processing the information to be updated into a model, and storing the model to facilitate calling when navigation bar data is needed subsequently.
S2.3, sequencing all the information to be updated based on the unique code of each information to be updated in the second array to obtain a third array.
In one embodiment, the step S2.2 specifically includes:
s2.2.1, when the type of the navigation bar data is id type (that is, any type), forcibly converting the type of the navigation bar data into an array to obtain a first array, where this step is a forced type conversion process to convert the navigation bar data into an appropriate type, and the type of each piece of information to be updated in the first array is a dictionary. A dictionary: and acquiring a specific identifier through the key access value to accurately obtain the required value.
S2.2.2, converting the type of each information to be updated in the first array into a model, and obtaining the second array.
Model (model), which contains core functionality and data, i.e. core business logic.
In an embodiment, the sending, to the server, a request whether to update the navigation bar in step S1 specifically includes:
and sending a request for updating the navigation bar to the server by using a sentence Networking getWithUrl.
The statement Networking getWithUrl is specifically:
Figure BDA0001228844240000061
in an embodiment, the step S2.1 of determining whether the type of the navigation bar data is an array specifically includes:
and judging whether the type of the navigation bar data is an array or not by using a response iskindoofclass: [ NSArray class ] statement.
In an embodiment, the converting the navigation bar data into the first array in step S2.2.1 specifically includes:
the navigation bar data is converted into the first array using the statement NSArray deserializedArray (NSArray) response.
In an embodiment, the converting the first array into the second array in the step S2.2.2 specifically includes:
the first array is converted into a second array, namely, menualalarr, using the function nsmunablearray menuadelobjectarraywithkeyvaluesarray.
In one embodiment, the step S2.3 specifically includes: and based on the unique code of each information to be updated in the second array, sequencing all the information to be updated by using a getTabbarr function to obtain a third array.
Wherein the getTabbarArr function comprises:
creating a third array newArr using the statement NSMutableArray array;
creating a for loop using for (int i ═ 0; i < arr.count; i + +);
fetching the required data in each for loop uses [ newArr addObject: model ]; adding to the third array;
sorting the third array using the statement arraystart sortedarrayungcompositor ^ NSComparison result (WSOneNuModel ^ obj1, WSOneNuModel ^ obj 2;
NSComparisonResult result=[getStrFromIntger(obj1.Parentid)compare:getStrFromIntger(obj2.id)]。
in one embodiment, when the type of the navigation bar data is array, [ self loadMenu: YES ] is used; the function loads the navigation bar data in sequence.
In one embodiment, when the type of the navigation bar data is not an array, [ self loadMenu: NO ] is used; the function loads the local navigation bar data.
In one embodiment, the present invention further provides an apparatus for updating a navigation bar, including:
the receiving module is used for sending a request for updating the navigation bar to a server when the label bar controller is started, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
the sorting module is used for sorting all the information to be updated when the type of the navigation bar data is an array, and the navigation bar data contains the information to be displayed and updated; and
and the updating module is used for sequentially updating the information in the navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
In one embodiment, the sorting module specifically includes:
the judging unit is used for judging whether the type of the navigation bar data is an array or not, the navigation bar data contains a certain amount of information to be updated, and any one piece of information to be updated contains a unique code;
the model conversion unit is used for converting the navigation bar data into a second array and storing the second array locally when the type of the navigation bar data is an array, wherein the type of each piece of information to be updated in the second array is a model; and
and the sorting unit is used for sorting all the information to be updated based on the unique code of each information to be updated in the second array to obtain a third array.
In one embodiment, the model conversion unit further comprises:
the dictionary partition is used for forcibly converting the type of the navigation bar data into an array when the type of the navigation bar data is the array to obtain a first array, wherein the type of each piece of information to be updated in the first array is a dictionary; and
and the model partition is used for converting the type of each information to be updated in the first array into a model to obtain the second array.
In one embodiment, the present invention discloses a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the methods provided by the above-described method embodiments, for example, comprising:
s1, when the tab bar controller is started, sending a request for updating the navigation bar to the server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
s2, when the type of the navigation bar data is an array, sorting all the information to be updated, deleting the local navigation bar data and storing the sorted navigation bar data; and
and S3, sequentially updating the information of the local navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
In one embodiment, the present invention discloses a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform a method provided by the above method embodiments, for example, comprising:
s1, when the tab bar controller is started, sending a request for updating the navigation bar to the server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
s2, when the type of the navigation bar data is an array, sorting all the information to be updated, deleting the local navigation bar data and storing the sorted navigation bar data; and
and S3, sequentially updating the information of the local navigation bar data based on the sequence of all the information to be updated in the local navigation bar data.
Finally, the method of the present application is only a preferred embodiment and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (9)

1. A method of updating a navigation bar, comprising:
s1, when the tab bar controller is started, sending a request for updating the navigation bar to the server, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
s2, when the type of the navigation bar data is an array, sorting all the information to be updated, deleting the local navigation bar data and storing the sorted navigation bar data; and
s3, sequentially updating the information of the local navigation bar data based on the sequence of all the information to be updated in the local navigation bar data;
the step S2 includes:
s2.1, judging whether the type of the navigation bar data is an array or not, wherein the navigation bar data contains a certain amount of information to be updated, and any one of the information to be updated contains a unique code;
s2.2, when the type of the navigation bar data is an array, converting the navigation bar data into a second array and storing the second array locally, wherein the type of each piece of information to be updated in the second array is a model; and
s2.3, sequencing all the information to be updated based on the unique code of each information to be updated in the second array to obtain a third array.
2. The method for updating a navigation bar of claim 1, wherein step S2 further comprises:
and when the type of the navigation bar data is not an array, retaining the local navigation bar data.
3. The method of updating a navigation bar of claim 1, wherein the step S2.2 specifically comprises:
s2.2.1, when the type of the navigation bar data is an id type, forcibly converting the type of the navigation bar data into an array to obtain a first array, wherein the type of each piece of information to be updated in the first array is a dictionary; and
s2.2.2, converting the type of each information to be updated in the first array into a model, and obtaining the second array.
4. The method for updating a navigation bar according to claim 1, wherein the step S1 of sending a request to a server for updating the navigation bar specifically includes:
and sending a request for updating the navigation bar to the server by using a sentence Networking getWithUrl.
5. The method according to claim 3, wherein the step S2.1 of determining whether the type of the navigation bar data is an array specifically comprises:
and judging whether the type of the navigation bar data is an array or not by using a response iskindoofclass: [ NSArray class ] statement.
6. The method for updating a navigation bar of claim 3, wherein the step S2.2.1 of forcibly converting the type of the navigation bar data into an array specifically comprises:
the type of the navigation bar data is forcibly converted into an array using a statement NSArray deserializedArray (NSArray) response.
7. The method of updating a navigation bar of claim 3, wherein the step S2.2.2 of converting the type of each information to be updated in the first array into a model specifically comprises:
and converting the type of each information to be updated in the first array into a model by using a function WSOneNuModel object ArrayWithKeyValuesArray.
8. The method of updating a navigation bar of claim 1, wherein the step S2.3 specifically comprises: and based on the unique code of each information to be updated in the second array, sequencing all the information to be updated by using a getTabbarr function to obtain a third array.
9. An apparatus for updating a navigation bar, comprising:
the receiving module is used for sending a request for updating the navigation bar to a server when the label bar controller is started, and receiving navigation bar data replied by the server, wherein the navigation bar data contains a certain amount of information to be updated;
the sorting module is used for sorting all the information to be updated when the type of the navigation bar data is an array, deleting the local navigation bar data and storing the sorted navigation bar data; and
the updating module is used for sequentially updating the information in the navigation bar data based on the sequence of all the information to be updated in the local navigation bar data;
the sorting module is specifically configured to:
judging whether the type of the navigation bar data is an array or not, wherein the navigation bar data contains a certain amount of information to be updated, and any one of the information to be updated contains a unique code;
when the type of the navigation bar data is an array, converting the navigation bar data into a second array and storing the second array locally, wherein the type of each piece of information to be updated in the second array is a model; and
and sequencing all the information to be updated based on the unique code of each information to be updated in the second array to obtain a third array.
CN201710090700.8A 2017-02-20 2017-02-20 Method and device for updating navigation bar Active CN106951227B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710090700.8A CN106951227B (en) 2017-02-20 2017-02-20 Method and device for updating navigation bar

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710090700.8A CN106951227B (en) 2017-02-20 2017-02-20 Method and device for updating navigation bar

Publications (2)

Publication Number Publication Date
CN106951227A CN106951227A (en) 2017-07-14
CN106951227B true CN106951227B (en) 2020-03-17

Family

ID=59466482

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710090700.8A Active CN106951227B (en) 2017-02-20 2017-02-20 Method and device for updating navigation bar

Country Status (1)

Country Link
CN (1) CN106951227B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653513B (en) * 2015-12-30 2019-10-11 北京农信互联科技有限公司 A kind of list input method and system based on pig farm management
CN110069309B (en) * 2019-04-23 2021-02-12 广州方硅信息技术有限公司 Page configuration method, system and client
CN111596992B (en) * 2020-04-28 2021-10-01 北京字节跳动网络技术有限公司 Navigation bar display method and device and electronic equipment
CN114265611A (en) * 2021-12-28 2022-04-01 掌阅科技股份有限公司 Navigation bar display method, electronic device and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077049A (en) * 2012-12-31 2013-05-01 福州瑞芯微电子有限公司 Smart method and system for updating desktop navigation bar
CN103246529A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Method, equipment and system for updating and pushing navigation bar

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103246529A (en) * 2012-02-13 2013-08-14 腾讯科技(深圳)有限公司 Method, equipment and system for updating and pushing navigation bar
CN103077049A (en) * 2012-12-31 2013-05-01 福州瑞芯微电子有限公司 Smart method and system for updating desktop navigation bar

Also Published As

Publication number Publication date
CN106951227A (en) 2017-07-14

Similar Documents

Publication Publication Date Title
CN106951227B (en) Method and device for updating navigation bar
CN108108297B (en) Method and device for automatic testing
CN110889270A (en) Form page document generation method and form page rendering method and device
US20100083098A1 (en) Streaming Information that Describes a Webpage
CN110955428A (en) Page display method and device, electronic equipment and medium
CN104820589B (en) A kind of method and its device of dynamic adaptation webpage
US11681507B2 (en) Composable context menus
CN110020325B (en) Page loading method, device, equipment and readable storage medium
US8576233B2 (en) Program generation device, program generation method, and computer-readable storage medium
CN108197024B (en) Embedded browser debugging method, debugging terminal and computer readable storage medium
CN108024136A (en) Load method, smart television and the computer-readable recording medium of user interface
US10951486B2 (en) Terminal device, UI expansion method, and UI expansion program
CN101957756A (en) System and method for rapidly generating intelligent mobile terminal program
CN114218890A (en) Page rendering method and device, electronic equipment and storage medium
CN112835809A (en) Test data setting method, device, equipment and medium based on browser
CN112417336B (en) Page display method and device, electronic equipment and storage medium
CN103838575A (en) Plug-in type page customization implementation method based on EXTJS frame
US9104573B1 (en) Providing relevant diagnostic information using ontology rules
CN106095886B (en) Data processing method and device
CN111125205A (en) Signboard data display method, terminal and storage medium
CN108156534B (en) Method and device for generating demonstration application and computer readable storage medium
CN110825622A (en) Software testing method, device, equipment and computer readable medium
CN106933613B (en) APP page loading method and device
CN113326079A (en) Service version switching method, switching device, electronic equipment and storage medium
CN109101515B (en) Rule configuration method, server and computer-readable storage medium

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
GR01 Patent grant
GR01 Patent grant