IOS design pattern-Observer Pattern
Observer mode:
Defines a one-to-many dependency between objects. When the status of an object changes, all objects dependent on it are notified and automatically updated.
When to use observer Mode
(1): changing
UIWindow-WindowLevel, windowlevel
WindowLevel is an attribute of UIWindow. There are three types of systems defined.
UIKIT_EXTERN const UIWindowLevel UIWindowLevelNormal;UIKIT_EXTERN const UIWindowLevel UIWindowLevelAlert;UIKIT_EXTERN const
27th-day notes for learning in iOS (UIButton-UIImageView Introduction), and calculating the uiimage size in ios
IOS Learning (UI) knowledge point sorting
1. Introduction to UIButton1) concept: UIButton is a common control that triggers corresponding
(High-xiaode car) high-imitation Didi/fast application source code, high-small car
"Food, shelter, and Travel" are the basic components of life. With the continuous penetration of the mobile Internet, a large number of travel software
IOS-JS interaction (WebViewJavascriptBridge), iosjsbridge//// ViewController. m// JSAndIOS Interaction//// Created by apple on 15/7/31.// Copyright (c) 2015 tqh. All rights reserved.//# Import "ViewController. h"# Import "WebViewJavascriptBridge. h"@
Thread security for iOS Singleton
In multithreading, the implementation of a singleton should also consider thread security issues.
1. Implemented through GCD dispatch_once:
@ Property (nonatomic, strong) NSString * str;
-(NSString *)
Objective-C Knowledge Summary (1), objective-c Knowledge Summary
Objective-C (OC) is a language for developing Mac OS X and iOS applications. Currently, the latest swift language can also be used to develop applications on the above two
GCD-block, adblock
1. block Definition
// Declare the variable (void) (^ PrintStr) (void); // define PrintStr =^{ NSLog (@ "PrintStr") ;}; // call PrintStr ();
2. Modify variables outside the block
The variables in the block do not take
IOS-Swift and Object-C Mixed Programming, ios-object-c1. preface facts prove that Swift cannot replace Object-C in a short time, and .... the Apple Swift development team said, "We'll recommend people start with Swift, sure, but ObjC isn' t going
Reflection of iOS Animation1. Result Display
2. Implementation ideas
1. Use the copy layer to create a UIImageView to display the image, and then copy the UIImageView.
Note:The copy layer can only copy child layers, but the UIImageView has only one
Design and Implementation of Weibo in IOS development
//// main.m// Microblog//#import
#import Person.h#import BlogMaster.h#import Microblog.hint main(int argc, const char * argv[]){ Person * person = [[Person alloc]init]; [person
Use of IOS NSNotification Center notification Center, iosnsnotification
Notification center, which is a message broadcast mechanism inside the IOS program. Through it, communication between objects without reference relationships can be realized.
Several Methods for IOS to cache images locally
Caching images locally is used in many scenarios. If you only store text information, you can create a plist file or database to easily solve the problem, however, it would be less convenient to store
IOS string truncation removes the content included in parentheses in the string
// Remove the position enclosed in parentheses-(NSString *) handleStringWithString :( NSString *) str {NSMutableString * muStr = [NSMutableString stringWithString:
ARC-do not send messages to released objects. arc-release sends messages.
1. Write the following code in AppDelegate. m:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { //
IOS-Get UITextField input text
When the UITextField text changes, update the data based on the content by writing the listening event.Add a listener:
[TimesField addTarget: self action: @ selector (textFieldDidChange :) forControlEvents:
UITableView simple performance optimization, uitableviewThe memory of iOS devices is limited. If you use UITableView to display thousands of data records, you need thousands of UITableViewCell objects, which consumes the memory of iOS devices. To
Download MonoTouch and monotouch
Application tried to present modally an active controller
1. AddGestureRecognizer adds an event to the image View
// Rounded Avatar _ avatarView = new UIImageView (new RectangleF (_ blockSpace, _ blockSpace, 2 * _
19th-day notes (Protocol-protocol) and IOS-Protocol
Knowledge points of IOS Learning (oc language)
1. Introduction to Protocols1) concept: a protocol refers to an interface object negotiated between multiple objects. The Protocol provides some
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