CN106951227A - A kind of method and apparatus for updating navigation bar - Google Patents

A kind of method and apparatus for updating navigation bar Download PDF

Info

Publication number
CN106951227A
CN106951227A CN201710090700.8A CN201710090700A CN106951227A CN 106951227 A CN106951227 A CN 106951227A CN 201710090700 A CN201710090700 A CN 201710090700A CN 106951227 A CN106951227 A CN 106951227A
Authority
CN
China
Prior art keywords
navigation bar
updated
array
information
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.)
Granted
Application number
CN201710090700.8A
Other languages
Chinese (zh)
Other versions
CN106951227B (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

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 present invention provides a kind of method and apparatus for updating navigation bar, and method includes:When starting tab bar controller, the request for whether updating navigation bar is sent to server, and receive in the navigation bar data that the server is replied, navigation bar data containing certain amount information to be updated;When the type of the navigation bar data is array, all information to be updated are ranked up, local navigation bar data is deleted and preserves the navigation bar data after sequence;And the order based on all information to be updated in local navigation bar data, the information of local navigation bar data is updated successively.Present invention, avoiding first load to update the low situation of caused serious forgiveness again, facilitate backstage to be investigated, and no matter network connection success or not, navigation bar data can be loaded, with good adaptability, without resubmiting version to appstore or Android application market.

Description

A kind of method and apparatus for updating navigation bar
Technical field
The present invention relates to field of computer technology, more particularly, to the method and apparatus for updating navigation bar.
Background technology
With the development of internet, mobile app turns into an important entrance of mobile Internet, now each mobile phone Tens to up to a hundred app can be installed, the characteristics of app compares web is that app content structure is relatively fixed, unlike web content Framework can be changed at any time, and user can see at any time.
Because app main framework is typically all fixed, it is necessary to carry again when needing to do big framework adjustment Hand over version to appstore or Android application market, the version of submission is carried out again by appstore or Android application market Examination & verification, and this will necessarily delay app renewal popularization.
Navigation bar refers to the navigation button for being located at header or footer area, and it plays link each interface of app or the page Effect, the usage experience for app is extremely important, therefore adjustment navigation bar is also the adjustment for belonging to big structure, prior art For update navigation bar method more than using it is mentioned above submit version again to application market by the way of, therefore, urgent need one Application market can be bypassed by planting, the method for being directly just updated navigation bar when user opens software.
The content of the invention
The present invention provides a kind of side for the renewal navigation bar for overcoming above mentioned problem or solving the above problems at least in part Method and device.
According to an aspect of the present invention there is provided a kind of method for updating navigation bar, including:
S1, when starting tab bar controller, send whether update the request of navigation bar to server, and receive the clothes Contain certain amount information to be updated in the navigation bar data that business device is replied, the navigation bar data;
S2, when the navigation bar data type be array when, all information to be updated are ranked up, delete Local navigation bar data simultaneously preserve the navigation bar data after sequence;And
S3, the order based on all information to be updated in local navigation bar data, update the navigation column number successively Information to be updated in.
According to another aspect of the present invention, a kind of device for updating navigation bar is also provided, including:
Receiver module, for when starting tab bar controller, the request for whether updating navigation bar to be sent to server, and Receive in the navigation bar data that the server is replied, the navigation bar data containing certain amount information to be updated;
Order module, for when the type of the navigation bar data is array, all information to be updated to be entered Contain information to be updated to be presented in row sequence, the navigation bar data;And
Update module, based on the order of all information to be updated in local navigation bar data, leads described in renewal successively To be updated information of the column number of navigating in.
The application proposes a kind of method and apparatus for updating navigation bar, by when starting tab bar controller to server Send and update request, be to send the best opportunity for updating request, it is to avoid first load and update the low situation of caused serious forgiveness again, Pass through the data for judging to reply, it is ensured that no matter app, which runs into network problem or data problem, can navigation bar;By that will treat The type of the information of renewal is converted to model, facilitates backstage to be investigated, and no matter network connection success or not, can add Carry navigation bar data, with good adaptability, by using the unique encodings of information to be updated as the opinion of sequence, can be with The display order of navigation bar is flexibly determined by backstage, the content structure of navigation can be changed at any time, and user can also see at any time Arrive, without resubmiting version to appstore or Android application market.
Brief description of the drawings
Fig. 1 is the method flow diagram of the renewal navigation bar according to the embodiment of the present invention;
Fig. 2 is the navigation bar schematic diagram of an application program in the prior art.
Embodiment
With reference to the accompanying drawings and examples, the embodiment to the present invention is described in further detail.Implement below Example is used to illustrate the present invention, but is not limited to the scope of the present invention.
In order to overcome the more redaction that must resubmit app when updating navigation bar in the prior art to application market, Caused to delay the problem of popularization app updates, the present invention provides a kind of method for updating navigation bar.
Fig. 1 shows the method flow schematic diagram of the renewal navigation bar of the embodiment of the present invention, including:
S1, when starting tab bar controller, send whether update the request of navigation bar to server, and receive the clothes Contain certain amount information to be updated in the navigation bar data that business device is replied, the navigation bar data;
S2, when the navigation bar data type be array when, all information to be updated are ranked up, delete Local navigation bar data simultaneously preserve the navigation bar data after sequence;And
S3, the order based on all information to be updated in local navigation bar data, update local navigation bar successively The information of data.
Tab bar controller, i.e. UITabBarController controllers, are a kind of UI for administration view controller Control, one tab bar in its enclosed inside, the management of label is horizontal, controller is changed by the switching of label, General custom regard tabBar as the Root View controller of application program, addition navigation wherein, right in navigation ViewController is managed.
Navigation bar data include icon, title and the sequence of the navigation bar of application program, and Fig. 2 shows an application The navigation bar schematic diagram of program, as shown in Figure 2, in figure " wechat ", " address list " of lower section, " it was found that " and " I ", i.e., For the title in navigation bar, the figure as icon above title is abutted against, and the order of each icon from left to right is navigation bar Sequence, be it is fixed, in the prior art, if the application program want change navigation bar, must just resubmit more new edition Originally to application market.
By start tab bar controller when to server send update request, be send update request it is optimal when Machine, it is to avoid first load and update the low situation of caused serious forgiveness again, passes through the data for judging to reply, it is ensured that no matter app runs into Network problem or data problem can have navigation bar;By the way that the type of information to be updated is converted to after model, convenience Platform is investigated, and no matter network connection success or not, navigation bar data can be loaded, with good adaptability, lead to Cross the unique encodings of information to be updated as the opinion of sequence, can flexibly determine that the display of navigation bar is suitable by backstage Sequence, the content structure of navigation can be changed at any time, and user can also see at any time, without resubmit version to appstore or Person's Android application market.
In one embodiment, step S2 also includes:
When the defeated type of the navigation bar is not array, retain local navigation bar data.I.e. when the type is not During array, based on the order of all information to be updated in local navigation bar data, update successively in the navigation bar data Information to be updated.
The data that this step is replied by judgement, it is ensured that can have no matter app runs into network problem or data problem Navigation bar.
In one embodiment, the step S2 includes:
Whether S2.1, the type for judging the navigation bar data are array, contain certain amount in the navigation bar data Individual information to be updated, any one information to be updated contains unique encodings.
Array is to go the set of arrangement in certain sequence, goes to deposit value by subscript, when wishing that data are according to certain suitable When sequence goes arrangement, it should which selection uses array.Unique encodings are ID, the present invention in, using the ID of information to be updated as The foundation of sequence.
S2.2, when the navigation bar data type be array when, the navigation bar data are converted into the second array simultaneously It is stored in locally, the type of each information to be updated is model in second array.
It is model by information processing to be updated, and stores, it is convenient subsequently to need to adjust when navigation bar data With.
S2.3, the unique encodings based on each information to be updated in second array, to all letters to be updated Breath is ranked up, and obtains the 3rd array.
In one embodiment, the step S2.2 is specifically included:
S2.2.1, when the navigation bar data type be id types (can be any type) when, by the navigation The coercion of type of column number evidence is converted to array, obtains the first array, this step is a forced type transfer process, by navigation bar The type that data are converted to each information to be updated in suitable type, first array is dictionary.Dictionary:Pass through Key access values, obtain a specific mark, the value accurately needed.
S2.2.2, the type of each information to be updated in first array is converted into model, obtains second number Group.
Model (model), contains Core Feature and data, i.e. core business logic.
In one embodiment, the request for whether updating navigation bar is sent in the step S1 to server, is specifically included:
The request for whether updating navigation bar is sent to server using sentence Networking getWithUrl.
Sentence Networking getWithUrl are specially:
In one embodiment, whether the type for the navigation bar data being judged in the step S2.1 is array, specifically Including:
Use response isKindOfClass:[NSArray class] sentence judges the class of the navigation bar data Whether type is array.
In one embodiment, the navigation bar data are converted into the first array in the step S2.2.1, specific bag Include:
Using sentence NSArray*deserializedArray=(NSArray*) response by the navigation bar data Be converted to the first array.
In one embodiment, first array is converted into the second array in the step S2.2.2, specifically included:
Use function NSMutableArray*menuAllArr=WSOneMenuModel ObjectArrayWithKeyValuesArray, the second array, i.e. menuAllArr are converted to by first array.
In one embodiment, the step S2.3 is specifically included:Based on each to be updated in second array The unique encodings of information, are ranked up using all information to be updated of getTabbarArr function pairs, obtain the 3rd array.
Wherein, the getTabbarArr functions include:
The 3rd array newArr is created using sentence NSMutableArray array;
Use for (int i=0;i<arr.count;I++ for circulations) are created;
The data that needs are taken out in each for circulations use [newArr addObject:model];It is added to the 3rd number In group;
Use sentence arraySort sortedArrayUsingComparator:^NSComparisonResult (WSOneMenuModel*obj1, WSOneMenuModel*obj2 are ranked up to the 3rd array;
NSComparisonResult result=[getStrFromIntger (obj1.Parentid) compare: getStrFromIntger(obj2.id)]。
In one embodiment, when the type of the navigation bar data is array, [self loadMenu are used: YES];Function loads navigation bar data successively.
In one embodiment, when the type of the navigation bar data is not array, [self loadMenu are used: NO];Function goes to load local navigation bar data.
In one embodiment, the present invention also provides a kind of device for updating navigation bar, including:
Receiver module, for when starting tab bar controller, the request for whether updating navigation bar to be sent to server, and Receive in the navigation bar data that the server is replied, the navigation bar data containing certain amount information to be updated;
Order module, for when the type of the navigation bar data is array, all information to be updated to be entered Contain information to be updated to be presented in row sequence, the navigation bar data;And
Update module, for the order based on all information to be updated in local navigation bar data, updates institute successively State the information in navigation bar data.
In one embodiment, the order module is specifically included:
Judging unit, whether the type for judging the navigation bar data is array, is contained in the navigation bar data Certain amount information to be updated, any one information to be updated contains unique encodings;
Model conversion unit, for when the type of the navigation bar data is array, by the navigation bar data conversion For the second array and it is stored in local, the type of each information to be updated is model in second array;And
Sequencing unit, for the unique encodings based on each information to be updated in second array, to being needed The information of renewal is ranked up, and obtains the 3rd array.
In one embodiment, model conversion unit further comprises:
Dictionary subregion is strong by the type of the navigation bar data for when the type of the navigation bar data is array System is converted to array, and the type for obtaining each information to be updated in the first array, first array is dictionary;And
Model division, for the type of each information to be updated in first array to be converted into model, obtains described Second array.
In one embodiment, the present invention discloses a kind of computer program product, and the computer program product includes depositing The computer program on non-transient computer readable storage medium storing program for executing is stored up, the computer program includes programmed instruction, when described When programmed instruction is computer-executed, computer is able to carry out the method that above-mentioned each method embodiment is provided, for example including:
S1, when starting tab bar controller, send whether update the request of navigation bar to server, and receive the clothes Contain certain amount information to be updated in the navigation bar data that business device is replied, the navigation bar data;
S2, when the navigation bar data type be array when, all information to be updated are ranked up, delete Local navigation bar data simultaneously preserve the navigation bar data after sequence;And
S3, the order based on all information to be updated in local navigation bar data, update local navigation bar successively The information of data.
In one embodiment, the invention discloses a kind of non-transient computer readable storage medium storing program for executing, the non-transient meter Calculation machine readable storage medium storing program for executing stores computer instruction, and the computer instruction makes the computer perform above-mentioned each method embodiment The method provided, for example including:
S1, when starting tab bar controller, send whether update the request of navigation bar to server, and receive the clothes Contain certain amount information to be updated in the navigation bar data that business device is replied, the navigation bar data;
S2, when the navigation bar data type be array when, all information to be updated are ranked up, delete Local navigation bar data simultaneously preserve the navigation bar data after sequence;And
S3, the order based on all information to be updated in local navigation bar data, update local navigation bar successively The information of data.
Finally, the present processes are only preferably embodiment, are not intended to limit the scope of the present invention.It is all Within the spirit and principles in the present invention, any modifications, equivalent substitutions and improvements made etc. should be included in the protection of the present invention Within the scope of.

Claims (10)

1. a kind of method for updating navigation bar, it is characterised in that including:
S1, when starting tab bar controller, send whether update the request of navigation bar to server, and receive the server Contain the information that certain amount is to be updated in the navigation bar data of reply, the navigation bar data;
S2, when the type of the navigation bar data is array, all information to be updated are ranked up, deleted local Navigation bar data and preserve sequence after navigation bar data;And
S3, the order based on all information to be updated in local navigation bar data, update local navigation bar data successively Information.
2. the method for navigation bar is updated as claimed in claim 1, it is characterised in that step S2 also includes:
When the defeated type of the navigation bar is not array, retain local navigation bar data.
3. the method for navigation bar is updated as claimed in claim 1, it is characterised in that the step S2 includes:
Whether S2.1, the type for judging the navigation bar data are array, wherein containing certain amount in the navigation bar data Individual information to be updated, any one information to be updated contains unique encodings;
S2.2, when the navigation bar data type be array when, the navigation bar data are converted into the second array and stored Local, the type of each information to be updated is model in second array;And
All information to be updated are entered by S2.3, the unique encodings based on each information to be updated in second array Row sequence, obtains the 3rd array.
4. the method for navigation bar is updated as claimed in claim 3, it is characterised in that the step S2.2 is specifically included:
S2.2.1, when the navigation bar data type be id types when, the coercion of type of the navigation bar data is converted to Array, the type for obtaining each information to be updated in the first array, first array is dictionary;And
S2.2.2, the type of each information to be updated in first array is converted into model, obtains second array.
5. the method for navigation bar is updated as claimed in claim 1, it is characterised in that being sent in the step S1 to server is The no request for updating navigation bar, is specifically included:
The request for whether updating navigation bar is sent to server using sentence Networking getWithUrl.
6. the method for navigation bar is updated as claimed in claim 3, it is characterised in that judge the navigation in the step S2.1 Whether the type of column number evidence is array, is specifically included:
Use response isKindOfClass:[NSArray class] sentence judges that the type of the navigation bar data is No is array.
7. the method for navigation bar is updated as claimed in claim 4, it is characterised in that by the navigation in the step S2.2.1 The coercion of type of column number evidence is converted to array, specifically includes:
Using sentence NSArray*deserializedArray=(NSArray*) response by the class of the navigation bar data Type unsteady state operation is array.
8. the method for navigation bar is updated as claimed in claim 4, it is characterised in that by described first in the step S2.2.2 The type of each information to be updated is converted into model in array, specifically includes:
Using function WSOneMenuModel objectArrayWithKeyValuesArray, will respectively it be treated in first array The type of the information of renewal is converted into model.
9. the method for navigation bar is updated as claimed in claim 3, it is characterised in that the step S2.3 is specifically included:It is based on The unique encodings of each information to be updated in second array, it is all to be updated using getTabbarArr function pairs Information is ranked up, and obtains the 3rd array.
10. a kind of device for updating navigation bar, it is characterised in that including:
Receiver module, for when starting tab bar controller, the request for whether updating navigation bar being sent to server, and receive Contain the information that certain amount is to be updated in the navigation bar data that the server is replied, the navigation bar data;
Order module, for when the type of the navigation bar data is array, all information to be updated to be arranged Sequence, deletes local navigation bar data and preserves the navigation bar data after sequence;And
Update module, for the order based on all information to be updated in local navigation bar data, leads described in renewal successively Information of the column number of navigating in.
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 true CN106951227A (en) 2017-07-14
CN106951227B 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)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653513A (en) * 2015-12-30 2016-06-08 北京农信互联科技有限公司 Pig farm management based form input method and system
CN110069309A (en) * 2019-04-23 2019-07-30 广州华多网络科技有限公司 A kind of page configuration method, system and client
CN111596992A (en) * 2020-04-28 2020-08-28 北京字节跳动网络技术有限公司 Navigation bar display method and device and electronic equipment
WO2023125113A1 (en) * 2021-12-28 2023-07-06 掌阅科技股份有限公司 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

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105653513A (en) * 2015-12-30 2016-06-08 北京农信互联科技有限公司 Pig farm management based form input method and system
CN110069309A (en) * 2019-04-23 2019-07-30 广州华多网络科技有限公司 A kind of page configuration method, system and client
CN111596992A (en) * 2020-04-28 2020-08-28 北京字节跳动网络技术有限公司 Navigation bar display method and device and electronic equipment
WO2023125113A1 (en) * 2021-12-28 2023-07-06 掌阅科技股份有限公司 Navigation bar display method, electronic device and storage medium

Also Published As

Publication number Publication date
CN106951227B (en) 2020-03-17

Similar Documents

Publication Publication Date Title
CN106951227A (en) A kind of method and apparatus for updating navigation bar
CN108648810B (en) Data processing method and device for medical audit and computer readable storage medium
KR102204527B1 (en) Method and apparatus for updating application, and device computer readable storage medium
US10843079B2 (en) Game development system
US10688397B2 (en) Information processing device, non-transitory computer readable medium, and information processing method
CN102402573A (en) Form processing apparatus, form processing method
CN105335419B (en) Web page picture loading method and device
CN104461621B (en) A kind of method and device of Update attribute information
US20150205496A1 (en) Method and system for visualization of algorithmic guidelines
CN106575288A (en) Printer, printing system and print control method
CN110020276A (en) The compatible processing method and processing device of the H5 page is embedded in a kind of APP
CN103077049A (en) Smart method and system for updating desktop navigation bar
CN108829587A (en) Test case parameter replacing method, device, computer equipment and storage medium
JP6000804B2 (en) Work procedure management system, work procedure management method, and work procedure management program
CN111459460B (en) Service data processing method and system
CN114764556A (en) Data processing method, data processing device, computer equipment and storage medium
WO2015198463A1 (en) Information processing device, information processing method, program, storage medium, and password entering device
JP5796265B2 (en) System and method for configuration management and distribution
CN110879871B (en) Page menu configuration method and device
JP5092470B2 (en) Receipt check device, receipt check method, program, and recording medium
JP6114784B2 (en) System and method for configuration management and distribution
JP2015036908A (en) Plant inspection support system
CN104106014B (en) Programable display, program
CN111459580A (en) Page display method and device
CN109947398A (en) Triple integral method for solving, device, terminal device and readable storage medium storing program for executing

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