Question

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

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top