+ (UIImage *) imagenamed: (NSString *) name Ofbundle: (NSString *) Bundlename {
static nsmutabledictionary *loadedobjectdict = nil;
if (!loadedobjectdict) {
Loadedobjectdict = [[Nsmutabledictionary alloc] init];
}
NSString *keystring = [NSString stringwithformat:@ "%@%@", Bundlename, name];
Rcdliveweakref *ref = loadedobjectdict[keystring];
if (ref.weakref) {
return ref.weakref;
}
UIImage *image = nil;
NSString *image_name = [NSString stringwithformat:@ "%@.png", name];
NSString *resourcepath = [[NSBundle mainbundle] resourcepath];
NSString *bundlepath = [ResourcePath stringbyappendingpathcomponent:bundlename];
NSString *image_path = [Bundlepath stringbyappendingpathcomponent:image_name];
nsstring* path = [[[[NSBundle Mainbundle] ResourcePath]
Stringbyappendingpathcomponent:bundlename]stringbyappendingpathcomponent:[nsstring
stringwithformat:@ "%@.png", name]];
Image = [UIImage Imagewithcontentsoffile:image_path];
Image = [[UIImage alloc] initwithcontentsoffile:image_path];
[Loadedobjectdict setobject:[rcdliveweakref refwithobject:image] forkey:keystring];
return image;
}
Images from iOS loading. bundle files