2

i have a stupid question...sometimes i see developers use the following code...

NSString *newURL = [_parameters objectForKey:@"url"];

when i use this i get error... here what is _parameters and how to declare it??

i can provide more example..

        NSLog(@"SaveImage Called");
        //google code for turning base64 into uiimage
   NSURL *url = [NSURL URLWithString:[self._parameters objectForKey:@"imageData"]];    
   NSData *imageData = [NSData dataWithContentsOfURL:url];
   UIImage *img = [UIImage imageWithData:imageData];   
   /*
   if(img != nil) {
      UIImageWriteToSavedPhotosAlbum(img, self, nil, nil);
   }
   */   
2
  • That's not JavaScript... Commented Jul 18, 2010 at 8:32
  • I retagged the question to objective-c. Feel free to revert it if you give a good reason why it should be tagged javascript ;) Commented Jul 18, 2010 at 8:34

1 Answer 1

1

_parameters is a NSDictionary that seems to be defined previously in the code, e.g.

NSDictionary _parameters = [NSDictionary dictionaryWithObjects:@"foo", @"bar", nil
                                         forKeys:@"url", @"host", nil];

What exactly is your question? How is this related to JavaScript (edit: question was tagged as javascript)? You know that the language you use is Objective-C ?

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.