`
zl4393753
  • 浏览: 339058 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
社区版块
存档分类
最新评论

Substituting for-each for NSMutableArray

 
阅读更多
For all those who learn Objective C with GNUstep…

Mostly you will learn using For-Each statement , for manipulating NSMutableArray.
But with GNUstep, it is not possible.
The for each statement looks like this,
1 for(NSObject *st in myMutableArrayObject) {
2         NSLog(@"%@",[st myMethodDefined]);
3 }

Here is how we can do it without For-Each statement,
1 for(i=0; i< [myMutableArrayObject count]; i++) {
2     NSLog(@"%@",[[myMutableArrayObject objectAtIndex: i] myMethodDefined]);
3 }

Here, we are using a method predefined called count which returns the number of objects in the MutableArray Object
and then another method objectAtIndex which iterates the objects at the interval from 0 to (count – 1).
分享到:
评论

相关推荐

    drupal 6.12

    all documentation files from public view, repeat this command for each of the Drupal documentation files in the installation directory, substituting the name of each file for CHANGELOG.txt in the ...

    Python安装包version 3.1.5

    (substituting the top of the source tree for '.' if you built in a different directory). This runs the test in verbose mode. Installing multiple versions ---------------------------- On Unix and ...

    FlexCel Reports 2.53 for D5/6/7

    操纵Excel极好的控件,包含源代码、例程、帮助FlexCel Reports is a suite of Delphi 5/6/7 components allowing to create Excel files by substituting values into a Template from a database or variables....

    ubuntu下安装tinyos-2.1.2

    # Script for profile.d for bash shells, adjusted for each user's # installation by substituting /opt for the actual TinyOS tree # installation point. TOSROOT="/opt/tinyos-2.1.2" export TOSROOT ...

    Economic and Social Impact Assessment of the Alternatives to DDT Usage for Antifouling Paint Production in China (2008年)

    China is the only nation that uses DDT in antifouling pain at present, approximately 5% of DDT is ... Therefore, actions shall be taken urgently for banning the use of DDT and substituting with non-

    Sql for mysql

    CHAPTER 1 Introduction to MySQL . . . . . . . . . ....1.1 Introduction ....1.2 Database, Database Server, and Database Language....1.3 The Relational Model .... ....1.5 The History of SQL ....1.6 From Monolithic via ...

    Scientific Computation__A_Structured_Approach_using_BSP_and_MPI

    This chapter is a self-contained tutorial which tells... Substituting these parameters into a theoretical cost formula for an algorithm gives a prediction of the actual running time of an implementation.

    【数学建模资料】英语专业名词.doc

    - **Plugging This into Our Equation Above, We Have/Substituting A into B, We Have…Substituting A into B Produces/Gives/Yields/Results In**:描述将一个值代入公式后得到的结果。 - **Be Reduced by a ...

    delta机器人逆解算法.pptx

    Substituting (4) , (5) in (3) , and simplifying 2 1cos 1+2 0 1sin 1= With K= 22 02 2 12 02 T=OA+ 0 = 0 (EQ-6) delta机器人逆解算法全文共27页,当前为第7页。 Substituting (6) in trigonometr

    Commons培训

    - **Searching and Substituting** - `StringUtils.indexOf(CharSequence seq, CharSequence searchSeq)`:查找字符串中特定字符或子串首次出现的位置。 - `StringUtils.contains(CharSequence seq, CharSequence ...

    辽宁省辽河油田第二高级中学2017_2018学年高二英语下学期期中试题

    12. 动词与介词搭配:"substituting for"表示“替代”,"occupying"(占据)、"adjusting"(调整)和"acknowledging"(承认)在本题中不合适。第十四题的"C. substituting"符合上下文,表示用对话替代暴力。 13. ...

    struts2开发遇到的问题

    1. **警告:Settings: Could not parse struts.locale setting, substituting default VMlocale** 这个警告表示Struts2框架无法解析设置的本地化环境。解决方法是在`WEB-INF/classes/struts.properties`或`src/...

    Compact Design of Planar Continuously Tunable Crossover With Two-Section Coupled Lines

    This paper presents, for the first time, the design and implementation of a planar tunable crossover. This crossover is derived from the conventional two-section branch-line crossover by substituting ...

    Scala Cookbook

    包括测试字符串相等性(Testing String Equality)、创建多行字符串(Creating Multiline Strings)、字符串分割(Splitting Strings)、字符串变量替换(Substituting Variables into Strings)、按字符处理字符串...

Global site tag (gtag.js) - Google Analytics