"Shangxuetang ios Elementary Video Tutorial" is Shangxuetang's complete set of video tutorials on Objective-C language from basic introduction to advanced proficiency. Objective-C is an essential language for iOS development. The course will provide in-depth coverage of Objective-C language. Detailed explanation, mainly explaining the basic syntax of Objective-C, object-oriented programming ideas, encapsulation (declaration and implementation of classes, getter and setter methods, properties), memory management, inheritance, polymorphism, classification, protocol, block, NSNumber, characters String, array, dictionary, date, file management, copy, etc.
Video playback address: http://www.php.cn/course/572.html
In the process of developing IOS Difficulties in:
1. In swift language? and! Question
I checked a lot of helpful webpages on the Internet, but they all had different opinions and I was confused. Fortunately, one webpage made it a little clearer.
To add my personal understanding, the swift language looks simple and elegant, but in fact it contains many mysteries. Why use it? and! , the purpose is to make the code clearer and provide the compiler with more clues to find more potential errors. It is a language released by Apple, which is in line with Apple's character. It requires you to clarify things before writing code, rather than leaving vague questions to the compiler to make decisions.
2. The logic of table view
Since the iOS system is not open source, if we want to implement the table function, we must install the predetermined routines of the system. There are several key points. The first one is its two agents, one of which is responsible for providing data. The so-called providing data is the two most important interface functions. The first one tells the system how many rows there are in the table, and the second one is responsible for providing data. It just tells the system what the data in each row is. The second one will be called multiple times. Suppose there are 10 rows in a page, then this interface function will be called 10 times. But not more than one page, because the system will only request data for the page currently seen by the user. If there are 100 pieces of data in the table, then it is implemented by discarding the old data and filling in the new data during the continuous scrolling process.
This is a proxy for the view, and the other proxy is for the controller, which is what the program does when the user clicks on an item in the table. The most commonly used one here is the didSelected interface function. Developers only need to write their own implementation code here. Be careful not to write into didDeselected. The function names here are easy to confuse. Deselected is the interface called when an item changes from selected to unselected. When I first wrote this, I always felt like something was wrong, but I found out later.
When using the customer type prototype, how to access the label object inside? The use of tags.
Common table examples, the cells in the table only have a maximum of 2 labels, but I need to put 5 labels in my project, so how do I operate these labels in the code? Since the interface is pulled in IB, the labels in the cell cannot be pulled into the code through ctrl drag. Later, I saw an example of setting a tag value for each label, and then using viewByTag
UILabel *name = [cell viewWithTag:TAG_NAME]; UILabel *singer = [cell viewWithTag:TAG_SINGER]; UILabel *code = [cell viewWithTag:TAG_CODE]; UILabel *lang = [cell viewWithTag:TAG_LANG]; UILabel *type = [cell viewWithTag:TAG_TYPE];
in the code to get the corresponding label.
Later I learned by chance that it can still be accessed directly, but it is more troublesome. It is to define the cell with a class first, and then manually create the label statement in the interface. At this time, You can pull the wire from the storyboard to the table view.
This issue is discussed on this page.
Improper configuration of the table can easily cause the app to crash, and you will often see:
Crash in this place: AppDelegate: UIResponder, UIApplicationDelegate
The information displayed by debug is :
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UINavigationItem tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x7fd9d1760d70'
The reason is actually that I saw in the storyboard that the data source of the table view was not associated, so I associated the data to the table myself. Many times this kind of crash means that the associated datasource is incorrect, so you can try disconnecting it first. According to my understanding, because this bottom layer cannot be seen, I can only guess that it is associated with this one and releases the other one. As a result, the useful object cannot be found, causing the system to crash. This is why many experienced players don't like to use storyboard, because it is difficult to control and some hidden things are difficult to discover. Although it is a little more troublesome to use code to implement the interface structure, it is better than knowing enough that it will be how it is written. At this stage, I still have to rely on graphics tools. One of the disadvantages of graphics is that the storyboards of the two projects are not comparable. There were some examples where I followed the tutorial step by step, but something went wrong. But the download teacher did a good job. The project is normal, and there is no difference when comparing the codes. The difference is in the storyboard. However, the differences in the storyboard are so big that there is no clue at all. Moreover, directly overwriting the other party's files with your own is full of errors.
In general, my skills are not deep enough. In the future, we need to lay a solid foundation in depth.
3. The logic of search bar
In the past, objects such as search bar and search display were separated. Later, Apple provided an integrated solution and also integrated search The algorithms are also encapsulated into objects, which is expected to simplify the work of developers. But for developers like me, it's just the opposite. On the contrary, the simplest search bar is more suitable for me, because I only need to run a search when the content of the search bar changes, and then refresh the table once. And if you call those bundled display controllers, you need to implement more protocols, and you also need to provide a table view controller that outputs the result display, which really makes me dizzy. Apple's official information also provides an implementation example, but this example itself is very complicated and involves multiple view controllers.
The method provided on this page is more suitable for me.
This is an official example. It is an approach led by Apple. They have eliminated the old approach and now recommend the use of ui search controller. However, it is not clear what the background reason for this change is? It doesn’t feel that useful.
4. Use IB to make the interface or implement it in code?
Using code to set the size of the control may cause problems when adapting to different screens. We have not yet studied how to do the auto resize part.
But using code to create an interface is not as difficult as imagined. In fact, you only need to treat the controls in the interface as objects. Create the object, set the object's familiarity, add the object to the view, and set Set the relevant delegate, and then it's OK.
The course teacher Guo Chongzhi is young and promising, and is more in line with the tastes of young people. His lectures are relatively relaxed and natural, making us feel relaxed and more able to listen.
The above is the detailed content of Shangxuetang ios primary video material sharing. For more information, please follow other related articles on the PHP Chinese website!

PHP is used to build dynamic websites, and its core functions include: 1. Generate dynamic content and generate web pages in real time by connecting with the database; 2. Process user interaction and form submissions, verify inputs and respond to operations; 3. Manage sessions and user authentication to provide a personalized experience; 4. Optimize performance and follow best practices to improve website efficiency and security.

PHP uses MySQLi and PDO extensions to interact in database operations and server-side logic processing, and processes server-side logic through functions such as session management. 1) Use MySQLi or PDO to connect to the database and execute SQL queries. 2) Handle HTTP requests and user status through session management and other functions. 3) Use transactions to ensure the atomicity of database operations. 4) Prevent SQL injection, use exception handling and closing connections for debugging. 5) Optimize performance through indexing and cache, write highly readable code and perform error handling.

Using preprocessing statements and PDO in PHP can effectively prevent SQL injection attacks. 1) Use PDO to connect to the database and set the error mode. 2) Create preprocessing statements through the prepare method and pass data using placeholders and execute methods. 3) Process query results and ensure the security and performance of the code.

PHP and Python have their own advantages and disadvantages, and the choice depends on project needs and personal preferences. 1.PHP is suitable for rapid development and maintenance of large-scale web applications. 2. Python dominates the field of data science and machine learning.

PHP is widely used in e-commerce, content management systems and API development. 1) E-commerce: used for shopping cart function and payment processing. 2) Content management system: used for dynamic content generation and user management. 3) API development: used for RESTful API development and API security. Through performance optimization and best practices, the efficiency and maintainability of PHP applications are improved.

PHP makes it easy to create interactive web content. 1) Dynamically generate content by embedding HTML and display it in real time based on user input or database data. 2) Process form submission and generate dynamic output to ensure that htmlspecialchars is used to prevent XSS. 3) Use MySQL to create a user registration system, and use password_hash and preprocessing statements to enhance security. Mastering these techniques will improve the efficiency of web development.

PHP and Python each have their own advantages, and choose according to project requirements. 1.PHP is suitable for web development, especially for rapid development and maintenance of websites. 2. Python is suitable for data science, machine learning and artificial intelligence, with concise syntax and suitable for beginners.

PHP is still dynamic and still occupies an important position in the field of modern programming. 1) PHP's simplicity and powerful community support make it widely used in web development; 2) Its flexibility and stability make it outstanding in handling web forms, database operations and file processing; 3) PHP is constantly evolving and optimizing, suitable for beginners and experienced developers.


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

SublimeText3 Chinese version
Chinese version, very easy to use

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.

Dreamweaver Mac version
Visual web development tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

MinGW - Minimalist GNU for Windows
This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.