0

I use sdwebimage and ktphotobrowser for my thumbnail gallery. because I have different galleries I need many sources. But i can't change the datasource in the SDWebImageDataSource.m file

I made a variable named myStr and now i want to get it in the SDWebImageDataSource's init function so i can get data from another source

Is it possible or may I have a change create another function named initWithString then pass my path to that function?

in my viewcontroller I initialize the SDWebImageDataSource as SDWebImageDataSource *sd = [[SDWebImageDataSource alloc]init]; then i set variable sd.myStr=@"http://mypath.com";

but I can't get the value of myStr in the init function of SDWebImageDataSource.m file

ercan
  • 825
  • 3
  • 16
  • 27

1 Answers1

0

In Init method, initialize your string by setting an empty string. This will solve your problem. or if you can manage to create custom method [[SDWebImageDataSource alloc]initWithString:@"SOMESTRING"];will also be fine.

Tarun
  • 766
  • 1
  • 5
  • 12
  • if i understand correctly you say: if i initialize my string as an empty string does my code work? – ercan May 17 '12 at 15:58
  • thanks i did with custom method [[SDWebImageDataSource alloc]initWithString:@"SOMESTRING"]; – ercan May 18 '12 at 12:11