<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Moving objects within an NSMutableArray</title>
	<atom:link href="http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/</link>
	<description>iCab related stuff; Mac, iPhone and Cocoa programming</description>
	<lastBuildDate>Wed, 15 May 2013 09:32:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-32002</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Fri, 03 Aug 2012 01:15:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-32002</guid>
		<description><![CDATA[@Keary
Please think about it again. The solution is doing exactly what one would expect. The task is to move the element from the source index exactly to the destination index, not before or after the element at this index. Which means the elements between the source and target index have to move one step to the beginning or end, depending where the source and destination is.]]></description>
		<content:encoded><![CDATA[<p>@Keary<br />
Please think about it again. The solution is doing exactly what one would expect. The task is to move the element from the source index exactly to the destination index, not before or after the element at this index. Which means the elements between the source and target index have to move one step to the beginning or end, depending where the source and destination is.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Keary</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-31971</link>
		<dc:creator>Keary</dc:creator>
		<pubDate>Thu, 02 Aug 2012 18:50:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-31971</guid>
		<description><![CDATA[I am afraid that your may be misleading your readers.  Your algorithm will present a different row placement depending on whether the source row is before or after the destination row, and hence provide an inconsistent user experience. Specifically, consider the content:
0 1 2 3 4 5 6

Moving row 2 to row 5 results in:
0 1 3 4 5 2 6
or the row being placed *after* the target row.

While moving row 5 to row 2 results in:
0 1 5 2 3 4 6
or the row being placed *before* the target row.]]></description>
		<content:encoded><![CDATA[<p>I am afraid that your may be misleading your readers.  Your algorithm will present a different row placement depending on whether the source row is before or after the destination row, and hence provide an inconsistent user experience. Specifically, consider the content:<br />
0 1 2 3 4 5 6</p>
<p>Moving row 2 to row 5 results in:<br />
0 1 3 4 5 2 6<br />
or the row being placed *after* the target row.</p>
<p>While moving row 5 to row 2 results in:<br />
0 1 5 2 3 4 6<br />
or the row being placed *before* the target row.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28429</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Sun, 03 Jun 2012 12:25:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28429</guid>
		<description><![CDATA[@Dan
Yes, I believe that this is not working. Maybe you should try to split up this line into multiple statements instead of squeezing all into one line. Then it will be more likely that you&#039;re setting the brackets correctly ;-)

What you&#039;re actually doing here is to get a float value from an array &quot;y&quot;, check if this is larger than 10 and the result (a boolean &quot;YES&quot; or &quot;NO&quot;) is then used to create a NSNumber again... where the BOOL is interpreted as float. 
So the condition is actually only checking if creating a float from a BOOL did create an object. 


My advice, especially if you are new to programming:
&lt;ul&gt;
&lt;li&gt; Use the debugger to check the content of variables.
&lt;/li&gt;&lt;li&gt; Split up lines into more basic calculations and assign the intermediate results to separate variables. This way you can check these intermediate results and you&#039;ll be able to find the location where it starts to go wrong much more easier. Such a line as in your code where everything is squeezed into one line makes it only hard to find errors.
&lt;/li&gt;&lt;li&gt;Watch out for compiler warnings. If the compiler warns you about something, look closer, it almost always has a reason that there&#039;s a warning. And usually there warnings already give you an idea about what is wrong.
&lt;/li&gt;&lt;/ul&gt;]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
Yes, I believe that this is not working. Maybe you should try to split up this line into multiple statements instead of squeezing all into one line. Then it will be more likely that you&#8217;re setting the brackets correctly <img src='http://www.icab.de/blog/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>What you&#8217;re actually doing here is to get a float value from an array &#8220;y&#8221;, check if this is larger than 10 and the result (a boolean &#8220;YES&#8221; or &#8220;NO&#8221;) is then used to create a NSNumber again&#8230; where the BOOL is interpreted as float.<br />
So the condition is actually only checking if creating a float from a BOOL did create an object. </p>
<p>My advice, especially if you are new to programming:</p>
<ul>
<li> Use the debugger to check the content of variables.
</li>
<li> Split up lines into more basic calculations and assign the intermediate results to separate variables. This way you can check these intermediate results and you&#8217;ll be able to find the location where it starts to go wrong much more easier. Such a line as in your code where everything is squeezed into one line makes it only hard to find errors.
</li>
<li>Watch out for compiler warnings. If the compiler warns you about something, look closer, it almost always has a reason that there&#8217;s a warning. And usually there warnings already give you an idea about what is wrong.
</li>
</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28174</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 30 May 2012 14:00:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28174</guid>
		<description><![CDATA[@Alexander thank you for the help!

When i call this if condition, The condition inside the if does not get executed. Code used to call an element

if([NSNumber numberWithFloat:(([[[shared instance].y objectAtIndex:0] floatValue]))&gt;10])
{
 [MONObject sharedInstance1[.counterPlus++;  //counter used to update the value
}

Counter value gets updated irrespective of the condition inside if? Is this the way to get a element from the array and compare?

Note: i have created a single tone array! Please help me!
Seems like the there is a bug inside the condition! Any thought?]]></description>
		<content:encoded><![CDATA[<p>@Alexander thank you for the help!</p>
<p>When i call this if condition, The condition inside the if does not get executed. Code used to call an element</p>
<p>if([NSNumber numberWithFloat:(([[[shared instance].y objectAtIndex:0] floatValue]))&gt;10])<br />
{<br />
 [MONObject sharedInstance1[.counterPlus++;  //counter used to update the value<br />
}</p>
<p>Counter value gets updated irrespective of the condition inside if? Is this the way to get a element from the array and compare?</p>
<p>Note: i have created a single tone array! Please help me!<br />
Seems like the there is a bug inside the condition! Any thought?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28162</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Wed, 30 May 2012 07:53:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28162</guid>
		<description><![CDATA[@Dan
First of all, you need to initialize the static variable shared instance with nil when you declare it, otherwise it might have a random value and within the method &quot;sharedinstance&quot; this object is never properly created (because here the object is created only when this pointer is nil).

Also I guess your variable &quot;counterplus&quot; should be an &quot;int&quot; and not a pointer to an int (&quot;int*&quot;).]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
First of all, you need to initialize the static variable shared instance with nil when you declare it, otherwise it might have a random value and within the method &#8220;sharedinstance&#8221; this object is never properly created (because here the object is created only when this pointer is nil).</p>
<p>Also I guess your variable &#8220;counterplus&#8221; should be an &#8220;int&#8221; and not a pointer to an int (&#8220;int*&#8221;).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28160</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Wed, 30 May 2012 05:18:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28160</guid>
		<description><![CDATA[@Simon and @Alexander.
Thank you very much for the help you people provided! I came up with the code required to implement my task. But unfortunately i was stuck in a different area, I was trying this for last 24 hours and was unable to figure out my mistakes. I dnt have teachers to show this, so please help me to find the bug in this,
Task.
I wanted to create a counter that updates by one, every time it satisfied a condition in the if block of my code. To achieve this, i implemented a single tone instead of defining a global variable
In .h file.........
&lt;pre&gt;
@interface MONObject : NSObject {
   int *counterplus;
}
@property(nonatomic) int *counterplus;
+(MONbject*) sharedinstance;
@end
&lt;/pre&gt;
In the .m file
&lt;pre&gt;
static MON object * sharedinstance;
@implementation MONbject;
@synthesize counterplus;

+(MONbject*)sharedinstance
{
   if(!sharedinstance){
      sharedinstance=[[MONObject alloc]init];
   }
   return sharedinstance
}
-(MONObject*) int
{
   self=[super init];
   if(0!=self){
      counterplus=0;
   }
   return self;
}
@end
&lt;/pre&gt;
I call the above as...
&lt;pre&gt;
if(condition){
   [MONObject sharedinstance].counterplus++;
}
&lt;/pre&gt;
when i try to print the value of it using NSlog, program stops and give this error
&quot;single stepping until exit from function objc_msgSend, which has no line number informatiopn. warning remote failure reply: E37

I have no clue at all. I tried to used a global variable by defining it as extern and tried to 
increment. But it give the same error.
Is there any way to achieve this? Can you please point me the error in it~
Pleaseeeeeeeeeeeeee............]]></description>
		<content:encoded><![CDATA[<p>@Simon and @Alexander.<br />
Thank you very much for the help you people provided! I came up with the code required to implement my task. But unfortunately i was stuck in a different area, I was trying this for last 24 hours and was unable to figure out my mistakes. I dnt have teachers to show this, so please help me to find the bug in this,<br />
Task.<br />
I wanted to create a counter that updates by one, every time it satisfied a condition in the if block of my code. To achieve this, i implemented a single tone instead of defining a global variable<br />
In .h file&#8230;&#8230;&#8230;</p>
<pre>
@interface MONObject : NSObject {
   int *counterplus;
}
@property(nonatomic) int *counterplus;
+(MONbject*) sharedinstance;
@end
</pre>
<p>In the .m file</p>
<pre>
static MON object * sharedinstance;
@implementation MONbject;
@synthesize counterplus;

+(MONbject*)sharedinstance
{
   if(!sharedinstance){
      sharedinstance=[[MONObject alloc]init];
   }
   return sharedinstance
}
-(MONObject*) int
{
   self=[super init];
   if(0!=self){
      counterplus=0;
   }
   return self;
}
@end
</pre>
<p>I call the above as&#8230;</p>
<pre>
if(condition){
   [MONObject sharedinstance].counterplus++;
}
</pre>
<p>when i try to print the value of it using NSlog, program stops and give this error<br />
&#8220;single stepping until exit from function objc_msgSend, which has no line number informatiopn. warning remote failure reply: E37</p>
<p>I have no clue at all. I tried to used a global variable by defining it as extern and tried to<br />
increment. But it give the same error.<br />
Is there any way to achieve this? Can you please point me the error in it~<br />
Pleaseeeeeeeeeeeeee&#8230;&#8230;&#8230;&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Tillson</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28079</link>
		<dc:creator>Simon Tillson</dc:creator>
		<pubDate>Tue, 29 May 2012 08:37:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28079</guid>
		<description><![CDATA[@Dan
Ok - I can sympathise with you - you&#039;re trying to do something quite complex, and as a beginner I guess you deserve some help...

The first part, adding new numbers to the top and only keeping 4 elements in the array, is really easy:
&lt;pre&gt;
float myNewFloat = 1.0f;
NSNumber *myNewNumber = [NSNumber numberWithFloat: myNewFloat];
[myNSMutableArray insertObject: myNewNumber atIndex: 0];
if (myNSMutableArray.count &gt; 4) {
    [myNSMutableArray removeLastObject];
}
&lt;/pre&gt;
As for your calculations, you&#039;ll want to enumerate your array, which means to step through it one element at a time. Here&#039;s an example which computes the total sum of all elements, assuming you have an array of NSNumber objects:
&lt;pre&gt;
float myTotal = 0.0f;
for (NSNumber *num in myNSMutableArray)
{
    float fnum = [NSNumber floatValue];
    myTotal += fnum;
}
NSLog(@&quot;Total of all elements in array is: %0.3f&quot;, myTotal);
&lt;/pre&gt;

If you get stuck again, I&#039;d recommend reading the documentation on Cocoa and NSObject in general. The basic stuff is really well written, so don&#039;t be scared of it. Just takes time!]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
Ok &#8211; I can sympathise with you &#8211; you&#8217;re trying to do something quite complex, and as a beginner I guess you deserve some help&#8230;</p>
<p>The first part, adding new numbers to the top and only keeping 4 elements in the array, is really easy:</p>
<pre>
float myNewFloat = 1.0f;
NSNumber *myNewNumber = [NSNumber numberWithFloat: myNewFloat];
[myNSMutableArray insertObject: myNewNumber atIndex: 0];
if (myNSMutableArray.count &gt; 4) {
    [myNSMutableArray removeLastObject];
}
</pre>
<p>As for your calculations, you&#8217;ll want to enumerate your array, which means to step through it one element at a time. Here&#8217;s an example which computes the total sum of all elements, assuming you have an array of NSNumber objects:</p>
<pre>
float myTotal = 0.0f;
for (NSNumber *num in myNSMutableArray)
{
    float fnum = [NSNumber floatValue];
    myTotal += fnum;
}
NSLog(@"Total of all elements in array is: %0.3f", myTotal);
</pre>
<p>If you get stuck again, I&#8217;d recommend reading the documentation on Cocoa and NSObject in general. The basic stuff is really well written, so don&#8217;t be scared of it. Just takes time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28070</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 29 May 2012 07:14:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28070</guid>
		<description><![CDATA[@Simon!
Yes, i m new to objective C, Thank you for your valuable answer! I think i learn a good lesson about objective C from you.
But sir, Problem i encounter is... If i explain you from the beginning...
What i want is to run a loop that get a reading(float value) from variable(Numbers_of float) and insert it to a array of 4 elements. Every time  I get  a new reading(float value) i insert in to the first position of the array and delete the last element.
Then with those 4 numbers stored in the array, i need to perform a mathematical operation.
As Alexander said, i implement the code to add and remove elements from the array, but the problem is how to retrieve the numbers(float) from the array and multiply or add them with others. Since i m new to objective C, i have no idea to be honest. But with your answers, i m somewhere there, but can&#039;t figure out the exact way.. please help me~]]></description>
		<content:encoded><![CDATA[<p>@Simon!<br />
Yes, i m new to objective C, Thank you for your valuable answer! I think i learn a good lesson about objective C from you.<br />
But sir, Problem i encounter is&#8230; If i explain you from the beginning&#8230;<br />
What i want is to run a loop that get a reading(float value) from variable(Numbers_of float) and insert it to a array of 4 elements. Every time  I get  a new reading(float value) i insert in to the first position of the array and delete the last element.<br />
Then with those 4 numbers stored in the array, i need to perform a mathematical operation.<br />
As Alexander said, i implement the code to add and remove elements from the array, but the problem is how to retrieve the numbers(float) from the array and multiply or add them with others. Since i m new to objective C, i have no idea to be honest. But with your answers, i m somewhere there, but can&#8217;t figure out the exact way.. please help me~</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Tillson</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28069</link>
		<dc:creator>Simon Tillson</dc:creator>
		<pubDate>Tue, 29 May 2012 06:45:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28069</guid>
		<description><![CDATA[@Dan
Just saw your other post - nearly fell off my chair laughing, sorry...

You don&#039;t want to try multiplying a value type by an object type. That won&#039;t work, ever.
It&#039;s probably easiest if you do all of your calculations on your float values, and just use NSNumber to store and retrieve them from your arrays.

Good luck, happy learning! :-)]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
Just saw your other post &#8211; nearly fell off my chair laughing, sorry&#8230;</p>
<p>You don&#8217;t want to try multiplying a value type by an object type. That won&#8217;t work, ever.<br />
It&#8217;s probably easiest if you do all of your calculations on your float values, and just use NSNumber to store and retrieve them from your arrays.</p>
<p>Good luck, happy learning! <img src='http://www.icab.de/blog/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Simon Tillson</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28068</link>
		<dc:creator>Simon Tillson</dc:creator>
		<pubDate>Tue, 29 May 2012 06:29:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28068</guid>
		<description><![CDATA[@Dan
You must be pretty new to Objective-C, Dan.
A float variable is what is known as a value type whereas Objective-C containers like NSMutableArray can only store object types.
To do this, create an object-type container for your float variable using:
&lt;pre&gt;
float myFloat = 123.4;
NSNumber *myNumberObject = [NSNumber numberWithFloat: myFloat];
&lt;/pre&gt;
Then you can add it to an NSArray, store it in NSUserDefaults, whatever...

To get it back out again as a float value, use this;
&lt;pre&gt;
float myRetrievedFloat = [myNumberObject floatValue];
&lt;/pre&gt;]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
You must be pretty new to Objective-C, Dan.<br />
A float variable is what is known as a value type whereas Objective-C containers like NSMutableArray can only store object types.<br />
To do this, create an object-type container for your float variable using:</p>
<pre>
float myFloat = 123.4;
NSNumber *myNumberObject = [NSNumber numberWithFloat: myFloat];
</pre>
<p>Then you can add it to an NSArray, store it in NSUserDefaults, whatever&#8230;</p>
<p>To get it back out again as a float value, use this;</p>
<pre>
float myRetrievedFloat = [myNumberObject floatValue];
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28067</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 29 May 2012 06:23:29 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28067</guid>
		<description><![CDATA[@Alexander,
And also
can i multiply a element in a array like this? But it get errors?
&lt;pre&gt;
NSMutableArray *x;
x=[NSMutableArray arrayWithObjects:@&quot;3&quot;,@&quot;3&quot;,nil);
float output;
&lt;/pre&gt;
i want to multiply the 1st element by number 3.34 and store in the variable output
I code...
&lt;pre&gt;
output=([x objectAtIndex:0])*3.34;
&lt;/pre&gt;
But it gives an error!
Please help me!]]></description>
		<content:encoded><![CDATA[<p>@Alexander,<br />
And also<br />
can i multiply a element in a array like this? But it get errors?</p>
<pre>
NSMutableArray *x;
x=[NSMutableArray arrayWithObjects:@"3",@"3",nil);
float output;
</pre>
<p>i want to multiply the 1st element by number 3.34 and store in the variable output<br />
I code...</p>
<pre>
output=([x objectAtIndex:0])*3.34;
</pre>
<p>But it gives an error!<br />
Please help me!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28066</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Tue, 29 May 2012 05:59:15 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28066</guid>
		<description><![CDATA[@Alexander
Thank you for your valuable answer, 
can you please help in this matter too, 
The element that i want to add to the array is stored in a variable of type float,
Eg:- float variable_name =2.345;

But when i code,
 [array insertObject:variable_name atIndex:0];
it gives a error message!
How can i add an element to this array from a variable.
Thank you!]]></description>
		<content:encoded><![CDATA[<p>@Alexander<br />
Thank you for your valuable answer,<br />
can you please help in this matter too,<br />
The element that i want to add to the array is stored in a variable of type float,<br />
Eg:- float variable_name =2.345;</p>
<p>But when i code,<br />
 [array insertObject:variable_name atIndex:0];<br />
it gives a error message!<br />
How can i add an element to this array from a variable.<br />
Thank you!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alexander</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28029</link>
		<dc:creator>Alexander</dc:creator>
		<pubDate>Mon, 28 May 2012 17:41:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28029</guid>
		<description><![CDATA[@Dan
To remove the last item in an array (NSMutableArray) just use [array removeLastObject]. And to insert a new item at the beginning, use [array insertObject:item atIndex:0]. All existing items  will automatically move to the next location to make room for the newly inserted item.]]></description>
		<content:encoded><![CDATA[<p>@Dan<br />
To remove the last item in an array (NSMutableArray) just use [array removeLastObject]. And to insert a new item at the beginning, use [array insertObject:item atIndex:0]. All existing items  will automatically move to the next location to make room for the newly inserted item.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-28027</link>
		<dc:creator>Dan</dc:creator>
		<pubDate>Mon, 28 May 2012 17:01:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-28027</guid>
		<description><![CDATA[@Aaron H and Alexnader,
This a nice answer to solve many question! Thank you for posting it!
Can you please give me a way that i can implement a array that i can delete the last element of the array and move the other elements by one position forward(by one index) and insert a new element to the 1st position of the array, Basically, it&#039;s something like a buffer. It would be nice if you people can suggest me a method which has lowest computational cost!
Thank you!
You people should get courage n power to do more and more bright work like these to enlighten students like us!]]></description>
		<content:encoded><![CDATA[<p>@Aaron H and Alexnader,<br />
This a nice answer to solve many question! Thank you for posting it!<br />
Can you please give me a way that i can implement a array that i can delete the last element of the array and move the other elements by one position forward(by one index) and insert a new element to the 1st position of the array, Basically, it&#8217;s something like a buffer. It would be nice if you people can suggest me a method which has lowest computational cost!<br />
Thank you!<br />
You people should get courage n power to do more and more bright work like these to enlighten students like us!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jgs</title>
		<link>http://www.icab.de/blog/2009/11/15/moving-objects-within-an-nsmutablearray/comment-page-1/#comment-26930</link>
		<dc:creator>jgs</dc:creator>
		<pubDate>Sat, 12 May 2012 19:15:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.icab.de/blog/?p=105#comment-26930</guid>
		<description><![CDATA[Fair enough, but that&#039;s a different argument.   Darin&#039;s argument is:
       
     A. insertObject:&lt;i&gt;object&lt;/i&gt; AtIndex:&lt;i&gt;index&lt;/i&gt; adds&lt;i&gt;object&lt;/i&gt; to the end of
         the array if &lt;i&gt;index&lt;/i&gt; is equal to the length of ther array.

    B.  Part of your code adds :&lt;i&gt;object&lt;/i&gt; to the end of the array if &lt;i&gt;index&lt;/i&gt; is greater
          than or equal to the length of ther array

     C. A impiles that all of B is redundant.

A purist will argue that moveObjectFromIndex:toIndex should handle an index parameter value the same way that insertObject:AtIndex does.  You have a different philosophy, and  given that you do, C is incorrect.  

How great would it be if it were this easy to resolve philosophical differences?  No war.  More love.]]></description>
		<content:encoded><![CDATA[<p>Fair enough, but that&#8217;s a different argument.   Darin&#8217;s argument is:</p>
<p>     A. insertObject:<i>object</i> AtIndex:<i>index</i> adds<i>object</i> to the end of<br />
         the array if <i>index</i> is equal to the length of ther array.</p>
<p>    B.  Part of your code adds :<i>object</i> to the end of the array if <i>index</i> is greater<br />
          than or equal to the length of ther array</p>
<p>     C. A impiles that all of B is redundant.</p>
<p>A purist will argue that moveObjectFromIndex:toIndex should handle an index parameter value the same way that insertObject:AtIndex does.  You have a different philosophy, and  given that you do, C is incorrect.  </p>
<p>How great would it be if it were this easy to resolve philosophical differences?  No war.  More love.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
