Search Results

Search found 5 results on 1 pages for 'thary'.

Page 1/1 | 1 

  • Objective-C - How to add objects in 2d NSMutableArrays

    - by thary
    Hello, I have this code NSMutableArray *insideArray = [[NSMutableArray alloc] init]; NSMutableArray *outsideArray = [[NSMutableArray alloc] init]; [insideArray addObject:@"Hello 1"]; [insideArray addObject:@"Hello 2"]; [outsideArray addObject:insideArray]; [insideArray removeAllObjects]; [insideArray addObject:@"Hello 3"]; [insideArray addObject:@"Hello 4"]; [outsideArray addObject:insideArray]; The current output is array( ( "Hello 3", "Hello 4" ), ( "Hello 3", "Hello 4" ) ) I need a way to get the output to be array( ( "Hello 1", "Hello 2" ), ( "Hello 3", "Hello 4" ) ) Does anyone have a solution or could see where i've gone wrong? Thanks

    Read the article

  • Sorting an array in ascending order without losing the index Objective-C

    - by thary
    Hello all, I have an array for instance, Array { 3.0 at Index 0 2.0 at Index 1 3.5 at Index 2 1.0 at Index 4 } I would like to get sort it in ascending order without losing the index in the first place, like this, Array { 1.0 at Index 4 2.0 at Index 1 3.0 at Index 0 3.5 at Index 2 } When I sort the array using this, NSArray *sortedArray = [hArray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)]; [knnRecog sortUsingDescriptors:[NSArray arrayWithObject:sortAsc]]; I lose the index. Does anyone know a way to preserve the index after sorting the array? Thanks

    Read the article

  • Sending array through email on iphone

    - by thary
    Hey guys I need to send the content of an NSMutableArray through email. I have a mailing function but I'm not sure on how to place the content of the array into a NSString to be displayed on the email under each other. Is there a way to place all the content of the array into the string with maybe HTML nextline command between each array element? NSString *emailBody = @"Need to put the body here"; Thanks

    Read the article

1