perhaps not the best solution, but you can try this way:
-(void)setImageLink:(NSString *)imageLinkStr {
imageLink = imageLinkStr;
//// I can see the value here
NSLog(@"111 %@ 111",imageLinkStr);
NSLog(@"222 %@ 222",imageLink);
[[NSUserDefaults standardUserDefaults] setObject:imageLink forKey:@"image"];
[[NSUserDefaults standardUserDefaults]synchronize];
}
- (NSInteger)numberOfPhotos {
NSString *importImage = [[NSUserDefaults standardUserDefaults] objectForKey:@"image"];
////imageLink string is (null) Problem here
NSLog(@"222 %@ 222",importImage);
images_ = [[NSArray alloc] initWithObjects:
[NSArray arrayWithObjects:@"http://farm3.static.flickr.com/2756/4464013736_524526b2b2_z.jpg", @"http://farm3.static.flickr.com/2756/4464013736_524526b2b2_s.jpg", nil], [NSArray arrayWithObjects:importImage, importImage, nil], nil];
NSInteger count = [images_ count];
return count;
}