hi my application takes so much cpu usage ,thats why application become slower can u please tell me how can i faster the application and reduce the cpu usage.
i am using thread also but it does not take any effect
like:
i am using thread also but it does not take any effect
like:
Code:
- (IBAction)Test_btn:(id)sender
{
[NSThread detachNewThreadSelector:@selector(aMethod) toTarget:self withObject:nil];
}
-(void)aMethod
{
NSAutoreleasePool *pool =[[NSAutoreleasePool alloc] init];
[self Test_Fun];
[pool release];
[NSThread exit];
}
-(void) Test_Fun
{
for(int i=0;i<100000;1;i++)
{
int j=0;
for( j=0;j<512;j++)
{
s1=[s1 stringByAppendingString:[NSString stringWithFormat:@"%02X" , buffer[j]]];
}
NSRange whereFound = [s1 rangeOfString:@"FFE0"];
if(whereFound.location == NSNotFound && whereFound.length == 0)
{
NSLog(@"%@ does not contain FFE0.",s1);
} else
{
NSLog(@"%@ contains xyz.",s1);
}
//do something for create and write file.
//and show in KIImageBrowser
}
}
Last edited: