I am in my IOS application in which i am getting ID from server which i am saving in string and then add strings in NSMutableArray.I am not getting perfect method by which i can add the strings in array and use the array outside the scope. Here is my code Please help me out::
- (void)flickrAPIRequest:(OFFlickrAPIRequest *)inRequest didCompleteWithResponse:(NSDictionary *)inResponseDictionary
{
NSMutableArray *array=[[NSMutableArray alloc]init];
i=0;
NSLog(@"%s %@ %@", __PRETTY_FUNCTION__, inRequest.sessionInfo, inResponseDictionary);
if (inRequest.sessionInfo == kUploadImageStep)
{
snapPictureDescriptionLabel.text = @"Setting properties...";
NSLog(@"%@", inResponseDictionary);
NSString* photoID =[[inResponseDictionary valueForKeyPath:@"photoid"] textContent];
flickrRequest.sessionInfo = kSetImagePropertiesStep;
// for uploading pics on flickr we call this method
[flickrRequest callAPIMethodWithPOST:@"flickr.photos.setMeta" arguments:[NSDictionary dictionaryWithObjectsAndKeys:photoID, @"photo_id", @"PicBackMan", @"title", @"Uploaded from my iPhone/iPod Touch", @"description", nil]];
[self.array addObject:photoID];
arr=array[0];
counterflicker++;
NSLog(@" Count : %lu", (unsigned long)[array count]);
}
How can i add the photoID(Strings) in the array? Please help me out..
arrayin a parent scope, probably you have to define thearrayin the parent scope. does is make sense to you?