Search Results

Search found 9 results on 1 pages for 'user338322'.

Page 1/1 | 1 

  • Application is crash..

    - by user338322
    Below is my crash Report. 0 0x326712f8 in prepareForMethodLookup () 1 0x3266cf5c in lookUpMethod () 2 0x32668f28 in objc_msgSend_uncached () 3 0x33f70996 in NSPopAutoreleasePool () 4 0x33f82a6c in -[NSAutoreleasePool drain] () 5 0x00003d3e in -[CameraViewcontroller save:] (self=0x811400, _cmd=0x319c00d4, number=0x11e210) at /Users/hardikrathore/Desktop/LiveVideoRecording/Classes/CameraViewcontroller.m:266 6 0x33f36f8a in __NSFireDelayedPerform () 7 0x32da44c2 in CFRunLoopRunSpecific () 8 0x32da3c1e in CFRunLoopRunInMode () 9 0x31bb9374 in GSEventRunModal () 10 0x30bf3c30 in -[UIApplication _run] () 11 0x30bf2230 in UIApplicationMain () 12 0x00002650 in main (argc=1, argv=0x2ffff474) at /Users/hardikrathore/Desktop/LiveVideoRecording/main.m:14 And this is the code. lines, where I am getting the error. -(void)save:(id)number { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; j =[number intValue]; while(screens[j] != NULL){ NSLog(@" image made : %d",j); UIImage * image = [UIImage imageWithCGImage:screens[j]]; image=[self imageByCropping:image toRect:CGRectMake(0, 0, 320, 240)]; NSData *imgdata = UIImageJPEGRepresentation(image,0.3); [image release]; CGImageRelease(screens[j]); screens[j] = NULL; UIImage * image1 = [UIImage imageWithCGImage:screens[j+1]]; image1=[self imageByCropping:image1 toRect:CGRectMake(0, 0, 320, 240)]; NSData *imgdata1 = UIImageJPEGRepresentation(image1,0.3); [image1 release]; CGImageRelease(screens[j+1]); screens[j+1] = NULL; NSString *urlString=@"http://www.test.itmate4.com/iPhoneToServerTwice.php"; // setting up the request object now NSMutableURLRequest *request = [[NSMutableURLRequest alloc]init]; [request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *fileName=[VideoID stringByAppendingString:@"_"]; fileName=[fileName stringByAppendingString:[NSString stringWithFormat:@"%d",k]]; NSString *fileName2=[VideoID stringByAppendingString:@"_"]; fileName2=[fileName2 stringByAppendingString:[NSString stringWithFormat:@"%d",k+1]]; /* add some header info now we always need a boundary when we post a file also we need to set the content type You might want to generate a random boundary.. this is just the same as my output from wireshark on a valid html post */ NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; /* now lets create the body of the post */ //NSString *count=[NSString stringWithFormat:@"%d",front];; NSMutableData *body = [NSMutableData data]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; //[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; count=\"@\"";filename=\"%@.jpg\"\r\n",count,fileName] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@.jpg\"\r\n",fileName] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:imgdata]]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; //second boundary NSString *string1 = [[NSString alloc] initWithFormat:@"\r\n--%@\r\n",boundary]; NSString *string2 =[[NSString alloc] initWithFormat:@"Content-Disposition: form-data; name=\"userfile2\"; filename=\"%@.jpg\"\r\n",fileName2]; NSString *string3 =[[NSString alloc] initWithFormat:@"\r\n--%@--\r\n",boundary]; [body appendData:[string1 dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[string2 dataUsingEncoding:NSUTF8StringEncoding]]; //experiment //[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile2\"; filename=\"%@.jpg\"\r\n",fileName2] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:imgdata1]]; //[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[string3 dataUsingEncoding:NSUTF8StringEncoding]]; // setting the body of the post to the reqeust [request setHTTPBody:body]; // now lets make the connection to the web NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; if([returnString isEqualToString:@"SUCCESS"]) { NSLog(returnString); k=k+2; j=j+2; [self performSelectorInBackground:@selector(save:) withObject:(id)[NSNumber numberWithInt:j]]; } //k=k+2; [imgdata release]; [imgdata1 release]; [NSThread sleepForTimeInterval:.01]; } [pool drain]; <-------------Line 266 } As you can see in log report. I am getting the error, Line 266. Some autorelease problem Any help !!!? coz I am not getting why its happening.

    Read the article

  • image upload on server

    - by user338322
    I am trying to upload an image to server using iphone . I haven't done it before. But I am not getting how can i do it. I know how to add text data on server. But how to add the image data or an Image to server . Can any one suggest!?

    Read the article

  • iPhone: Crash in Custom Autorelease Pool

    - by user338322
    My app is crashing when I try to post images in an HTTP request. I am trying to upload images to a server. The crash appears related to my autorelease pool because the crash is trapped at the [pool release] message. Here is the crash report: #0 0x326712f8 in prepareForMethodLookup () #1 0x3266cf5c in lookUpMethod () #2 0x32668f28 in objc_msgSend_uncached () #3 0x33f70996 in NSPopAutoreleasePool () #4 0x33f82a6c in -[NSAutoreleasePool drain] () #5 0x00003d3e in -[CameraViewcontroller save:] (self=0x811400, _cmd=0x319c00d4, number=0x11e210) at /Users/hardikrathore/Desktop/LiveVideoRecording/Classes/CameraViewcontroller.m:266 #6 0x33f36f8a in __NSFireDelayedPerform () #7 0x32da44c2 in CFRunLoopRunSpecific () #8 0x32da3c1e in CFRunLoopRunInMode () #9 0x31bb9374 in GSEventRunModal () #10 0x30bf3c30 in -[UIApplication _run] () #11 0x30bf2230 in UIApplicationMain () #12 0x00002650 in main (argc=1, argv=0x2ffff474) at /Users/hardikrathore/Desktop/LiveVideoRecording/main.m:14 The crash report says that final line of the following code is the point of the crash. (Line No. 266) -(void)save:(id)number { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; j =[number intValue]; while(screens[j] != NULL){ NSLog(@" image made : %d",j); UIImage * image = [UIImage imageWithCGImage:screens[j]]; image=[self imageByCropping:image toRect:CGRectMake(0, 0, 320, 240)]; NSData *imgdata = UIImageJPEGRepresentation(image,0.3); [image release]; CGImageRelease(screens[j]); screens[j] = NULL; UIImage * image1 = [UIImage imageWithCGImage:screens[j+1]]; image1=[self imageByCropping:image1 toRect:CGRectMake(0, 0, 320, 240)]; NSData *imgdata1 = UIImageJPEGRepresentation(image1,0.3); [image1 release]; CGImageRelease(screens[j+1]); screens[j+1] = NULL; NSString *urlString=@"http://www.test.itmate4.com/iPhoneToServerTwice.php"; // setting up the request object now NSMutableURLRequest *request = [[NSMutableURLRequest alloc]init]; [request setURL:[NSURL URLWithString:urlString]]; [request setHTTPMethod:@"POST"]; NSString *fileName=[VideoID stringByAppendingString:@"_"]; fileName=[fileName stringByAppendingString:[NSString stringWithFormat:@"%d",k]]; NSString *fileName2=[VideoID stringByAppendingString:@"_"]; fileName2=[fileName2 stringByAppendingString:[NSString stringWithFormat:@"%d",k+1]]; /* add some header info now we always need a boundary when we post a file also we need to set the content type You might want to generate a random boundary.. this is just the same as my output from wireshark on a valid html post */ NSString *boundary = [NSString stringWithString:@"---------------------------14737809831466499882746641449"]; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@",boundary]; [request addValue:contentType forHTTPHeaderField: @"Content-Type"]; /* now lets create the body of the post */ //NSString *count=[NSString stringWithFormat:@"%d",front];; NSMutableData *body = [NSMutableData data]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; //[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; count=\"@\"";filename=\"%@.jpg\"\r\n",count,fileName] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile\"; filename=\"%@.jpg\"\r\n",fileName] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:imgdata]]; [body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; //second boundary NSString *string1 = [[NSString alloc] initWithFormat:@"\r\n--%@\r\n",boundary]; NSString *string2 =[[NSString alloc] initWithFormat:@"Content-Disposition: form-data; name=\"userfile2\"; filename=\"%@.jpg\"\r\n",fileName2]; NSString *string3 =[[NSString alloc] initWithFormat:@"\r\n--%@--\r\n",boundary]; [body appendData:[string1 dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[string2 dataUsingEncoding:NSUTF8StringEncoding]]; //experiment //[body appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"userfile2\"; filename=\"%@.jpg\"\r\n",fileName2] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[NSData dataWithData:imgdata1]]; //[body appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n",boundary] dataUsingEncoding:NSUTF8StringEncoding]]; [body appendData:[string3 dataUsingEncoding:NSUTF8StringEncoding]]; // setting the body of the post to the reqeust [request setHTTPBody:body]; // now lets make the connection to the web NSData *returnData = [NSURLConnection sendSynchronousRequest:request returningResponse:nil error:nil]; NSString *returnString = [[NSString alloc] initWithData:returnData encoding:NSUTF8StringEncoding]; if([returnString isEqualToString:@"SUCCESS"]) { NSLog(returnString); k=k+2; j=j+2; [self performSelectorInBackground:@selector(save:) withObject:(id)[NSNumber numberWithInt:j]]; } [imgdata release]; [imgdata1 release]; [NSThread sleepForTimeInterval:.01]; } [pool drain]; //<-------------Line 266 } I don't understand what is causing the crash.

    Read the article

  • why drawRect method is not being called?

    - by user338322
    #import <UIKit/UIKit.h> @interface quartzViewController : UIViewController { IBOutlet UIView *myView; } @end #import "quartzViewController.h" @implementation quartzViewController -(void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific); CGContextSetTextPosition(context,80,80); CGContextShowText(context, "hello", 6); //not even this works CGContextShowTextAtPoint(context, 1,1, "hello", 6); } - (void)viewDidLoad { [myView setNeedsDisplay]; [super viewDidLoad]; } Will I have to make any changed in the nib? Thanks

    Read the article

  • Which language coders are paid highest.?

    - by user338322
    I am an iPhone/iPad developer. Can I know which language coders are paid highest wages. ? I am thinking to switch to C++. Any suggestions if I should move to another language. If Yes please let me know which one.? or should I continue with iPhone/iPad development.

    Read the article

  • drawRect:rect how to call this method , I am using to draw a string

    - by user338322
    -(void)drawRect:(CGRect)rect { CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSelectFont(context, "Arial", 24, kCGEncodingFontSpecific); CGContextSetTextPosition(context,80,80); CGContextShowText(context, "hello", 6); //not even this works CGContextShowTextAtPoint(context, 1,1, "hello", 6); } I want to kn ow how to call above method, i have paste above code in the implemntation file simply, but dont know why its not called when i execute the project, can some one

    Read the article

  • Custom Cell over lapping.

    - by user338322
    I am trying to use a custom cell, My custom cell is of size 320*220 pixels. My table size is 320* by 1500 which is large enough I have set custom cell's view in scale to fill mode. But when i fill the table using custom cell all i see is first row. i have total four rows to be filld in a custom way. but they gets overlapped and i can not see any of the table.. They do look, but overlapped, Any hints .. about why its happening Do i need to make changes into nib? -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ static NSString *CellIdentifier = @"CustomCell"; CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[CustomCell class]]) cell = (CustomCell *)oneObject; } cell.iconImage.image = [UIImage imageNamed:[NSString stringWithFormat:@"beach%d.jpg",indexPath.row+1]]; cell.title.text=[[RArrray objectAtIndex:indexPath.row] objectForKey:@"Beach"]; return cell; }

    Read the article

  • Custom Font. Keeping the font width same.

    - by user338322
    I am trying to draw a string using quartz 2d. What i am doing is, i am drawing each letter of the string individually, because each letter has special attributes associated with it, by taking each letter into a new string. The string gets printed, but the space between the letters is not uniform. It looks very ugly to read . I read someting about using custom fonts. But i have no Idea, if I can do it!! my code is here. (void) drawRect : (CGRect)rect{ NSString *string=@"My Name Is Adam"; float j=0; const char *charStr=[string cStringUsingEncoding: NSASCIIStringEncoding]; for(int i=0;i { NSString *str=[NSString stringWithFormat:@"%c",charStr[i]]; const char *s=[str cStringUsingEncoding:NSASCIIStringEncoding]; NSLog(@"%s",s); CGContextRef context=[self getMeContextRef]; CGContextSetTextMatrix (context,CGAffineTransformMakeScale(1.0, -1.0)) ; CGContextSelectFont(context, "Arial", 24, kCGEncodingMacRoman); //CGContextSetCharacterSpacing (context, 10); CGContextSetRGBFillColor (context, 0,0,200, 1); CGContextSetTextDrawingMode(context,kCGTextFill); CGContextShowTextAtPoint(context, 80+j,80,s,1); j=j+15; } } In the output 'My Name is Adam' gets printed but the space between the letters is not uniform.!! is there any way to make the space uniform!!!

    Read the article

1