iOS Development note 1:todolist, albums, map apps, and Sina Weibo

Source: Internet
Author: User

Some time ago did some small things, some key points of the record summarized as follows

1.ToDoList

The main use of UITableView and Nsuserdefaults to complete task management, can create new, edit and delete tasks.

Because it is a demo nature, data persistence is done using nsuserdefaults, which is stored as a plist in the application sandbox. It is important to note that the data needs to be synchronized immediately "[[[nsuserdefaults standarduserdefaults] synchronize]", Prevent data loss, such as application crashes, when encountering unusual conditions.

When you enter the application, the existing data is read from the sandbox.

As below, can create new, edit and delete tasks, red for the task to be processed, click the cell color into Green Representative has completed, then click Red, by clicking on the cell Update task processing, and other TableView common view details, sorting and so on.

2. Albums

The main use of coredata to do data persistence layer storage data, using the system's own core Image filter to do the filter function (on the simulator filter processing is very slow).

Need to be aware of the CoreData model update after the compilation error, check the code is correct, may rebuild the model or delete the corresponding program on the emulator to compile the normal, temporarily did not find the reason, CoreData is the iOS comes with the ORM framework, but feel the water is a bit deep, need to be specifically studied.

Use the core image filter to pay attention to the spelling of FilterName, detailed reference:Core image filter Reference

3. Map Application

Primarily using the ArcGIS Runtime SDK for IOS 10.2.4 Development, there are a few things to note:

(1) iOS8 start, use positioning function need to set in Info.plist

Set "Nslocationwheninuseusagedescription" and "nslocationalwaysusagedescription" so that when the app runs, the prompt box pops up for the user to select, In other words, you'll see that some apps start with a hint that you're allowed to get location information all the time or only when the app is running. For example, adding "nslocationwheninuseusagedescription" to the Info.plist, value represents the prompt in the popup box.

(2) in the simulator can be created by a new GPX file to simulate a specific location information, debugging select based on this GPX file to locate.

(3) Coordinate system conversion, because ArcGIS Runtime SDK for IOS does not directly provide wgs1984 to Webmercator conversion method, can be converted by the following methods

-(Agspoint *) Wgs1984point2webmercatorpoint: (Agspoint *) point{    Double x = point.x * 20037508.34/180;    Double y = log (Tan ((+ point.y) * m_pi/360))/(m_pi/180);    y = y * 20037508.34/180;    Agspoint *webmercatorpoint = [[Agspoint alloc] initwithx:x                                                           y:y                                            spatialreference:[agsspatialreference spatialreferencewithwkid:3857]]; return Webmercatorpoint;}      

(4) Through the Code control interface rotation direction, through the engineering settings to control the direction of equipment rotation.

(5) Some third-party class libraries used:

Drop-down refresh control mjrefresh , cluster analysis clusterlayer-plugin-ios, dynamic input Box As well as commonly used Jsonkit, afnetworking, Mbprogresshud

Weather forecast information is called by the Baidu API store to find third-party APIs:http://apistore.baidu.com/astore/serviceinfo/1798.html

(6) When using afnetworking, the data return format is "Text/plain", afnetworking default support format is not this, you need to add this format in Source AFHTTPRESPONSESERIALIZER.M.

(Render comparison card on simulator):

4. Sina Weibo

(1) For background images can be set to stretch mode directly in Xcode

(2) Use KVC to read and write ReadOnly member variables, such as rewriting the Tabbarviewcontroller, and re-setting the Tabbar to make it easier to implement custom control effects.

(3) using Scrollview+pagecontrol to achieve the effect of the new feature page, the move ScrollView need to achieve full page flipping effect, and the actual ScrollView has provided a property pagingenabled, enable, Otherwise, the default scrolling effect is ScrollView.

(4) When the app enters the background state, if you want to display the number of unread Weibo on the app icon, you need to set the permission, otherwise the error "" attempting to badge the application icon but haven ' t received permission From the user to badge the application "

Resources:

http://stackoverflow.com/questions/25973364/ attempting-to-badge-the-application-icon-but-havent-received-permission-from-th

https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/ Chapters/iphoneosclientimp.html#//apple_ref/doc/uid/tp40008194-ch103-sw2

(5) Xcode6 if you want to set the boot image as before, you need to create a new launchimage, and modify the settings.

:

5.Xcode Plug-in

Recommended two plugins: Write comments dedicated vvdocumenter, picture Preview plug-in ksimagenamed

ksimagenamed

iOS Development note 1:todolist, albums, map apps, and Sina Weibo

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.