I am trying to receive the url image and post the image into base64 format.
i am worked out this way but i didn't find any solution.
my .h file
@interface urlconnection : NSObject
{
id delegate;
NSMutableData *receivedData;
NSURL *url;
// NSData * imageData;
IBOutlet NSImageView * myimages;
//and also trying UIImageView also atleast i didn't receive the image
}
@property (nonatomic,retain) NSMutableData *receivedData;
@property (retain) id delegate;
- (void)post: (NSString *)urlString;
@end
my implementation file is
- (void)post: (NSString *)urlString {
myimages.image = [NSImageView imageWithData:[NSData dataWithContentsOfURL:
[NSURL URLWithString:@"http://www.iphonedevelopers.com/files/2010/03/iphone-sdk2.jpg" ]]];
NSLog(@"image shown successfully");
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:
[NSURL URLWithString:@"http://www.iphonedevelopers.com/files/2010/03/iphone-sdk2.jpg"]];
[request setHTTPMethod:@"POST"];
[request setValue:@"image/"
forHTTPHeaderField:@"Content-type"];
[request setValue:[NSString stringWithFormat:@"%d", imageData length]]
forHTTPHeaderField:@"Content-length"];
[request setHTTPBody:imageData];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
please friends help me because i am new this concept
and please suggest the best tutorial for this concepts....