RAUtils.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // RAUtils.h
  3. // RedAnt ERP Mobile
  4. //
  5. // Created by Ray on 9/17/15.
  6. // Copyright (c) 2015 United Software Applications, Inc. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. //typedef struct {
  10. //
  11. // NSString* id;
  12. //
  13. // float height;
  14. //
  15. //
  16. //}MyTestStruct;
  17. typedef void (^add_to_cart_Handler)(void);
  18. @interface RAUtils : NSObject
  19. +(NSString*) FloatFormat:(float)value;
  20. +(UIViewController*) getViewController:(UIView*) view;
  21. + (CGRect)relativeFrameForScreenWithView:(UIView *)v;
  22. +(NSDictionary*) error_json :(int)code err_msg:(NSString*)msg;
  23. +(void) message_alert :(NSString*) msg title:(NSString*) title controller:(UIViewController*) vc;
  24. +(void) alert_view :(NSString*) msg title:(NSString*) title ;
  25. +(UIAlertView * ) waiting_alert :(NSString*) msg title:(NSString*) title;
  26. + (float)fileSizeForDir:(NSString*)path;//计算文件夹下文件的总大小;
  27. +(void) deletefiles :(NSString*) path;
  28. +(NSString*) dict2string:(NSDictionary*) dict;
  29. +(NSString*) arr2string:(NSArray *) arr separator:(NSString*)separator trim:(bool) btrim;
  30. +(NSString*) base64en:(NSString*) string;
  31. +(NSString*) base64de:(NSString*) string;
  32. +(NSDictionary*) device_info;
  33. +(NSDictionary*) error_dict:(NSError*)error;
  34. + (UIImage *)scaleToSize:(UIImage *)img size:(CGSize)size;
  35. +(UIImage*)img_compress:(UIImage*)image kbsize:(float) size;
  36. +(NSString* )current_date;
  37. +(NSMutableArray*)dictionary2array:(NSDictionary*)json count_fields:(NSString*) count_fields item_mark:(NSString*) item_mark items_mark:(NSString* )items_mark;
  38. +(NSArray*) string2arr:(NSString*) string separator:(NSString*)separator;
  39. +(void) add_to_cart:(UIViewController*) vc selector:(SEL)aSelector;
  40. @end