Thank you for all of the reply. The information is very useful.
And I found another problems about the NSArray. I check the apple document. I found that I have to declare the array in 'NSMutableArray' if I don't the size of the array. Actually, I found that my program has some problems.
I want to store all the cookies into the array, no matter it is a NSArray or NSMutableArray.
I use the following code to retrieve the cookies and in NSArray form. However, I have to add some cookies to the array in the later part. Do I need to create a 2D arrays, one stores the name, one stores the value of the cookies, or use the whole array to store the cookies.
The following is the code:
// I use the NSArray to store the cookies from the urlCookies
NSArray *cookiesUse = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookiesForURL:urlCookies];
// I use the objectAtIndex to retrieve the element from array to the NSString
NSString *cookesInArrayUse_0 = [cookiesUse objectAtIndex:0];
// get the cookie name and value from the cookesInArrayUse_0
NSString *cookieNameUse = [cookesInArrayUse_0 name];
NSString *cookieValueUse = [cookesInArrayUse_0 value];
// decl an array to store all the cookies
// and I don't know how many cookies/string I need to store
// so I want to decl a unknown size array (dynamic/mutable)
Can anyone help me. Thank you very much.