Re: Number of images in main bundle folder (iPhone)
Re: Number of images in main bundle folder (iPhone)
- Subject: Re: Number of images in main bundle folder (iPhone)
- From: Alexander Spohr <email@hidden>
- Date: Fri, 26 Jun 2009 19:35:12 +0200
Am 26.06.2009 um 19:17 schrieb Eric E. Dolecki:
This is what I ended up doing:
totalCount = 0;
NSArray *d = [[NSBundle mainBundle] pathsForResourcesOfType:@
"jpg" inDirectory:@"/"];
*// Loop through and find the JPGs that have "image_" in them*
for( int i=0;i<[d count];i++){
NSString *searchForMe = @"image_";
NSString *s = [[NSString alloc] initWithString:[d objectAtIndex:i]];
Why do you copy the path?
NSRange range = [s rangeOfString:searchForMe];
How about hasPrefix: ?
if( range.location != NSNotFound ){
totalCount++;
}
}
NSArray *d = [[NSBundle mainBundle] pathsForResourcesOfType:@"jpg"
inDirectory:nil];
for(NSString *s in d)
if([s hasPrefix:@"image_"])
totalCount++;
atze
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden