码迷,mamicode.com
首页 > 移动开发 > 详细

iOS programming Code Snippet Library

时间:2015-05-12 11:02:44      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

iOS programming? Code Snippet Library?

The freebie code comes from the code snippet library.

代码来自code snippet library。

Notice that there are a number of code snippets available

有许多code snippets available .

Click the Edit button on the code snippet detail window

点击Edit 按钮。

技术分享

The Completion Shortcut field in the edit window shows you what to type in a source file to have Xcode add the snippet.

Completion ShortCut 告诉你输入什么将会有这个片段。这个里面是init 。

This window also tells you that this snippet can be used in an Objective-C file as long as you are in the scope of a class implementation.

还能告诉你这个片段能用在Objective-C文件中。且在类实现的范围内。

?

You cannot edit any of the pre-defined code snippets, but you can create your own.

你不能编辑所有预定义的code snippets,但是你能创建你自己的。

?

locate the implementation of tableView:numberOfRowsInSection:. Highlight the entire method:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{
return [[[BNRItemStore sharedStore] allItems] count];

}

?

Drag this highlighted code into the code snippet library. The edit window will appear again, allowing you to fill out the details for this snippet.

把选中的部分拖到code snippet library . edit window 将会再次显现。

In the edit window, modify the code snippet so it looks like this:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

{
return <#number of rows#>;

}

技术分享

iOS programming Code Snippet Library

标签:

原文地址:http://www.cnblogs.com/ljlkfx/p/4496449.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!