Skip to content
This repository was archived by the owner on Nov 11, 2021. It is now read-only.

ResponseResource

yaakaito edited this page Apr 28, 2012 · 3 revisions

ResponseResource

[stub andResponseResource:filename ofType:type];

to

NSString *filePath = [[NSBundle bundleForClass:[self class]] pathForResource:@"test"
                                                     ofType:@"txt"];
NSString *fileText [NSString stringWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:&error];
self.data = [fileText usingDataEncoding:NSUTF8StringEncoding];

attention

  • bundleForClass -> [self class]
  • NSData via NSString(NSUTF8StringEncoding)
  • encoding -> NSUTF8StringEncoding
  • not support binary
Clone this wiki locally