each dog has its own day

@eachdog writes codes and blogs everyday

Exception: Collection *** was mutated while being enumerated. —

Exception: Collection *** was mutated while being enumerated.
In my case, NSMutableArray.

-(void) toggleSelectByIso:(NSString *)iso{

if ([self isSelectedByIso:iso]) {

/*WRONG CODE*/
/*
for (NSString* content in _selectedCountries) {

if ([content isEqualToString:iso]) {
[_selectedCountries removeObject:iso];
}

}
*/

if([ _selectedCountries containsObject: iso ]){
[_selectedCountries removeObject:iso];
}// The containsObject method of NSArray is really handy and make it really fast. Your life made easier.

} else {

[_selectedCountries addObject:iso];
NSLog(@”%@”,_selectedCountries);
}

}


When you found an error —

When I try to run my app, I usually come to an “Apple Mach-O Linker Error”.
Sometimes I was very confused. But now I found out a very important point: Look at the details.

Say:
ld: duplicate symbol _main

It means that you may have two “main.m” in your project.


Cakephp debug message Configuration —

app/config/core.php

Configure::write(‘debug’, ?);

? = 0
NO OUTPUT.

? = 1
ERROR, WARNING, NO DEBUG

? = 2
EVERYTHING.


batch changing Mac File permissons —

batCHMOD is the perfect solution to change the file access permission of iOS files and folders. The ‘s’ here is very important:

When you click ‘Get Info’, it’s only possible to change the single folder you’ve selected. Your modification won’t be applied to any of those enclosed folders. You definitely don’t wanna change access permissions for 1000 files by yourself and one at a time.

Its advantages are: Small, Quick, user friendly and BATCHMOD!!!

Its link: http://www.macchampion.com/arbysoft/BatchMod/Download.html


Flag of South Vietnam —

TONIGHT, when I was watching a video titled “100 YEARS in 10 MINUTES”, it came up with some history I didn’t know sbout, so I googled it and saw a Vietnamese flag – it’s different from the red flag with a large yellow star on its centre which we are familiar with, it looks very different. However, it reminds me of a Commercial I saw some day. I quickly looked it up on Wikipedia, then I got the answer – it’s the flag of South Vietnam. It’s pretty like a mainland oversea Chinese a flag of Republic of China. I know that there are lots of vietnamese refugees in Australia. There must be lots supporters of South Vietnam.


Vietnamese Americans parading with the Flag of South Vietnam during Tết
(SOURCE: WIKIPEDIA http://en.wikipedia.org/wiki/File:South_Vietnamese_flag_parade.jpg)


What the British Really Mean —

When the British say “I hear what you say. ” They mean “I disagree and do not want to discuss it further.” But what others understand is “He accepts my point of view.”

When the British say “With the greatest respect… ” They mean “I think you are an idiot.” But what others understand is “He is listening to me.”

When the British say “That’s not bad. ” They mean “That’s good.” But what others understand is “That’s poor.”

When the British say “That is a very brave proposal. ” They mean “You are insane.” But what others understand is “He thinks I have courage.”

When the British say “Quite good. ” They mean “A bit disappointing.” But what others understand is “Quite good.”

When the British say “I would suggest… ” They mean “Do it or be prepared to justify yourself.” But what others understand is “Think about the idea, but do what you like.”

When the British say “Oh, incidentally / by the way… ” They mean “The primary purpose of our discussion is…” But what others understand is “That is not very important.”

When the British say “I was a bit disappointed that… ” They mean “I am annoyed that…” But what others understand is “It doesn’t really matter.”

When the British say “Very interesting. ” They mean “That is clearly nonsense.” But what others understand is “They are impressed.”

When the British say “I’ll bear it in mind. ” They mean “I’ve forgotten it already.” But what others understand is “They will probably do it.”

When the British say “I’m sure it’s my fault. ” They mean “It’s your fault.” But what others understand is “Why do they think it was their fault?”

When the British say “You must come for dinner. ” They mean “It’s not an invitation, I’m just being polite.” But what others understand is “I will get an invitation soon.”

When the British say “I almost agree. ” They mean “I don’t agree at all.” But what others understand is “He’s not far from agreement.”

When the British say “I only have a few minor comments. ” They mean “Please re-write completely.” But what others understand is “He has found a few typos.”

When the British say “Could we consider some other options?” They mean “I don’t like your idea.” But what others understand is “They have not yet decided.”


Mao’s last dancer —

This Saturday I watched a movie – Mao’s Last Dancer. I was moved by Li’s struggle, the love story between Liz and Li, and burst into tears when I saw his family reunion.

That’s the things really did happened to older generations. But what does Mao mean to us now? I found a picture that may well explain it…