- 博客(61)
- 资源 (5)
- 收藏
- 关注
原创 Use MainWindow.xib in XCode 4.2
1.First add new xib file, change the name to "MainWindow.xib"2.Open "MainWindow.xib", add an "object" and a "window" in section "Objects".3.Add "UITabBarController" also. Change the Class
2012-04-05 17:25:01 112
原创 Getting started using KissXML
The newest kissXML:https://github.com/robbiehanson/KissXML To use KissXML within your project, there are two steps:1.Copy the KissXML folder into your project (ignore the UnitTesting folde...
2011-12-28 14:22:12 78
原创 IOS4 note 16 (7) Paths
Paths By issuing a series of instructions for moving an imaginary pen, you trace out a path. Such a path does not constitute drawing! First you provide a path; then you draw. Drawing can mean s...
2011-12-27 11:53:40 86
原创 IOS4 note 16 (6) Graphics Context State
Graphics Context State When you draw in a graphics context, the drawing obeys the context’s current settings. Thus, the way you draw using Core Graphics functions is to configure the context’s se...
2011-12-27 10:48:30 76
原创 IOS4 note 16 (5) Drawing a UIView
Drawing a UIView The most flexible way to draw a UIView is to draw it yourself. Actually, you don’t draw a UIView; you subclass UIView and endow the subclass with the ability to draw itself.When ...
2011-12-27 10:29:42 141
原创 IOS4 note 16 (4) CGImage
CGImage The Core Graphics version of UIImage is CGImage (actually a CGImageRef). They are easily converted to one another: a UIImage has a CGImage property that accesses its Quartz image data, an...
2011-12-26 13:52:52 81
原创 IOS4 note 16 (3) UIImage and Graphics Contexts
UIImage and Graphics Contexts The function UIGraphicsBeginImageContext creates a graphics context suitable for use as an image and makes it the current context. You then draw into this context to...
2011-12-26 11:19:09 72
原创 IOS4 note 16 (2) UIImage and UIImageView
UIImage and UIImageView The system knows how to work with many standard image file types, such as TIFF, JPEG, GIF, and PNG. In the very simplest case, an image in your app’s bundle can be ob...
2011-12-24 12:00:22 72
原创 IOS4 note 16 (chapter 15) Drawing
Drawing Many UIView subclasses, such as a UIButton or a UITextField, know how to draw themselves. Drawing is not difficult, but it is a very large topic. There are some UIKit convenience methods,...
2011-12-24 10:48:36 92
原创 IOS4 note 15 (7) Visibility and Opacity
Visibility and Opacity A view can be made invisible by setting its hidden property to YES, and visible again by setting it to NO. This takes it (and its subviews, of course) out of the visible in...
2011-12-23 18:16:57 81
原创 IOS4 note 15 (6) Transform
Transform A view’s transform property alters how the view is drawn — it may, for example, change the view’s perceived size and orientation — without affecting its bounds and center. A transformed...
2011-12-23 16:38:06 64
原创 IOS4 note 15 (5) Layout
Layout We have seen that a subview moves when its superview’s bounds origin is changed. But what happens to a subview when its superview’s bounds size is changed? (And remember, this includes cha...
2011-12-23 15:24:37 79
原创 IOS4 note 15 (4) Bounds and Center
Bounds and Center Suppose we wish to give a view a subview inset by 10 pixels. The utility function CGRectInset makes it easy to derive one rectangle as an inset from another, but what rectangle ...
2011-12-22 17:58:21 66
原创 IOS4 note 15 (3) Frame
Frame A view’s frame property, a CGRect, is the position of its rectangle within its superview, in the superview’s coordinate system. By default, the superview’s coordinate system will have the o...
2011-12-22 16:58:09 51
原创 IOS4 note 15 (2) Subview and Superview
Subview and Superview Now some or all of a subview can appear outside its superview, and a view can overlap another view and be drawn partially or totally in front of it without being its subview...
2011-12-22 16:22:17 144
原创 IOS4 note 15 (chapter 14) views The window
The Window The top of the view hierarchy is the app’s window. It is an instance of UIWindow (or your own subclass thereof), which is a UIView subclass. Your app should have exactly one main windo...
2011-12-22 14:24:36 60
原创 IOS4 note 14 (4) Key–Value Observing
Key–Value Observing Key–value observing, or KVO, is a mechanism somewhat similar to the target–action mechanism, except that it is not limited to controls. (The KVO mechanism is provided through ...
2011-12-21 15:45:53 77
原创 IOS4 note 14 (3) Notifications
Notifications Notifications can be a way to communicate between objects that are conceptually distant from one another without bothering to provide any way for one to see the other. Using a notif...
2011-12-21 15:44:59 65
原创 IOS4 note 14 (Chapter 13) Data Communication
Model–View–ControllerModel The data and its management (often referred to as the program’s “business logic,” the hard-core stuff that the program is really all about).View What the user see...
2011-12-20 15:53:11 96
原创 IOS4 note 13 (5)
Properties If this property will be represented by an outlet in a nib, you can say IBOutlet before the type. This is a hint to the nib editor and has no formal meaning. The type doesn’t have to b...
2011-12-20 14:16:52 54
原创 IOS4 note 13 (4)
Memory Management of Pointer-to-Void Context Info A number of Cocoa methods take an optional parameter typed as void*, and often called context. An id is a universal object type; void* is just a ...
2011-12-20 11:13:57 56
原创 IOS4 note 13 (3)
Instance Variable Memory Management Policies In the preceding section, we saw that an instance variable might be set by retaining or copying the incoming value. There are in fact three pos...
2011-12-19 18:14:35 41
原创 Getting current device language in iOS
NSString * language = [[NSLocale preferredLanguages] objectAtIndex:0];
2011-12-17 10:44:01 69
原创 How to use NSLocalizedString
check your device supporting languages NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSArray *languages = [defaults objectForKey:@"AppleLanguages"]; NSLog(@"%@", languag...
2011-12-17 10:21:24 50
原创 IOS4 note 13 (2)
Memory Management It comes as a surprise to many beginning Cocoa coders that the programmer has an important role to play in the explicit management of memory. What’s more, managing memory incorr...
2011-12-13 11:36:07 54
原创 IOS4 note 13 (Chapter 12)
Accessors and Memory Management AccessorsAn accessor is a method for getting or setting the value of an instance variable. Key–Value Coding The way Cocoa derives the name of an ac...
2011-12-12 17:36:32 49
原创 IOS4 note 12 (6)
Application Lifetime Events As I’ve already mentioned, events mark certain important stages in the overall lifetime of your application. These events can arrive either as messages to the app dele...
2011-12-10 11:52:27 75
原创 IOS4 note 12 (5)
Deferring Responsibility The responder chain can be used to let a responder defer responsibility for handling a touch event. If a responder receives a touch event and can’t handle it, the event c...
2011-12-09 16:31:09 60
原创 NSCachesDiretory
NSString *cachesDirectory = [NSSearchPathForDirectoriesInDomains (NSCachesDirectory, NSUserDomainMask, YES) objectAtIndex:0];
2011-12-09 16:08:35 86
原创 IOS4 note 12 (4)
Data Sources A data source is like a delegate, except that its methods supply the data for another object to display. The only Cocoa classes with data sources are UITableView and UIPickerView....
2011-12-09 16:04:11 44
原创 IOS4 note 12 (3)
NSTimer An timer (NSTimer) is not, strictly speaking, a notification; but it behaves very similarly. It is an object that gives off a signal (fires) after the lapse of a certain time interval. Th...
2011-12-03 18:14:22 60
原创 IOS4 note 12 (2)
Notifications Cocoa provides your app with a single instance of NSNotificationCenter, informally called the notification center. This instance is the basis of a mechanism for sending messa...
2011-12-03 16:58:31 54
原创 IOS4 note 12 (Chapter 11)
Cocoa Events None of your code runs until Cocoa calls it. The art of Cocoa programming consists largely of knowing when and why Cocoa will call your code. If you know this, you can put your code ...
2011-12-03 10:22:25 45
原创 IOS4 note 11 (6)
The Secret Life of NSObject 1.It defines some native class methods and instance methods having mostly to do with the basics of instantiation and of method sending and resolution. 2.It ad...
2011-12-02 18:17:48 59
原创 IOS4 note 11 (5)
NSSet and Friends An NSSet is an unordered collection of distinct objects. This means that no two objects in a set can return YES when they are compared using isEqual:. Learning whether an object...
2011-12-02 15:43:07 50
原创 IOS4 note 11 (4)
Equality and Comparison The foregoing types will quickly come to seem to you like basic data types, but of course they are actually object types. Therefore you cannot compare them with the C oper...
2011-12-02 12:16:01 56
原创 IOS4 note 11 (3)
NSString and Friends NSNotFound is a constant integer indicating that some requested element was not found. For example, if you ask for the index of a certain object in an NSArray and the object ...
2011-12-02 12:10:03 66
原创 IOS4 note 11 (2)
Private Method Declarations A problem arises when you’d like to declare a method in such a way that all other methods in the same class can see the declaration (and can thus call the method) with...
2011-12-01 20:51:46 53
原创 IOS4 note 11 (Chapter 10)
Subclassing Often, the default behavior or appearance of an object supplied by Cocoa won’t be quite what you’re after, and you’ll want to customize it.Nevertheless, sometimes setting properties a...
2011-12-01 20:34:56 69
iOS审核4.3怎么破?
2022-09-29
TA创建的收藏夹 TA关注的收藏夹
TA关注的人