Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Odds are you're correct but being as how the Roman character set is not used in his native language he may not be use to noting the difference between what is presented in PDF documents and actual 'C' code.
 
3 would have worked here.

So would this, which is a simple way to look at the value of a variable:
Code:
NSLog( @"stopList len: %d", [stopList count] );
NSLog( @"stopList: %@", stopList );
If stopList is working as desired, the expected output should be a length greater than 1, and an array of several small words. However, the actual output is something else. Something that isn't an array holding several small words. This is a good example of why it's useful to describe expected results and actual results.

It's also a good example of how running a program in the debugger and simply looking at variables can provide information on what the bug is. Unfortunately, learning to use the debugger doesn't seem to be a skill the OP is interested in.

Equally unfortunate, using NSLog() requires thinking about what variables to look at. Which requires having a plan for finding bugs. Which requires breaking the problem down and looking carefully at the smaller parts. These skills also seem to be lacking.
 
unfortunately some people in this forum know what is the question & problem, but !!! since they have no idea of how solve the problem say :

I think you're wrong. I think almost everyone replying knows exactly what the problem is, and exactly how to solve it. They are intentionally not giving you the answer, because they expect you to find it for yourself.

This is called "learning to find the answer yourself" instead of "having someone else give you the answer". The first skill is very important in programming. The second one, not so much.

1-improve your english
No one said that. No one even hinted at it. They are telling you to improve your descriptions, which means they are asking you to provide complete descriptions. A complete description, even in poor English, is better than no description at all. Your first post had no description of the problem.

2-learn memory management
No one suggested that, either. I did say that you have a history of posts where the code doesn't do correct memory management. You started those posts by saying there was "no error". I was using that as an example of one possible meaning for "no error".

I was also saying that we can't tell what you mean when all you say is "no error". If you say "no compiler errors", it's clear what you mean. If you say "it doesn't crash", it's clear what you mean. If all you say is "no error", it's not clear.

3-learn debugger using
etc

guys these are not the problem !
Wrong. Not knowing how to use the debugger is exactly the problem.

You have no way to debug programs yourself. That is a serious problem. You also don't seem to have any interest in learning the debugger. Another serious problem.

If you knew how to use the debugger, you could find and fix the problem in your code yourself.

If you knew how to use NSLog to look at variables, you could also do a lot of debugging, because sometimes simply looking at the value of a variable is enough to see the reason for a bug.


this program logically has problem! this post had 21 replies so far, you guys that make fun of this post have you suffered to put this little code in your editor and run it instead of fooling other people's post ???
Yes, I ran it. Yes, I know exactly what the problem is. Yes, I know exactly how to solve it. No, I'm not going to tell you exactly how to solve it. No, I'm not going to post code that shows how to solve it. Because I think it's more important that you learn how to find and fix bugs like this by yourself.
 
unfortunately some people in this forum know what is the question & problem, but !!! since they have no idea of how solve the problem say

I told you: Before Jared's joke program there were four or five posts that told you exactly how to find the problem. There is a common problem that beginner programmers have: They believe that their code is correct and something strange is going on that stops it from working. With experience you'll find that if your code doesn't work, chances are 99.99% that it is something you did wrong, and often some rather stupid mistake.

You seem to have an additional problem. You ask for help, but not only do you not believe that there is anything wrong with your code (which you could have found in less than a minute), but you don't believe that the replies you get have any value. Here was my very first advice: "Look at the code in a really big font. " Did you do it? No, you didn't or you would have immediately spotted the problem. The second advice by chown: "Or run the code in the debugger, and look at the contents of the variables." Did you do it? No, you didn't, or you would have found the error within a minute.
 
They are intentionally not giving you the answer, because they expect you to find it for yourself.

This is called "learning to find the answer yourself" instead of "having someone else give you the answer".

saleh.hi.62 - This is a very true statement. I have been asking questions for a while now as I learn. People here are very willing to help you learn but giving away the answer almost never happens. They will push you in the right direction so you can discover the answer yourself which means you will better understand and remember it. If they did not want to help or care they would not take the time to respond with lengthy replies to your questions.
 
Thank you guys,

i have found the problem! here it is !

Code:
NSArray *stopList=[NSArray arrayWithObjects:@"an”, @“and”, @“by”, @“for”, @“from”, @“of”, @“the”, @“to”,@“with",nil];

when i print it out :

Code:
NSLog(@"%@",stopList);

the output is :


Code:
2011-12-14 23:51:57.242 ICrawler[3710:80f] (
    "an\U201d, @\U201cand\U201d, @\U201cby\U201d, @\U201cfor\U201d, @\U201cfrom\U201d, @\U201cof\U201d, @\U201cthe\U201d, @\U201cto\U201d,@\U201cwith"
)

i got crazy with this !
 
Thank you guys,

i have found the problem! here it is !

i got crazy with this !

To find the problem: Set a breakpoint on the line that sets "sentence". Command-R. Step over. Look at the "sentence" variable in the debugger. Looks alright. Step over the line that sets stopList. Look at "stopList" variable in the debugger. Wonder why it shows "1 element". Right click "Print description of stoplist". See the content. Less than one minute.

Since you spent days on finding the solution instead of a minute, it is now time for you to step back and spend an hour finding out what strategies you should have used to find the solution a lot quicker. Maybe look through this thread again from the start and check where you went wrong.
 
Look closely at the initializer list portion of your 'stopList' array -

Code:
	  @"an”
	, @“and”
	, @“by”
	, @“for”
	, @“from”
	, @“of”
	, @“the”
	, @“to”
	, @“with"
	, nil

Please note the difference between:

"

and

”

and

“

While these Roman characters look similar they are NOT the same.

If you can't see the difference try taking a closer look.

A quick way to take a closer look is multiple hits of 'Command +'

Only one is a valid delimiter in marking the beginning AND end of a 'C' language zero terminated character string.
 
Are you looking at it in your source code or in the debugger?

debuger, i am using xcode 3.2 ...

----------

Look closely at the initializer list portion of your 'stopList' array -

Code:
	  @"an”
	, @“and”
	, @“by”
	, @“for”
	, @“from”
	, @“of”
	, @“the”
	, @“to”
	, @“with"
	, nil

Please note the difference between:

"

and

”

and

“

While these Roman characters look similar they are NOT the same.

If you can't see the difference try taking a closer look.

A quick way to take a closer look is multiple hits of 'Command +'

Only one is a valid delimiter in marking the beginning AND end of a 'C' language zero terminated character string.

Thank you so much, i wish someone could have told me earlier!
 
Thank you so much, i wish someone could have told me earlier!

Let's see. Did you ever read the article that explains how to ask questions? Let's do a test: Who wrote that article? That article links to another article by a rather famous (or infamous) person, who has a very impatient attitude. What is the name of that person? And did you read any of these?

Look at the code in a really big font. Or in XCode with syntax coloring.

Or run the code in the debugger, and look at the contents of the variables.

You need to run the debugger and set a breakpoint at the first line of code. Check each line to make sure the objects and values are what you expect them to be. If you don't know how to do this, search Google. If you run into problems, tell us the article you're following and where you get tripped up.

All posted on December 12th.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.